]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: mx6: cm-fx6: add hdmi console support
authorNikita Kiryanov <nikita@compulab.co.il>
Wed, 14 Jan 2015 08:42:46 +0000 (10:42 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 10:57:32 +0000 (12:57 +0200)
Add support for hdmi console.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
board/compulab/cm_fx6/cm_fx6.c
include/configs/cm_fx6.h

index eb18dfc44c46bc9daf146799585eb8e86231146f..b31e1f59b6b7f5dd665bbd984dfdcc32a28a0d1c 100644 (file)
 #include <asm/arch/crm_regs.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/iomux.h>
+#include <asm/arch/mxc_hdmi.h>
 #include <asm/imx-common/mxc_i2c.h>
 #include <asm/imx-common/sata.h>
+#include <asm/imx-common/video.h>
 #include <asm/io.h>
 #include <asm/gpio.h>
 #include <dm/platform_data/serial_mxc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#ifdef CONFIG_IMX_HDMI
+static void cm_fx6_enable_hdmi(struct display_info_t const *dev)
+{
+       imx_enable_hdmi_phy();
+}
+
+struct display_info_t const displays[] = {
+       {
+               .bus    = -1,
+               .addr   = 0,
+               .pixfmt = IPU_PIX_FMT_RGB24,
+               .detect = detect_hdmi,
+               .enable = cm_fx6_enable_hdmi,
+               .mode   = {
+                       .name           = "HDMI",
+                       .refresh        = 60,
+                       .xres           = 1024,
+                       .yres           = 768,
+                       .pixclock       = 40385,
+                       .left_margin    = 220,
+                       .right_margin   = 40,
+                       .upper_margin   = 21,
+                       .lower_margin   = 7,
+                       .hsync_len      = 60,
+                       .vsync_len      = 10,
+                       .sync           = FB_SYNC_EXT,
+                       .vmode          = FB_VMODE_NONINTERLACED,
+               }
+       },
+};
+size_t display_count = ARRAY_SIZE(displays);
+
+static void cm_fx6_setup_display(void)
+{
+       struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
+       int reg;
+
+       enable_ipu_clock();
+       imx_setup_hdmi();
+       reg = __raw_readl(&mxc_ccm->CCGR3);
+       reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK;
+       writel(reg, &mxc_ccm->CCGR3);
+}
+#else
+static inline void cm_fx6_setup_display(void) {}
+#endif /* CONFIG_VIDEO_IPUV3 */
+
 #ifdef CONFIG_DWC_AHSATA
 static int cm_fx6_issd_gpios[] = {
        /* The order of the GPIOs in the array is important! */
@@ -516,6 +565,8 @@ int board_init(void)
        if (ret)
                printf("Warning: I2C setup failed: %d\n", ret);
 
+       cm_fx6_setup_display();
+
        return 0;
 }
 
index 2f31e38b064ed87127a16d11c468278ad4143573..6502dd73eab480a81fc7165d5021c78a191a41c0 100644 (file)
 #define CONFIG_ENV_OFFSET              (768 * 1024)
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
+       "stdout=serial,vga\0" \
+       "stderr=serial,vga\0" \
+       "panel=HDMI\0" \
        "autoload=no\0" \
        "kernel=uImage-cm-fx6\0" \
        "script=boot.scr\0" \
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     (64 * 1024)
 #define CONFIG_SPL_SPI_LOAD
 
+/* Display */
+#define CONFIG_VIDEO
+#define CONFIG_VIDEO_IPUV3
+#define CONFIG_IPUV3_CLK          260000000
+#define CONFIG_IMX_HDMI
+#define CONFIG_IMX_VIDEO_SKIP
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_CONSOLE_MUX
+#define CONFIG_VIDEO_SW_CURSOR
+
 #endif /* __CONFIG_CM_FX6_H */