diff options
Diffstat (limited to 'arch/sparc64/kernel/pci_sabre.c')
-rw-r--r-- | arch/sparc64/kernel/pci_sabre.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index 9e706013d11a..024dbd8ad025 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c | |||
@@ -825,9 +825,9 @@ static irqreturn_t sabre_pcierr_intr(int irq, void *dev_id) | |||
825 | return IRQ_HANDLED; | 825 | return IRQ_HANDLED; |
826 | } | 826 | } |
827 | 827 | ||
828 | static void sabre_register_error_handlers(struct pci_controller_info *p) | 828 | static void sabre_register_error_handlers(struct pci_pbm_info *pbm) |
829 | { | 829 | { |
830 | struct pci_pbm_info *pbm = &p->pbm_A; /* arbitrary */ | 830 | struct pci_controller_info *p = pbm->parent; |
831 | struct device_node *dp = pbm->prom_node; | 831 | struct device_node *dp = pbm->prom_node; |
832 | struct of_device *op; | 832 | struct of_device *op; |
833 | unsigned long base = pbm->controller_regs; | 833 | unsigned long base = pbm->controller_regs; |
@@ -858,22 +858,22 @@ static void sabre_register_error_handlers(struct pci_controller_info *p) | |||
858 | SABRE_UEAFSR_SDRD | SABRE_UEAFSR_SDWR | | 858 | SABRE_UEAFSR_SDRD | SABRE_UEAFSR_SDWR | |
859 | SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE)); | 859 | SABRE_UEAFSR_SDTE | SABRE_UEAFSR_PDTE)); |
860 | 860 | ||
861 | request_irq(op->irqs[1], sabre_ue_intr, IRQF_SHARED, "SABRE UE", p); | 861 | request_irq(op->irqs[1], sabre_ue_intr, 0, "SABRE_UE", p); |
862 | 862 | ||
863 | sabre_write(base + SABRE_CE_AFSR, | 863 | sabre_write(base + SABRE_CE_AFSR, |
864 | (SABRE_CEAFSR_PDRD | SABRE_CEAFSR_PDWR | | 864 | (SABRE_CEAFSR_PDRD | SABRE_CEAFSR_PDWR | |
865 | SABRE_CEAFSR_SDRD | SABRE_CEAFSR_SDWR)); | 865 | SABRE_CEAFSR_SDRD | SABRE_CEAFSR_SDWR)); |
866 | 866 | ||
867 | request_irq(op->irqs[2], sabre_ce_intr, IRQF_SHARED, "SABRE CE", p); | 867 | request_irq(op->irqs[2], sabre_ce_intr, 0, "SABRE_CE", p); |
868 | request_irq(op->irqs[0], sabre_pcierr_intr, IRQF_SHARED, | 868 | request_irq(op->irqs[0], sabre_pcierr_intr, 0, |
869 | "SABRE PCIERR", p); | 869 | "SABRE_PCIERR", p); |
870 | 870 | ||
871 | tmp = sabre_read(base + SABRE_PCICTRL); | 871 | tmp = sabre_read(base + SABRE_PCICTRL); |
872 | tmp |= SABRE_PCICTRL_ERREN; | 872 | tmp |= SABRE_PCICTRL_ERREN; |
873 | sabre_write(base + SABRE_PCICTRL, tmp); | 873 | sabre_write(base + SABRE_PCICTRL, tmp); |
874 | } | 874 | } |
875 | 875 | ||
876 | static void apb_init(struct pci_controller_info *p, struct pci_bus *sabre_bus) | 876 | static void apb_init(struct pci_bus *sabre_bus) |
877 | { | 877 | { |
878 | struct pci_dev *pdev; | 878 | struct pci_dev *pdev; |
879 | 879 | ||
@@ -909,7 +909,7 @@ static void apb_init(struct pci_controller_info *p, struct pci_bus *sabre_bus) | |||
909 | } | 909 | } |
910 | } | 910 | } |
911 | 911 | ||
912 | static void sabre_scan_bus(struct pci_controller_info *p) | 912 | static void sabre_scan_bus(struct pci_pbm_info *pbm) |
913 | { | 913 | { |
914 | static int once; | 914 | static int once; |
915 | struct pci_bus *pbus; | 915 | struct pci_bus *pbus; |
@@ -918,7 +918,7 @@ static void sabre_scan_bus(struct pci_controller_info *p) | |||
918 | * at 66Mhz, but the front side of APB runs at 33Mhz | 918 | * at 66Mhz, but the front side of APB runs at 33Mhz |
919 | * for both segments. | 919 | * for both segments. |
920 | */ | 920 | */ |
921 | p->pbm_A.is_66mhz_capable = 0; | 921 | pbm->is_66mhz_capable = 0; |
922 | 922 | ||
923 | /* This driver has not been verified to handle | 923 | /* This driver has not been verified to handle |
924 | * multiple SABREs yet, so trap this. | 924 | * multiple SABREs yet, so trap this. |
@@ -932,15 +932,15 @@ static void sabre_scan_bus(struct pci_controller_info *p) | |||
932 | } | 932 | } |
933 | once++; | 933 | once++; |
934 | 934 | ||
935 | pbus = pci_scan_one_pbm(&p->pbm_A); | 935 | pbus = pci_scan_one_pbm(pbm); |
936 | if (!pbus) | 936 | if (!pbus) |
937 | return; | 937 | return; |
938 | 938 | ||
939 | sabre_root_bus = pbus; | 939 | sabre_root_bus = pbus; |
940 | 940 | ||
941 | apb_init(p, pbus); | 941 | apb_init(pbus); |
942 | 942 | ||
943 | sabre_register_error_handlers(p); | 943 | sabre_register_error_handlers(pbm); |
944 | } | 944 | } |
945 | 945 | ||
946 | static void sabre_iommu_init(struct pci_controller_info *p, | 946 | static void sabre_iommu_init(struct pci_controller_info *p, |
@@ -1003,6 +1003,8 @@ static void sabre_pbm_init(struct pci_controller_info *p, struct device_node *dp | |||
1003 | pbm->name = dp->full_name; | 1003 | pbm->name = dp->full_name; |
1004 | printk("%s: SABRE PCI Bus Module\n", pbm->name); | 1004 | printk("%s: SABRE PCI Bus Module\n", pbm->name); |
1005 | 1005 | ||
1006 | pbm->scan_bus = sabre_scan_bus; | ||
1007 | |||
1006 | pbm->chip_type = PBM_CHIP_TYPE_SABRE; | 1008 | pbm->chip_type = PBM_CHIP_TYPE_SABRE; |
1007 | pbm->parent = p; | 1009 | pbm->parent = p; |
1008 | pbm->prom_node = dp; | 1010 | pbm->prom_node = dp; |
@@ -1055,12 +1057,11 @@ void sabre_init(struct device_node *dp, char *model_name) | |||
1055 | 1057 | ||
1056 | upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); | 1058 | upa_portid = of_getintprop_default(dp, "upa-portid", 0xff); |
1057 | 1059 | ||
1058 | p->next = pci_controller_root; | 1060 | p->pbm_A.next = pci_pbm_root; |
1059 | pci_controller_root = p; | 1061 | pci_pbm_root = &p->pbm_A; |
1060 | 1062 | ||
1061 | p->pbm_A.portid = upa_portid; | 1063 | p->pbm_A.portid = upa_portid; |
1062 | p->index = pci_num_controllers++; | 1064 | p->index = pci_num_controllers++; |
1063 | p->scan_bus = sabre_scan_bus; | ||
1064 | p->pci_ops = &sabre_ops; | 1065 | p->pci_ops = &sabre_ops; |
1065 | 1066 | ||
1066 | /* | 1067 | /* |