From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: To: Josh Boyer From: Benjamin Herrenschmidt Date: Thu, 13 Dec 2007 18:38:47 +1100 Subject: [PATCH 20/20] [POWERPC] 4xx: Add 440SPe revA runtime detection to PCIe Message-Id: <20071213073852.93DF2DE0FF@ozlabs.org> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Stefan Roese 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 Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/boot/dts/katmai.dts | 6 +++--- arch/powerpc/sysdev/ppc4xx_pci.c | 25 +++++++++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) --- linux-merge.orig/arch/powerpc/boot/dts/katmai.dts 2007-12-11 17:11:37.000000000 +1100 +++ linux-merge/arch/powerpc/boot/dts/katmai.dts 2007-12-11 17:11:37.000000000 +1100 @@ -268,7 +268,7 @@ #interrupt-cells = <1>; #size-cells = <2>; #address-cells = <3>; - compatible = "ibm,plb-pciex-440speB", "ibm,plb-pciex"; + compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex"; primary; port = <0>; /* port number */ reg = ; #size-cells = <2>; #address-cells = <3>; - compatible = "ibm,plb-pciex-440speB", "ibm,plb-pciex"; + compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex"; primary; port = <1>; /* port number */ reg = ; #size-cells = <2>; #address-cells = <3>; - compatible = "ibm,plb-pciex-440speB", "ibm,plb-pciex"; + compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex"; primary; port = <2>; /* port number */ reg = sdr_base + PESDRn_DLPSET, val); mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x20222222); - if (of_device_is_compatible(port->node, "ibm,plb-pciex-440speA")) + if (ppc440spe_revA()) mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x11000000); mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL0SET1, 0x35000000); mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL1SET1, 0x35000000); @@ -767,7 +775,6 @@ static struct ppc4xx_pciex_hwops ppc440s .setup_utl = ppc440speB_pciex_init_utl, }; - #endif /* CONFIG_44x */ #ifdef CONFIG_40x @@ -881,10 +888,12 @@ static int __init ppc4xx_pciex_check_cor return 0; #ifdef CONFIG_44x - if (of_device_is_compatible(np, "ibm,plb-pciex-440speA")) - ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops; - else if (of_device_is_compatible(np, "ibm,plb-pciex-440speB")) - ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops; + if (of_device_is_compatible(np, "ibm,plb-pciex-440spe")) { + if (ppc440spe_revA()) + ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops; + else + ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops; + } #endif /* CONFIG_44x */ #ifdef CONFIG_40x if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))