SPL: Adjust more debug prints for ulong entry_point
[oweals/u-boot.git] / arch / arm / imx-common / video.c
index 098239a7165d9f568a52b52941353c752c5618b8..549bf9d957a0449559a8ff367bf337c9cd9178a7 100644 (file)
@@ -3,17 +3,15 @@
  */
 
 #include <common.h>
-#include <asm/errno.h>
+#include <linux/errno.h>
 #include <asm/imx-common/video.h>
 
-extern struct display_info_t const displays[];
-extern size_t display_count;
-
 int board_video_skip(void)
 {
        int i;
        int ret;
        char const *panel = getenv("panel");
+
        if (!panel) {
                for (i = 0; i < display_count; i++) {
                        struct display_info_t const *dev = displays+i;
@@ -34,11 +32,14 @@ int board_video_skip(void)
                                break;
                }
        }
+
        if (i < display_count) {
-               ret = ipuv3_fb_init(&displays[i].mode, 0,
+               ret = ipuv3_fb_init(&displays[i].mode, displays[i].di ? 1 : 0,
                                    displays[i].pixfmt);
                if (!ret) {
-                       displays[i].enable(displays+i);
+                       if (displays[i].enable)
+                               displays[i].enable(displays + i);
+
                        printf("Display: %s (%ux%u)\n",
                               displays[i].mode.name,
                               displays[i].mode.xres,
@@ -53,3 +54,13 @@ int board_video_skip(void)
 
        return 0;
 }
+
+#ifdef CONFIG_IMX_HDMI
+#include <asm/arch/mxc_hdmi.h>
+#include <asm/io.h>
+int detect_hdmi(struct display_info_t const *dev)
+{
+       struct hdmi_regs *hdmi  = (struct hdmi_regs *)HDMI_ARB_BASE_ADDR;
+       return readb(&hdmi->phy_stat0) & HDMI_DVI_STAT;
+}
+#endif