]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/85xx: Add PCIe controller support for bsc9132qds
authorHarninder Rai <harninder.rai@freescale.com>
Thu, 5 Nov 2015 03:16:00 +0000 (11:16 +0800)
committerScott Wood <scottwood@freescale.com>
Wed, 23 Dec 2015 00:17:15 +0000 (18:17 -0600)
1. Use machine_arch_initcall to hook mpc85xx_common_publish_devices
This can ensure before pcibios_init() is called, pci controllers have
been probed and added to the hose_list.
2. Add a workaround for errata A-005434
For the BSC9132, PEX_PEXIWARn[TRGT] for all windows defaults to 0xF,
which is mapped to CCSRBAR. However, for other products, 0xF is
mapped to the local memory. Therefore, for the BSC9132, any default
PCI Express access to the local memory (DDR) will now access the
CCSRBAR. This patch changes the mapping of targets of inbound windows
PEX_PEXIWARn[TRGT] to the Local address space – 0x0 (from 0xF).

Signed-off-by: Harninder Rai <harninder.rai@freescale.com>
Signed-off-by: Minghuan Lian <Minghuan.Lian@freescale.com>
Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
arch/powerpc/platforms/85xx/bsc913x_qds.c
arch/powerpc/sysdev/fsl_pci.c

index f0927e58af2579aa9adf082cf7912b23933887f4..dcfafd6b91ee1f48ced0620557039441d9f30618 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/pci.h>
 #include <asm/mpic.h>
 #include <sysdev/fsl_soc.h>
+#include <sysdev/fsl_pci.h>
 #include <asm/udbg.h>
 
 #include "mpc85xx.h"
@@ -46,10 +47,12 @@ static void __init bsc913x_qds_setup_arch(void)
        mpc85xx_smp_init();
 #endif
 
+       fsl_pci_assign_primary();
+
        pr_info("bsc913x board from Freescale Semiconductor\n");
 }
 
-machine_device_initcall(bsc9132_qds, mpc85xx_common_publish_devices);
+machine_arch_initcall(bsc9132_qds, mpc85xx_common_publish_devices);
 
 /*
  * Called very early, device-tree isn't unflattened
@@ -67,6 +70,9 @@ define_machine(bsc9132_qds) {
        .probe                  = bsc9132_qds_probe,
        .setup_arch             = bsc913x_qds_setup_arch,
        .init_IRQ               = bsc913x_qds_pic_init,
+#ifdef CONFIG_PCI
+       .pcibios_fixup_bus      = fsl_pcibios_fixup_bus,
+#endif
        .get_irq                = mpic_get_irq,
        .restart                = fsl_rstcr_restart,
        .calibrate_decr         = generic_calibrate_decr,
index 610f472f91d14c25cef49a118ecc7f1d9eaf73b1..79976e51b8ad85b896529fc78c7ba037dfdd01b9 100644 (file)
@@ -216,6 +216,19 @@ static void setup_pci_atmu(struct pci_controller *hose)
         */
        setup_inbound = !is_kdump();
 
+       if (of_device_is_compatible(hose->dn, "fsl,bsc9132-pcie")) {
+               /*
+                * BSC9132 Rev1.0 has an issue where all the PEX inbound
+                * windows have implemented the default target value as 0xf
+                * for CCSR space.In all Freescale legacy devices the target
+                * of 0xf is reserved for local memory space. 9132 Rev1.0
+                * now has local mempry space mapped to target 0x0 instead of
+                * 0xf. Hence adding a workaround to remove the target 0xf
+                * defined for memory space from Inbound window attributes.
+                */
+               piwar &= ~PIWAR_TGI_LOCAL;
+       }
+
        if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) {
                if (in_be32(&pci->block_rev1) >= PCIE_IP_REV_2_2) {
                        win_idx = 2;