]> git.sur5r.net Git - u-boot/blobdiff - drivers/video/exynos_dp_lowlevel.c
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
[u-boot] / drivers / video / exynos_dp_lowlevel.c
index 0be91a53ea34efaa790b5a69c8b3e4706cfa9fdc..748d9b8b3731dc78f1bd7a7d5ddbdd81d068ddd7 100644 (file)
 #include <asm/arch/cpu.h>
 #include <asm/arch/dp_info.h>
 #include <asm/arch/dp.h>
+#include <fdtdec.h>
+#include <libfdt.h>
+
+/* Declare global data pointer */
+DECLARE_GLOBAL_DATA_PTR;
 
 struct exynos_dp *dp_regs;
 
 void exynos_dp_set_base_addr(void)
 {
+#ifdef CONFIG_OF_CONTROL
+       unsigned int node = fdtdec_next_compatible(gd->fdt_blob,
+                                       0, COMPAT_SAMSUNG_EXYNOS5_DP);
+       if (node <= 0)
+               debug("exynos_dp: Can't get device node for dp\n");
+
+       dp_regs = (struct exynos_dp *)fdtdec_get_addr(gd->fdt_blob,
+                                                               node, "reg");
+       if (dp_regs == NULL)
+               debug("Can't get the DP base address\n");
+#else
        dp_regs = (struct exynos_dp *)samsung_get_base_dp();
+#endif
 }
 
 static void exynos_dp_enable_video_input(unsigned int enable)