aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-12-20 23:39:38 -0500
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>2007-12-23 14:19:03 -0500
commitaccf5ef254b9dd4d3b53040dd73d80875c2cd39b (patch)
tree93ef10f49c2b5d3b4f8874ea713bac93e0a1eeb8 /arch/powerpc/sysdev
parent25c24f3dc7f01491ea0d92a1de2bb84094b27e21 (diff)
[POWERPC] 4xx: Add 440SPe revA runtime detection to PCIe
This patch adds runtime detection of the 440SPe revision A chips. These chips are equipped with a slighly different PCIe core and need special/ different initialization. The compatible node is changed to "plb-pciex-440spe" ("A" and "B" dropped). This is needed for boards that can be equipped with both PPC revisions like the AMCC Yucca. Signed-off-by: Stefan Roese <sr@denx.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/ppc4xx_pci.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 0538980ef89..a656dc004b8 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -49,6 +49,15 @@ extern unsigned long total_memory;
49#define RES_TO_U32_HIGH(val) (0) 49#define RES_TO_U32_HIGH(val) (0)
50#endif 50#endif
51 51
52static inline int ppc440spe_revA(void)
53{
54 /* Catch both 440SPe variants, with and without RAID6 support */
55 if ((mfspr(SPRN_PVR) & 0xffefffff) == 0x53421890)
56 return 1;
57 else
58 return 0;
59}
60
52static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev) 61static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
53{ 62{
54 struct pci_controller *hose; 63 struct pci_controller *hose;
@@ -516,8 +525,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
516 * 525 *
517 * We support 3 parts currently based on the compatible property: 526 * We support 3 parts currently based on the compatible property:
518 * 527 *
519 * ibm,plb-pciex-440speA 528 * ibm,plb-pciex-440spe
520 * ibm,plb-pciex-440speB
521 * ibm,plb-pciex-405ex 529 * ibm,plb-pciex-405ex
522 * 530 *
523 * Anything else will be rejected for now as they are all subtly 531 * Anything else will be rejected for now as they are all subtly
@@ -688,7 +696,7 @@ static int ppc440spe_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
688 696
689 mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val); 697 mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val);
690 mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x20222222); 698 mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x20222222);
691 if (of_device_is_compatible(port->node, "ibm,plb-pciex-440speA")) 699 if (ppc440spe_revA())
692 mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x11000000); 700 mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x11000000);
693 mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL0SET1, 0x35000000); 701 mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL0SET1, 0x35000000);
694 mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL1SET1, 0x35000000); 702 mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL1SET1, 0x35000000);
@@ -767,7 +775,6 @@ static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
767 .setup_utl = ppc440speB_pciex_init_utl, 775 .setup_utl = ppc440speB_pciex_init_utl,
768}; 776};
769 777
770
771#endif /* CONFIG_44x */ 778#endif /* CONFIG_44x */
772 779
773#ifdef CONFIG_40x 780#ifdef CONFIG_40x
@@ -881,10 +888,12 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
881 return 0; 888 return 0;
882 889
883#ifdef CONFIG_44x 890#ifdef CONFIG_44x
884 if (of_device_is_compatible(np, "ibm,plb-pciex-440speA")) 891 if (of_device_is_compatible(np, "ibm,plb-pciex-440spe")) {
885 ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops; 892 if (ppc440spe_revA())
886 else if (of_device_is_compatible(np, "ibm,plb-pciex-440speB")) 893 ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops;
887 ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops; 894 else
895 ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
896 }
888#endif /* CONFIG_44x */ 897#endif /* CONFIG_44x */
889#ifdef CONFIG_40x 898#ifdef CONFIG_40x
890 if (of_device_is_compatible(np, "ibm,plb-pciex-405ex")) 899 if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))