pci: tegra: implement PCA enable workaround
[oweals/u-boot.git] / drivers / pci / pcie_layerscape.c
index 95cfe8c16fb73383e3755e7071e3892c58488c6f..4cee038ede5d13c318871e50dfc4293f6c5d8e3d 100644 (file)
@@ -11,7 +11,9 @@
 #include <asm/io.h>
 #include <errno.h>
 #include <malloc.h>
-#include <asm/arch-fsl-lsch3/fdt.h>
+#ifdef CONFIG_FSL_LAYERSCAPE
+#include <asm/arch/fdt.h>
+#endif
 
 #ifndef CONFIG_SYS_PCI_MEMORY_BUS
 #define CONFIG_SYS_PCI_MEMORY_BUS CONFIG_SYS_SDRAM_BASE
@@ -689,6 +691,7 @@ void fdt_fixup_smmu_pcie(void *blob)
 {
        int count;
        u32 stream_ids[MAX_STREAM_IDS];
+       u32 ctlr_streamid = 0x300;
 
        #ifdef CONFIG_PCIE1
        /* PEX1 stream ID fixup */
@@ -696,6 +699,8 @@ void fdt_fixup_smmu_pcie(void *blob)
        alloc_stream_ids(FSL_PEX1_STREAM_ID_START, count, stream_ids,
                         MAX_STREAM_IDS);
        pcie_set_available_streamids(blob, "/pcie@3400000", stream_ids, count);
+       append_mmu_masters(blob, "/iommu@5000000", "/pcie@3400000",
+                          &ctlr_streamid, 1);
        #endif
 
        #ifdef CONFIG_PCIE2
@@ -704,6 +709,8 @@ void fdt_fixup_smmu_pcie(void *blob)
        alloc_stream_ids(FSL_PEX2_STREAM_ID_START, count, stream_ids,
                         MAX_STREAM_IDS);
        pcie_set_available_streamids(blob, "/pcie@3500000", stream_ids, count);
+       append_mmu_masters(blob, "/iommu@5000000", "/pcie@3500000",
+                          &ctlr_streamid, 1);
        #endif
 
        #ifdef CONFIG_PCIE3
@@ -712,6 +719,8 @@ void fdt_fixup_smmu_pcie(void *blob)
        alloc_stream_ids(FSL_PEX3_STREAM_ID_START, count, stream_ids,
                         MAX_STREAM_IDS);
        pcie_set_available_streamids(blob, "/pcie@3600000", stream_ids, count);
+       append_mmu_masters(blob, "/iommu@5000000", "/pcie@3600000",
+                          &ctlr_streamid, 1);
        #endif
 
        #ifdef CONFIG_PCIE4
@@ -720,6 +729,8 @@ void fdt_fixup_smmu_pcie(void *blob)
        alloc_stream_ids(FSL_PEX4_STREAM_ID_START, count, stream_ids,
                         MAX_STREAM_IDS);
        pcie_set_available_streamids(blob, "/pcie@3700000", stream_ids, count);
+       append_mmu_masters(blob, "/iommu@5000000", "/pcie@3700000",
+                          &ctlr_streamid, 1);
        #endif
 }
 #endif