Commit be3d3d5c140a1617c1ce35e8657f2d45bc8c70eb

Authored by Ye Li
1 parent fce3f6e59f

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)

Showing 4 changed files with 89 additions and 1 deletions Side-by-side Diff

arch/arm/imx-common/Makefile
... ... @@ -17,7 +17,7 @@
17 17 ifeq ($(SOC),$(filter $(SOC),mx5))
18 18 obj-y += timer.o
19 19 endif
20   -ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs))
  20 +ifeq ($(SOC),$(filter $(SOC),mx7 mx6 mxs mx7ulp))
21 21 obj-y += misc.o
22 22 obj-$(CONFIG_SPL_BUILD) += spl.o
23 23 endif
... ... @@ -37,6 +37,7 @@
37 37 endif
38 38 ifeq ($(SOC),$(filter $(SOC),mx7ulp))
39 39 obj-y += cache.o
  40 +obj-$(CONFIG_IMX_VIDEO_SKIP) += video.o
40 41 obj-$(CONFIG_SECURE_BOOT) += hab.o
41 42 endif
42 43 ifeq ($(SOC),$(filter $(SOC),vf610))
board/freescale/mx7ulp_evk/mx7ulp_evk.c
... ... @@ -12,6 +12,7 @@
12 12 #include <asm/gpio.h>
13 13 #include <usb.h>
14 14 #include <dm.h>
  15 +#include <asm/imx-common/video.h>
15 16  
16 17 DECLARE_GLOBAL_DATA_PTR;
17 18  
... ... @@ -19,6 +20,8 @@
19 20 #define QSPI_PAD_CTRL1 (PAD_CTL_PUS_UP | PAD_CTL_DSE)
20 21 #define OTG_ID_GPIO_PAD_CTRL (PAD_CTL_IBE_ENABLE)
21 22  
  23 +#define MIPI_GPIO_PAD_CTRL (PAD_CTL_OBE_ENABLE)
  24 +
22 25 int dram_init(void)
23 26 {
24 27 gd->ram_size = PHYS_SDRAM_SIZE;
... ... @@ -104,6 +107,73 @@
104 107  
105 108 return 0;
106 109 }
  110 +
  111 +#ifdef CONFIG_VIDEO_MXS
  112 +
  113 +#define MIPI_RESET_GPIO IMX_GPIO_NR(3, 19)
  114 +#define LED_PWM_EN_GPIO IMX_GPIO_NR(6, 2)
  115 +
  116 +static iomux_cfg_t const mipi_reset_pad[] = {
  117 + MX7ULP_PAD_PTC19__PTC19 | MUX_PAD_CTRL(MIPI_GPIO_PAD_CTRL),
  118 +};
  119 +
  120 +static iomux_cfg_t const led_pwm_en_pad[] = {
  121 + MX7ULP_PAD_PTF2__PTF2 | MUX_PAD_CTRL(MIPI_GPIO_PAD_CTRL),
  122 +};
  123 +
  124 +int board_mipi_panel_reset(void)
  125 +{
  126 + gpio_direction_output(MIPI_RESET_GPIO, 0);
  127 + udelay(1000);
  128 + gpio_direction_output(MIPI_RESET_GPIO, 1);
  129 + return 0;
  130 +}
  131 +
  132 +int board_mipi_panel_shutdown(void)
  133 +{
  134 + gpio_direction_output(MIPI_RESET_GPIO, 0);
  135 + gpio_direction_output(LED_PWM_EN_GPIO, 0);
  136 + return 0;
  137 +}
  138 +
  139 +void setup_mipi_reset(void)
  140 +{
  141 + mx7ulp_iomux_setup_multiple_pads(mipi_reset_pad, ARRAY_SIZE(mipi_reset_pad));
  142 + gpio_request(MIPI_RESET_GPIO, "mipi_panel_reset");
  143 +}
  144 +
  145 +void do_enable_mipi_dsi(struct display_info_t const *dev)
  146 +{
  147 + setup_mipi_reset();
  148 +
  149 + /* Enable backlight */
  150 + mx7ulp_iomux_setup_multiple_pads(led_pwm_en_pad, ARRAY_SIZE(mipi_reset_pad));
  151 + gpio_request(LED_PWM_EN_GPIO, "led_pwm_en");
  152 + gpio_direction_output(LED_PWM_EN_GPIO, 1);
  153 +}
  154 +
  155 +struct display_info_t const displays[] = {{
  156 + .bus = LCDIF_RBASE,
  157 + .addr = 0,
  158 + .pixfmt = 24,
  159 + .detect = NULL,
  160 + .enable = do_enable_mipi_dsi,
  161 + .mode = {
  162 + .name = "HX8363_WVGA",
  163 + .xres = 480,
  164 + .yres = 854,
  165 + .pixclock = 41042,
  166 + .left_margin = 40,
  167 + .right_margin = 60,
  168 + .upper_margin = 3,
  169 + .lower_margin = 3,
  170 + .hsync_len = 8,
  171 + .vsync_len = 4,
  172 + .sync = 0,
  173 + .vmode = FB_VMODE_NONINTERLACED
  174 +} } };
  175 +size_t display_count = ARRAY_SIZE(displays);
  176 +#endif
107 177  
108 178 int board_init(void)
109 179 {
configs/mx7ulp_evk_defconfig
... ... @@ -36,4 +36,5 @@
36 36 CONFIG_USB_EHCI_HCD=y
37 37 CONFIG_MXC_USB_OTG_HACTIVE=y
38 38 CONFIG_USB_STORAGE=y
  39 +CONFIG_VIDEO=y
include/configs/mx7ulp_evk.h
1 1 /*
2 2 * Copyright (C) 2016 Freescale Semiconductor, Inc.
  3 + * Copyright 2017 NXP
3 4 *
4 5 * Configuration settings for the Freescale i.MX7ULP EVK board.
5 6 *
... ... @@ -212,6 +213,21 @@
212 213 #define CONFIG_USB_ETHER_ASIX
213 214 #define CONFIG_USB_ETHER_RTL8152
214 215 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
  216 +
  217 +#ifdef CONFIG_VIDEO
  218 +#define CONFIG_VIDEO_MXS
  219 +#define CONFIG_VIDEO_LOGO
  220 +#define CONFIG_SPLASH_SCREEN
  221 +#define CONFIG_SPLASH_SCREEN_ALIGN
  222 +#define CONFIG_CMD_BMP
  223 +#define CONFIG_BMP_16BPP
  224 +#define CONFIG_VIDEO_BMP_RLE8
  225 +#define CONFIG_VIDEO_BMP_LOGO
  226 +#define CONFIG_IMX_VIDEO_SKIP
  227 +
  228 +#define CONFIG_MXC_MIPI_DSI_NORTHWEST
  229 +#define CONFIG_HX8363
  230 +#endif
215 231  
216 232 #define CONFIG_OF_SYSTEM_SETUP
217 233