diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-05-08 02:06:27 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-05-08 19:41:24 -0400 |
commit | 34768bc8329194b14e42ee408a84edfa40059046 (patch) | |
tree | 3fff53138966f3a58e796a71c19a3b75de86fbf7 /arch/sparc64/kernel/pci_sabre.c | |
parent | 5a4a3e592d0d66653297049373caa7ac5b4febe0 (diff) |
[SPARC64] PCI: Use root list of pbm's instead of pci_controller_info's
The idea is to move more and more things into the pbm,
with the eventual goal of eliminating the pci_controller_info
entirely as there really isn't any need for it.
This stage of the transformations requires some reworking of
the PCI error interrupt handling.
It might be tricky to get rid of the pci_controller_info parenting for
a few reasons:
1) When we get an uncorrectable or correctable error we want
to interrogate the IOMMU and streaming cache of both
PBMs for error status. These errors come from the UPA
front-end which is shared between the two PBM PCI bus
segments.
Historically speaking this is why I choose the datastructure
hierarchy of pci_controller_info-->pci_pbm_info
2) The probing does a portid/devhandle match to look for the
'other' pbm, but this is entirely an artifact and can be
eliminated trivially.
What we could do to solve #1 is to have a "buddy" pointer from one pbm
to another.
Signed-off-by: David S. Miller <davem@davemloft.net>
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 | /* |