Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| 6 | * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved. |
| 7 | */ |
| 8 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #include <linux/interrupt.h> |
Prarit Bhargava | c13cf37 | 2005-07-06 15:26:51 -0700 | [diff] [blame] | 10 | #include <linux/types.h> |
Tony Luck | 1fa9295 | 2005-09-09 11:41:12 -0700 | [diff] [blame] | 11 | #include <asm/sn/io.h> |
Prarit Bhargava | c13cf37 | 2005-07-06 15:26:51 -0700 | [diff] [blame] | 12 | #include <asm/sn/pcibr_provider.h> |
Mark Maule | 9b08ebd | 2005-04-25 11:32:16 -0700 | [diff] [blame] | 13 | #include <asm/sn/pcibus_provider_defs.h> |
| 14 | #include <asm/sn/pcidev.h> |
Prarit Bhargava | c13cf37 | 2005-07-06 15:26:51 -0700 | [diff] [blame] | 15 | #include <asm/sn/pic.h> |
| 16 | #include <asm/sn/tiocp.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
| 18 | union br_ptr { |
| 19 | struct tiocp tio; |
| 20 | struct pic pic; |
| 21 | }; |
| 22 | |
| 23 | /* |
| 24 | * Control Register Access -- Read/Write 0000_0020 |
| 25 | */ |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 26 | void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, u64 bits) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 28 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
| 30 | if (pcibus_info) { |
| 31 | switch (pcibus_info->pbi_bridge_type) { |
| 32 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 33 | __sn_clrq_relaxed(&ptr->tio.cp_control, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | break; |
| 35 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 36 | __sn_clrq_relaxed(&ptr->pic.p_wid_control, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | break; |
| 38 | default: |
| 39 | panic |
| 40 | ("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 41 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 46 | void pcireg_control_bit_set(struct pcibus_info *pcibus_info, u64 bits) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 48 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | |
| 50 | if (pcibus_info) { |
| 51 | switch (pcibus_info->pbi_bridge_type) { |
| 52 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 53 | __sn_setq_relaxed(&ptr->tio.cp_control, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | break; |
| 55 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 56 | __sn_setq_relaxed(&ptr->pic.p_wid_control, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | break; |
| 58 | default: |
| 59 | panic |
| 60 | ("pcireg_control_bit_set: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 61 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /* |
| 67 | * PCI/PCIX Target Flush Register Access -- Read Only 0000_0050 |
| 68 | */ |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 69 | u64 pcireg_tflush_get(struct pcibus_info *pcibus_info) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 71 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 72 | u64 ret = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
| 74 | if (pcibus_info) { |
| 75 | switch (pcibus_info->pbi_bridge_type) { |
| 76 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 77 | ret = __sn_readq_relaxed(&ptr->tio.cp_tflush); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | break; |
| 79 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 80 | ret = __sn_readq_relaxed(&ptr->pic.p_wid_tflush); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | break; |
| 82 | default: |
| 83 | panic |
| 84 | ("pcireg_tflush_get: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 85 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | } |
| 87 | } |
| 88 | |
| 89 | /* Read of the Target Flush should always return zero */ |
| 90 | if (ret != 0) |
| 91 | panic("pcireg_tflush_get:Target Flush failed\n"); |
| 92 | |
| 93 | return ret; |
| 94 | } |
| 95 | |
| 96 | /* |
| 97 | * Interrupt Status Register Access -- Read Only 0000_0100 |
| 98 | */ |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 99 | u64 pcireg_intr_status_get(struct pcibus_info * pcibus_info) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 101 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 102 | u64 ret = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | |
| 104 | if (pcibus_info) { |
| 105 | switch (pcibus_info->pbi_bridge_type) { |
| 106 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 107 | ret = __sn_readq_relaxed(&ptr->tio.cp_int_status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | break; |
| 109 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 110 | ret = __sn_readq_relaxed(&ptr->pic.p_int_status); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | break; |
| 112 | default: |
| 113 | panic |
| 114 | ("pcireg_intr_status_get: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 115 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | } |
| 117 | } |
| 118 | return ret; |
| 119 | } |
| 120 | |
| 121 | /* |
| 122 | * Interrupt Enable Register Access -- Read/Write 0000_0108 |
| 123 | */ |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 124 | void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, u64 bits) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 125 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 126 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | |
| 128 | if (pcibus_info) { |
| 129 | switch (pcibus_info->pbi_bridge_type) { |
| 130 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 131 | __sn_clrq_relaxed(&ptr->tio.cp_int_enable, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | break; |
| 133 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 6fb93a9 | 2005-11-07 15:48:50 -0600 | [diff] [blame] | 134 | __sn_clrq_relaxed(&ptr->pic.p_int_enable, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | break; |
| 136 | default: |
| 137 | panic |
| 138 | ("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 139 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 140 | } |
| 141 | } |
| 142 | } |
| 143 | |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 144 | void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, u64 bits) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 145 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 146 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | |
| 148 | if (pcibus_info) { |
| 149 | switch (pcibus_info->pbi_bridge_type) { |
| 150 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 151 | __sn_setq_relaxed(&ptr->tio.cp_int_enable, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | break; |
| 153 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 154 | __sn_setq_relaxed(&ptr->pic.p_int_enable, bits); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | break; |
| 156 | default: |
| 157 | panic |
| 158 | ("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 159 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | /* |
| 165 | * Intr Host Address Register (int_addr) -- Read/Write 0000_0130 - 0000_0168 |
| 166 | */ |
| 167 | void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n, |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 168 | u64 addr) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 170 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | |
| 172 | if (pcibus_info) { |
| 173 | switch (pcibus_info->pbi_bridge_type) { |
| 174 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 175 | __sn_clrq_relaxed(&ptr->tio.cp_int_addr[int_n], |
| 176 | TIOCP_HOST_INTR_ADDR); |
| 177 | __sn_setq_relaxed(&ptr->tio.cp_int_addr[int_n], |
| 178 | (addr & TIOCP_HOST_INTR_ADDR)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 179 | break; |
| 180 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 181 | __sn_clrq_relaxed(&ptr->pic.p_int_addr[int_n], |
| 182 | PIC_HOST_INTR_ADDR); |
| 183 | __sn_setq_relaxed(&ptr->pic.p_int_addr[int_n], |
| 184 | (addr & PIC_HOST_INTR_ADDR)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | break; |
| 186 | default: |
| 187 | panic |
| 188 | ("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 189 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | } |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | /* |
| 195 | * Force Interrupt Register Access -- Write Only 0000_01C0 - 0000_01F8 |
| 196 | */ |
| 197 | void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n) |
| 198 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 199 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 200 | |
| 201 | if (pcibus_info) { |
| 202 | switch (pcibus_info->pbi_bridge_type) { |
| 203 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 204 | writeq(1, &ptr->tio.cp_force_pin[int_n]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 205 | break; |
| 206 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 207 | writeq(1, &ptr->pic.p_force_pin[int_n]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | break; |
| 209 | default: |
| 210 | panic |
| 211 | ("pcireg_force_intr_set: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 212 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /* |
| 218 | * Device(x) Write Buffer Flush Reg Access -- Read Only 0000_0240 - 0000_0258 |
| 219 | */ |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 220 | u64 pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 222 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 223 | u64 ret = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 224 | |
| 225 | if (pcibus_info) { |
| 226 | switch (pcibus_info->pbi_bridge_type) { |
| 227 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 228 | ret = |
| 229 | __sn_readq_relaxed(&ptr->tio.cp_wr_req_buf[device]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | break; |
| 231 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 232 | ret = |
| 233 | __sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | break; |
| 235 | default: |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 236 | panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | } |
| 240 | /* Read of the Write Buffer Flush should always return zero */ |
| 241 | return ret; |
| 242 | } |
| 243 | |
| 244 | void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index, |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 245 | u64 val) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 247 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | |
| 249 | if (pcibus_info) { |
| 250 | switch (pcibus_info->pbi_bridge_type) { |
| 251 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 252 | writeq(val, &ptr->tio.cp_int_ate_ram[ate_index]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | break; |
| 254 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 255 | writeq(val, &ptr->pic.p_int_ate_ram[ate_index]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | break; |
| 257 | default: |
| 258 | panic |
| 259 | ("pcireg_int_ate_set: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 260 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 265 | u64 __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | { |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 267 | union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base; |
Prarit Bhargava | 53493dc | 2006-01-16 19:54:40 -0800 | [diff] [blame] | 268 | u64 __iomem *ret = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | |
| 270 | if (pcibus_info) { |
| 271 | switch (pcibus_info->pbi_bridge_type) { |
| 272 | case PCIBR_BRIDGETYPE_TIOCP: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 273 | ret = &ptr->tio.cp_int_ate_ram[ate_index]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 274 | break; |
| 275 | case PCIBR_BRIDGETYPE_PIC: |
Mark Maule | 5fbcf9a | 2005-09-06 13:03:51 -0500 | [diff] [blame] | 276 | ret = &ptr->pic.p_int_ate_ram[ate_index]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | break; |
| 278 | default: |
| 279 | panic |
| 280 | ("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p", |
Al Viro | b3e5b5b | 2005-12-15 09:18:40 +0000 | [diff] [blame] | 281 | ptr); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | } |
| 283 | } |
| 284 | return ret; |
| 285 | } |