diff options
Diffstat (limited to 'arch/sparc64/kernel/pci_common.c')
-rw-r--r-- | arch/sparc64/kernel/pci_common.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index 1e6aeedf43c4..76faaa8135dd 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c | |||
@@ -9,12 +9,26 @@ | |||
9 | #include <linux/pci.h> | 9 | #include <linux/pci.h> |
10 | #include <linux/device.h> | 10 | #include <linux/device.h> |
11 | 11 | ||
12 | #include <asm/pbm.h> | ||
13 | #include <asm/prom.h> | 12 | #include <asm/prom.h> |
14 | #include <asm/of_device.h> | 13 | #include <asm/of_device.h> |
14 | #include <asm/oplib.h> | ||
15 | 15 | ||
16 | #include "pci_impl.h" | 16 | #include "pci_impl.h" |
17 | 17 | ||
18 | void pci_get_pbm_props(struct pci_pbm_info *pbm) | ||
19 | { | ||
20 | const u32 *val = of_get_property(pbm->prom_node, "bus-range", NULL); | ||
21 | |||
22 | pbm->pci_first_busno = val[0]; | ||
23 | pbm->pci_last_busno = val[1]; | ||
24 | |||
25 | val = of_get_property(pbm->prom_node, "ino-bitmap", NULL); | ||
26 | if (val) { | ||
27 | pbm->ino_bitmap = (((u64)val[1] << 32UL) | | ||
28 | ((u64)val[0] << 0UL)); | ||
29 | } | ||
30 | } | ||
31 | |||
18 | static void pci_register_legacy_regions(struct resource *io_res, | 32 | static void pci_register_legacy_regions(struct resource *io_res, |
19 | struct resource *mem_res) | 33 | struct resource *mem_res) |
20 | { | 34 | { |
@@ -149,8 +163,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) | |||
149 | } | 163 | } |
150 | 164 | ||
151 | /* Generic helper routines for PCI error reporting. */ | 165 | /* Generic helper routines for PCI error reporting. */ |
152 | void pci_scan_for_target_abort(struct pci_controller_info *p, | 166 | void pci_scan_for_target_abort(struct pci_pbm_info *pbm, |
153 | struct pci_pbm_info *pbm, | ||
154 | struct pci_bus *pbus) | 167 | struct pci_bus *pbus) |
155 | { | 168 | { |
156 | struct pci_dev *pdev; | 169 | struct pci_dev *pdev; |
@@ -165,18 +178,16 @@ void pci_scan_for_target_abort(struct pci_controller_info *p, | |||
165 | PCI_STATUS_REC_TARGET_ABORT)); | 178 | PCI_STATUS_REC_TARGET_ABORT)); |
166 | if (error_bits) { | 179 | if (error_bits) { |
167 | pci_write_config_word(pdev, PCI_STATUS, error_bits); | 180 | pci_write_config_word(pdev, PCI_STATUS, error_bits); |
168 | printk("PCI%d(PBM%c): Device [%s] saw Target Abort [%016x]\n", | 181 | printk("%s: Device %s saw Target Abort [%016x]\n", |
169 | p->index, ((pbm == &p->pbm_A) ? 'A' : 'B'), | 182 | pbm->name, pci_name(pdev), status); |
170 | pci_name(pdev), status); | ||
171 | } | 183 | } |
172 | } | 184 | } |
173 | 185 | ||
174 | list_for_each_entry(bus, &pbus->children, node) | 186 | list_for_each_entry(bus, &pbus->children, node) |
175 | pci_scan_for_target_abort(p, pbm, bus); | 187 | pci_scan_for_target_abort(pbm, bus); |
176 | } | 188 | } |
177 | 189 | ||
178 | void pci_scan_for_master_abort(struct pci_controller_info *p, | 190 | void pci_scan_for_master_abort(struct pci_pbm_info *pbm, |
179 | struct pci_pbm_info *pbm, | ||
180 | struct pci_bus *pbus) | 191 | struct pci_bus *pbus) |
181 | { | 192 | { |
182 | struct pci_dev *pdev; | 193 | struct pci_dev *pdev; |
@@ -190,18 +201,16 @@ void pci_scan_for_master_abort(struct pci_controller_info *p, | |||
190 | (status & (PCI_STATUS_REC_MASTER_ABORT)); | 201 | (status & (PCI_STATUS_REC_MASTER_ABORT)); |
191 | if (error_bits) { | 202 | if (error_bits) { |
192 | pci_write_config_word(pdev, PCI_STATUS, error_bits); | 203 | pci_write_config_word(pdev, PCI_STATUS, error_bits); |
193 | printk("PCI%d(PBM%c): Device [%s] received Master Abort [%016x]\n", | 204 | printk("%s: Device %s received Master Abort [%016x]\n", |
194 | p->index, ((pbm == &p->pbm_A) ? 'A' : 'B'), | 205 | pbm->name, pci_name(pdev), status); |
195 | pci_name(pdev), status); | ||
196 | } | 206 | } |
197 | } | 207 | } |
198 | 208 | ||
199 | list_for_each_entry(bus, &pbus->children, node) | 209 | list_for_each_entry(bus, &pbus->children, node) |
200 | pci_scan_for_master_abort(p, pbm, bus); | 210 | pci_scan_for_master_abort(pbm, bus); |
201 | } | 211 | } |
202 | 212 | ||
203 | void pci_scan_for_parity_error(struct pci_controller_info *p, | 213 | void pci_scan_for_parity_error(struct pci_pbm_info *pbm, |
204 | struct pci_pbm_info *pbm, | ||
205 | struct pci_bus *pbus) | 214 | struct pci_bus *pbus) |
206 | { | 215 | { |
207 | struct pci_dev *pdev; | 216 | struct pci_dev *pdev; |
@@ -216,12 +225,11 @@ void pci_scan_for_parity_error(struct pci_controller_info *p, | |||
216 | PCI_STATUS_DETECTED_PARITY)); | 225 | PCI_STATUS_DETECTED_PARITY)); |
217 | if (error_bits) { | 226 | if (error_bits) { |
218 | pci_write_config_word(pdev, PCI_STATUS, error_bits); | 227 | pci_write_config_word(pdev, PCI_STATUS, error_bits); |
219 | printk("PCI%d(PBM%c): Device [%s] saw Parity Error [%016x]\n", | 228 | printk("%s: Device %s saw Parity Error [%016x]\n", |
220 | p->index, ((pbm == &p->pbm_A) ? 'A' : 'B'), | 229 | pbm->name, pci_name(pdev), status); |
221 | pci_name(pdev), status); | ||
222 | } | 230 | } |
223 | } | 231 | } |
224 | 232 | ||
225 | list_for_each_entry(bus, &pbus->children, node) | 233 | list_for_each_entry(bus, &pbus->children, node) |
226 | pci_scan_for_parity_error(p, pbm, bus); | 234 | pci_scan_for_parity_error(pbm, bus); |
227 | } | 235 | } |