Merge tag 'u-boot-imx-20200108' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[oweals/u-boot.git] / arch / arm / cpu / armv8 / fsl-layerscape / fdt.c
index c9c2c3f6d3e8bb8bf9da86c99918ab1d4df2349e..1e7e46e88a06459ad5444c679e7d3e2ef00b8101 100644 (file)
@@ -327,7 +327,7 @@ static int _fdt_fixup_pci_msi(void *blob, const char *name, int rev)
        memcpy((char *)tmp, p, len);
 
        val = fdt32_to_cpu(tmp[0][6]);
-       if (rev > REV1_0) {
+       if (rev == REV1_0) {
                tmp[1][6] = cpu_to_fdt32(val + 1);
                tmp[2][6] = cpu_to_fdt32(val + 2);
                tmp[3][6] = cpu_to_fdt32(val + 3);
@@ -401,6 +401,32 @@ void fdt_fixup_remove_jr(void *blob)
 }
 #endif
 
+#ifdef CONFIG_ARCH_LS1028A
+static void fdt_disable_multimedia(void *blob, unsigned int svr)
+{
+       int off;
+
+       if (IS_MULTIMEDIA_EN(svr))
+               return;
+
+       /* Disable eDP/LCD node */
+       off = fdt_node_offset_by_compatible(blob, -1, "arm,mali-dp500");
+       if (off != -FDT_ERR_NOTFOUND)
+               fdt_status_disabled(blob, off);
+
+       /* Disable GPU node */
+       off = fdt_node_offset_by_compatible(blob, -1, "fsl,ls1028a-gpu");
+       if (off != -FDT_ERR_NOTFOUND)
+               fdt_status_disabled(blob, off);
+}
+#endif
+
+#ifdef CONFIG_PCIE_ECAM_GENERIC
+__weak void fdt_fixup_ecam(void *blob)
+{
+}
+#endif
+
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
        struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
@@ -435,7 +461,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        do_fixup_by_path_u32(blob, "/sysclk", "clock-frequency",
                             CONFIG_SYS_CLK_FREQ, 1);
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCIE_LAYERSCAPE) || defined(CONFIG_PCIE_LAYERSCAPE_GEN4)
        ft_pci_setup(blob, bd);
 #endif
 
@@ -462,4 +488,10 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_HAS_FEATURE_ENHANCED_MSI
        fdt_fixup_msi(blob);
 #endif
+#ifdef CONFIG_ARCH_LS1028A
+       fdt_disable_multimedia(blob, svr);
+#endif
+#ifdef CONFIG_PCIE_ECAM_GENERIC
+       fdt_fixup_ecam(blob);
+#endif
 }