]> git.sur5r.net Git - u-boot/blobdiff - drivers/video/exynos_fimd.c
video: exynos_fb: add DT support for FIMD driver
[u-boot] / drivers / video / exynos_fimd.c
index 675d9e17758003019a2ee7783f9a105878070d08..33599499ee253764fb3a8323e52f7af68977f3a8 100644 (file)
 #include <asm/io.h>
 #include <lcd.h>
 #include <div64.h>
+#include <fdtdec.h>
+#include <libfdt.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/cpu.h>
 #include "exynos_fb.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 static unsigned long *lcd_base_addr;
 static vidinfo_t *pvid;
 static struct exynos_fb *fimd_ctrl;
@@ -264,6 +268,19 @@ void exynos_fimd_lcd_init(vidinfo_t *vid)
 {
        unsigned int cfg = 0, rgb_mode;
        unsigned int offset;
+#ifdef CONFIG_OF_CONTROL
+       unsigned int node;
+
+       node = fdtdec_next_compatible(gd->fdt_blob,
+                                       0, COMPAT_SAMSUNG_EXYNOS_FIMD);
+       if (node <= 0)
+               debug("exynos_fb: Can't get device node for fimd\n");
+
+       fimd_ctrl = (struct exynos_fb *)fdtdec_get_addr(gd->fdt_blob,
+                                                               node, "reg");
+       if (fimd_ctrl == NULL)
+               debug("Can't get the FIMD base address\n");
+#endif
        fimd_ctrl = (struct exynos_fb *)samsung_get_base_fimd();
 
        offset = exynos_fimd_get_base_offset();