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 11117657feada10551d75b5fda42bc6afc0472a1..1e7e46e88a06459ad5444c679e7d3e2ef00b8101 100644 (file)
@@ -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
 }