From 2d59acc70f76e6d52cc9a226c55539c9353a23cb Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Wed, 1 Jul 2015 17:01:49 +0800 Subject: imx: mx6 remove duplicated enable_cspi_clock enable_spi_clock does the same thing with enable_cspi_clock, so remove enable_cspi_clock. Remove enable_cspi_clock prototype in header file convert cm_fx6/spl.c to use enable_spi_clk Signed-off-by: Peng Fan Acked-by: Stefano Babic --- board/compulab/cm_fx6/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/spl.c b/board/compulab/cm_fx6/spl.c index 5b4b76f..d94ced9 100644 --- a/board/compulab/cm_fx6/spl.c +++ b/board/compulab/cm_fx6/spl.c @@ -303,7 +303,7 @@ static void cm_fx6_setup_uart(void) static void cm_fx6_setup_ecspi(void) { cm_fx6_set_ecspi_iomux(); - enable_cspi_clock(1, 0); + enable_spi_clk(1, 0); } #else static void cm_fx6_setup_ecspi(void) { } -- cgit v1.1 From 75dbbbfdf36ac01d56418a1e47ed30deeb6f72ec Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Thu, 23 Jul 2015 17:19:28 +0300 Subject: arm: mx6: cm-fx6: map HDMI to IPU1 DI0 explicitly U-Boot does not explicitly assign the display to an IPU interface. Instead, it relies on the power-on default of DI0. Since the kernel reassigns HDMI display to DI1, after a warm reset the HDMI display no longer works in U-Boot. Fix this by explicitly assigning HDMI to IPU1 DI0 in U-Boot. Cc: Stefano Babic Cc: Igor Grinberg Signed-off-by: Nikita Kiryanov Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 7a1bbaf..b500f91 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -83,6 +83,7 @@ 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; + struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR; int reg; enable_ipu_clock(); @@ -90,6 +91,7 @@ static void cm_fx6_setup_display(void) reg = __raw_readl(&mxc_ccm->CCGR3); reg |= MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK; writel(reg, &mxc_ccm->CCGR3); + clrbits_le32(&iomuxc_regs->gpr[3], MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK); } #else static inline void cm_fx6_setup_display(void) {} -- cgit v1.1 From 4377859aa697ebec8e2ddb1cefe2ce338cd73f65 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Thu, 23 Jul 2015 17:19:29 +0300 Subject: arm: mx6: cm-fx6: make it possible to not init display Implement a cm-fx6 specific board_video_skip() to provide the option to not initialize the display. The new function does not init display if the environment variable "panel" is not defined, or if it is set to an unsupported value. Collateral changes: - Don't use the global displays array (it's CONFIG_IMX_VIDEO_SKIP specific). - Don't use detect_hdmi(), since env controlled init makes it unnecessary. Cc: Stefano Babic Cc: Igor Grinberg Signed-off-by: Nikita Kiryanov Signed-off-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 72 ++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 24 deletions(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index b500f91..2fb8db5 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -54,31 +55,27 @@ 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, - } - }, +static struct display_info_t preset_hdmi_1024X768 = { + .bus = -1, + .addr = 0, + .pixfmt = IPU_PIX_FMT_RGB24, + .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) { @@ -93,6 +90,33 @@ static void cm_fx6_setup_display(void) writel(reg, &mxc_ccm->CCGR3); clrbits_le32(&iomuxc_regs->gpr[3], MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK); } + +int board_video_skip(void) +{ + int ret; + struct display_info_t *preset; + char const *panel = getenv("panel"); + + if (!panel) + return -ENOENT; + + if (!strcmp(panel, "HDMI")) + preset = &preset_hdmi_1024X768; + else + return -EINVAL; + + ret = ipuv3_fb_init(&preset->mode, 0, preset->pixfmt); + if (ret) { + printf("Can't init display %s: %d\n", preset->mode.name, ret); + return ret; + } + + preset->enable(preset); + printf("Display: %s (%ux%u)\n", preset->mode.name, preset->mode.xres, + preset->mode.yres); + + return 0; +} #else static inline void cm_fx6_setup_display(void) {} #endif /* CONFIG_VIDEO_IPUV3 */ -- cgit v1.1 From 33299499492586b8af3c6fa930b3122cd9293039 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Thu, 23 Jul 2015 17:19:30 +0300 Subject: arm: mx6: cm-fx6: add support for displaytype env var Add support for selecting display preset using the environment variable "displaytype". This is a preparation for future merging of compulab omap3_display.c display selection code with the cm-fx6 display selection code. The "panel" environment variable is retained for backwards compatibility. Cc: Stefano Babic Cc: Igor Grinberg Signed-off-by: Nikita Kiryanov Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 2fb8db5..3e518c1 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -95,7 +95,10 @@ int board_video_skip(void) { int ret; struct display_info_t *preset; - char const *panel = getenv("panel"); + char const *panel = getenv("displaytype"); + + if (!panel) /* Also accept panel for backward compatibility */ + panel = getenv("panel"); if (!panel) return -ENOENT; -- cgit v1.1 From b406f90342751a9534a00ab8f702a3b23ebbdd04 Mon Sep 17 00:00:00 2001 From: Nikita Kiryanov Date: Thu, 23 Jul 2015 17:19:31 +0300 Subject: arm: mx6: cm-fx6: setup hdmi only on hdmi enable Refactor display code to only setup hdmi if do_enable_hdmi() is invoked. Cc: Stefano Babic Cc: Igor Grinberg Signed-off-by: Nikita Kiryanov Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'board/compulab/cm_fx6') diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 3e518c1..e85c8ab 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -52,6 +52,9 @@ int splash_screen_prepare(void) #ifdef CONFIG_IMX_HDMI static void cm_fx6_enable_hdmi(struct display_info_t const *dev) { + struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; + imx_setup_hdmi(); + setbits_le32(&mxc_ccm->CCGR3, MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK); imx_enable_hdmi_phy(); } @@ -79,15 +82,9 @@ static struct display_info_t preset_hdmi_1024X768 = { static void cm_fx6_setup_display(void) { - struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR; struct iomuxc *const iomuxc_regs = (struct iomuxc *)IOMUXC_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); clrbits_le32(&iomuxc_regs->gpr[3], MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK); } -- cgit v1.1