diff options
Diffstat (limited to 'arch/sparc64/kernel/pci_fire.c')
-rw-r--r-- | arch/sparc64/kernel/pci_fire.c | 56 |
1 files changed, 14 insertions, 42 deletions
diff --git a/arch/sparc64/kernel/pci_fire.c b/arch/sparc64/kernel/pci_fire.c index 0fe626631e1..2e0eb4ee8f7 100644 --- a/arch/sparc64/kernel/pci_fire.c +++ b/arch/sparc64/kernel/pci_fire.c @@ -7,7 +7,6 @@ #include <linux/slab.h> #include <linux/init.h> -#include <asm/pbm.h> #include <asm/oplib.h> #include <asm/prom.h> @@ -160,21 +159,9 @@ static struct pci_ops pci_fire_ops = { .write = fire_write_pci_cfg, }; -static void pbm_scan_bus(struct pci_controller_info *p, - struct pci_pbm_info *pbm) +static void pci_fire_scan_bus(struct pci_pbm_info *pbm) { pbm->pci_bus = pci_scan_one_pbm(pbm); -} - -static void pci_fire_scan_bus(struct pci_controller_info *p) -{ - struct device_node *dp; - - if ((dp = p->pbm_A.prom_node) != NULL) - pbm_scan_bus(p, &p->pbm_A); - - if ((dp = p->pbm_B.prom_node) != NULL) - pbm_scan_bus(p, &p->pbm_B); /* XXX register error interrupt handlers XXX */ } @@ -313,18 +300,24 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm) } static void pci_fire_pbm_init(struct pci_controller_info *p, - struct device_node *dp, u32 portid) + struct device_node *dp, u32 portid) { const struct linux_prom64_registers *regs; struct pci_pbm_info *pbm; - const u32 *ino_bitmap; - const unsigned int *busrange; if ((portid & 1) == 0) pbm = &p->pbm_A; else pbm = &p->pbm_B; + pbm->next = pci_pbm_root; + pci_pbm_root = pbm; + + pbm->scan_bus = pci_fire_scan_bus; + pbm->pci_ops = &pci_fire_ops; + + pbm->index = pci_num_pbms++; + pbm->portid = portid; pbm->parent = p; pbm->prom_node = dp; @@ -338,13 +331,7 @@ static void pci_fire_pbm_init(struct pci_controller_info *p, pci_determine_mem_io_space(pbm); - ino_bitmap = of_get_property(dp, "ino-bitmap", NULL); - pbm->ino_bitmap = (((u64)ino_bitmap[1] << 32UL) | - ((u64)ino_bitmap[0] << 0UL)); - - busrange = of_get_property(dp, "bus-range", NULL); - pbm->pci_first_busno = busrange[0]; - pbm->pci_last_busno = busrange[1]; + pci_get_pbm_props(pbm); pci_fire_hw_init(pbm); pci_fire_pbm_iommu_init(pbm); @@ -362,19 +349,11 @@ void fire_pci_init(struct device_node *dp, const char *model_name) struct pci_controller_info *p; u32 portid = of_getintprop_default(dp, "portid", 0xff); struct iommu *iommu; + struct pci_pbm_info *pbm; - for (p = pci_controller_root; p; p = p->next) { - struct pci_pbm_info *pbm; - - if (p->pbm_A.prom_node && p->pbm_B.prom_node) - continue; - - pbm = (p->pbm_A.prom_node ? - &p->pbm_A : - &p->pbm_B); - + for (pbm = pci_pbm_root; pbm; pbm = pbm->next) { if (portid_compare(pbm->portid, portid)) { - pci_fire_pbm_init(p, dp, portid); + pci_fire_pbm_init(pbm->parent, dp, portid); return; } } @@ -395,14 +374,7 @@ void fire_pci_init(struct device_node *dp, const char *model_name) p->pbm_B.iommu = iommu; - p->next = pci_controller_root; - pci_controller_root = p; - - p->index = pci_num_controllers++; - - p->scan_bus = pci_fire_scan_bus; /* XXX MSI support XXX */ - p->pci_ops = &pci_fire_ops; /* Like PSYCHO and SCHIZO we have a 2GB aligned area * for memory space. |