summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-02-15 17:45:17 +0800
committerYe Li <ye.li@nxp.com>2018-04-27 02:30:52 -0700
commitb7bb615158936fc4b819ed632ee0b207f3316394 (patch)
tree5154c2ed7d60a7e9fad190d586bde63f6ab87363
parent60d57156df1bbbd35c06ec3c9dfcf753c4280e39 (diff)
MLK-13929-6 mx7ulp_evk: Enable the MIPI DSI splashscreen
Enable and setup board level codes for MIPI DSI splashscreen on EVK board. User needs set env variable"panel=HX8363_WVGA" for displaying. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 49cb68f5c17e42f9290336e1252ace6ac7d0b5ce) (cherry picked from commit be3d3d5c140a1617c1ce35e8657f2d45bc8c70eb)
-rw-r--r--arch/arm/mach-imx/Makefile3
-rw-r--r--board/freescale/mx7ulp_evk/mx7ulp_evk.c70
-rw-r--r--configs/mx7ulp_evk_defconfig1
-rw-r--r--configs/mx7ulp_evk_plugin_defconfig1
-rw-r--r--include/configs/mx7ulp_evk.h16
5 files changed, 90 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 95a542fa01f..425e5d5a3f3 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -24,7 +24,7 @@ obj-y += cpu.o speed.o
obj-$(CONFIG_GPT_TIMER) += timer.o
obj-$(CONFIG_SYS_I2C_MXC) += i2c-mxv7.o
endif
-ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs mx8m))
+ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs mx7ulp mx8m))
obj-y += misc.o
obj-$(CONFIG_SPL_BUILD) += spl.o
endif
@@ -47,6 +47,7 @@ obj-$(CONFIG_SYSCOUNTER_TIMER) += syscounter.o
endif
ifeq ($(SOC),$(filter $(SOC),mx7ulp))
obj-y += cache.o
+obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
obj-$(CONFIG_SECURE_BOOT) += hab.o
endif
ifeq ($(SOC),$(filter $(SOC),vf610))
diff --git a/board/freescale/mx7ulp_evk/mx7ulp_evk.c b/board/freescale/mx7ulp_evk/mx7ulp_evk.c
index 2358ca7e59b..6ff05747b81 100644
--- a/board/freescale/mx7ulp_evk/mx7ulp_evk.c
+++ b/board/freescale/mx7ulp_evk/mx7ulp_evk.c
@@ -12,6 +12,7 @@
#include <asm/gpio.h>
#include <usb.h>
#include <dm.h>
+#include <asm/mach-imx/video.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -19,6 +20,8 @@ DECLARE_GLOBAL_DATA_PTR;
#define QSPI_PAD_CTRL1 (PAD_CTL_PUS_UP | PAD_CTL_DSE)
#define OTG_ID_GPIO_PAD_CTRL (PAD_CTL_IBE_ENABLE)
+#define MIPI_GPIO_PAD_CTRL (PAD_CTL_OBE_ENABLE)
+
int dram_init(void)
{
gd->ram_size = PHYS_SDRAM_SIZE;
@@ -105,6 +108,73 @@ int board_early_init_f(void)
return 0;
}
+#ifdef CONFIG_VIDEO_MXS
+
+#define MIPI_RESET_GPIO IMX_GPIO_NR(3, 19)
+#define LED_PWM_EN_GPIO IMX_GPIO_NR(6, 2)
+
+static iomux_cfg_t const mipi_reset_pad[] = {
+ MX7ULP_PAD_PTC19__PTC19 | MUX_PAD_CTRL(MIPI_GPIO_PAD_CTRL),
+};
+
+static iomux_cfg_t const led_pwm_en_pad[] = {
+ MX7ULP_PAD_PTF2__PTF2 | MUX_PAD_CTRL(MIPI_GPIO_PAD_CTRL),
+};
+
+int board_mipi_panel_reset(void)
+{
+ gpio_direction_output(MIPI_RESET_GPIO, 0);
+ udelay(1000);
+ gpio_direction_output(MIPI_RESET_GPIO, 1);
+ return 0;
+}
+
+int board_mipi_panel_shutdown(void)
+{
+ gpio_direction_output(MIPI_RESET_GPIO, 0);
+ gpio_direction_output(LED_PWM_EN_GPIO, 0);
+ return 0;
+}
+
+void setup_mipi_reset(void)
+{
+ mx7ulp_iomux_setup_multiple_pads(mipi_reset_pad, ARRAY_SIZE(mipi_reset_pad));
+ gpio_request(MIPI_RESET_GPIO, "mipi_panel_reset");
+}
+
+void do_enable_mipi_dsi(struct display_info_t const *dev)
+{
+ setup_mipi_reset();
+
+ /* Enable backlight */
+ mx7ulp_iomux_setup_multiple_pads(led_pwm_en_pad, ARRAY_SIZE(mipi_reset_pad));
+ gpio_request(LED_PWM_EN_GPIO, "led_pwm_en");
+ gpio_direction_output(LED_PWM_EN_GPIO, 1);
+}
+
+struct display_info_t const displays[] = {{
+ .bus = LCDIF_RBASE,
+ .addr = 0,
+ .pixfmt = 24,
+ .detect = NULL,
+ .enable = do_enable_mipi_dsi,
+ .mode = {
+ .name = "HX8363_WVGA",
+ .xres = 480,
+ .yres = 854,
+ .pixclock = 41042,
+ .left_margin = 40,
+ .right_margin = 60,
+ .upper_margin = 3,
+ .lower_margin = 3,
+ .hsync_len = 8,
+ .vsync_len = 4,
+ .sync = 0,
+ .vmode = FB_VMODE_NONINTERLACED
+} } };
+size_t display_count = ARRAY_SIZE(displays);
+#endif
+
int board_init(void)
{
/* address of boot parameters */
diff --git a/configs/mx7ulp_evk_defconfig b/configs/mx7ulp_evk_defconfig
index 2701e45425e..ec901c0c28d 100644
--- a/configs/mx7ulp_evk_defconfig
+++ b/configs/mx7ulp_evk_defconfig
@@ -42,3 +42,4 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_RTL8152=y
+CONFIG_VIDEO=y
diff --git a/configs/mx7ulp_evk_plugin_defconfig b/configs/mx7ulp_evk_plugin_defconfig
index ab36fcf7e26..4cfd2cffd0e 100644
--- a/configs/mx7ulp_evk_plugin_defconfig
+++ b/configs/mx7ulp_evk_plugin_defconfig
@@ -42,3 +42,4 @@ CONFIG_USB_STORAGE=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_ETHER_ASIX=y
CONFIG_USB_ETHER_RTL8152=y
+CONFIG_VIDEO=y
diff --git a/include/configs/mx7ulp_evk.h b/include/configs/mx7ulp_evk.h
index dede1a86a3a..b2cca45823f 100644
--- a/include/configs/mx7ulp_evk.h
+++ b/include/configs/mx7ulp_evk.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
*
* Configuration settings for the Freescale i.MX7ULP EVK board.
*
@@ -195,6 +196,21 @@
/* USB Configs */
#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
+#ifdef CONFIG_VIDEO
+#define CONFIG_VIDEO_MXS
+#define CONFIG_VIDEO_LOGO
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_SPLASH_SCREEN_ALIGN
+#define CONFIG_CMD_BMP
+#define CONFIG_BMP_16BPP
+#define CONFIG_VIDEO_BMP_RLE8
+#define CONFIG_VIDEO_BMP_LOGO
+#define CONFIG_IMX_VIDEO_SKIP
+
+#define CONFIG_MXC_MIPI_DSI_NORTHWEST
+#define CONFIG_HX8363
+#endif
+
#define CONFIG_OF_SYSTEM_SETUP
#endif /* __CONFIG_H */