diff options
author | Ye Li <ye.li@nxp.com> | 2016-02-23 15:25:12 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-04-05 14:04:30 +0800 |
commit | 40c24a19733a5e1f9fb3ba8b4393c31cac5415e3 (patch) | |
tree | 83ad084b0371564d04cf8830ae577e106c35d1ed | |
parent | 8fa188c1466e6a74536f1b46fff88bf9b08b0d78 (diff) | |
download | u-boot-imx-40c24a19733a5e1f9fb3ba8b4393c31cac5415e3.zip u-boot-imx-40c24a19733a5e1f9fb3ba8b4393c31cac5415e3.tar.gz u-boot-imx-40c24a19733a5e1f9fb3ba8b4393c31cac5415e3.tar.bz2 |
MLK-12437-3 mx6sxsabresd: Update display to support panel selection
Support two display panels, one for LVDS, another for parallel LCD. Align the
feature to the v2015.04 uboot.
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit d7f54f22607ffcace6cda97984649a5ae4f65996)
-rw-r--r-- | arch/arm/include/asm/arch-mx6/imx-regs.h | 2 | ||||
-rw-r--r-- | board/freescale/mx6sxsabresd/mx6sxsabresd.c | 92 | ||||
-rw-r--r-- | include/configs/mx6sxsabresd.h | 8 |
3 files changed, 91 insertions, 11 deletions
diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h b/arch/arm/include/asm/arch-mx6/imx-regs.h index 7165a15..177ce66 100644 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h +++ b/arch/arm/include/asm/arch-mx6/imx-regs.h @@ -430,6 +430,8 @@ #define MXS_LCDIF_BASE LCDIF1_BASE_ADDR +#define MXS_LCDIF_BASE LCDIF1_BASE_ADDR + extern void imx_get_mac_from_fuse(int dev_id, unsigned char *mac); diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index edb2221..cd6b2c3 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -28,6 +28,7 @@ #include "../common/pfuze.h" #include <usb.h> #include <usb/ehci-ci.h> +#include <asm/imx-common/video.h> DECLARE_GLOBAL_DATA_PTR; @@ -472,6 +473,14 @@ int board_qspi_init(void) #endif #ifdef CONFIG_VIDEO_MXS +static iomux_v3_cfg_t const lvds_ctrl_pads[] = { + /* CABC enable */ + MX6_PAD_QSPI1A_DATA2__GPIO4_IO_18 | MUX_PAD_CTRL(NO_PAD_CTRL), + + /* Use GPIO for Brightness adjustment, duty cycle = period */ + MX6_PAD_SD1_DATA1__GPIO6_IO_3 | MUX_PAD_CTRL(NO_PAD_CTRL), +}; + static iomux_v3_cfg_t const lcd_pads[] = { MX6_PAD_LCD1_CLK__LCDIF1_CLK | MUX_PAD_CTRL(LCD_PAD_CTRL), MX6_PAD_LCD1_ENABLE__LCDIF1_ENABLE | MUX_PAD_CTRL(LCD_PAD_CTRL), @@ -507,9 +516,41 @@ static iomux_v3_cfg_t const lcd_pads[] = { MX6_PAD_SD1_DATA2__GPIO6_IO_4 | MUX_PAD_CTRL(NO_PAD_CTRL), }; -static int setup_lcd(void) +void do_enable_lvds(struct display_info_t const *dev) { - enable_lcdif_clock(LCDIF1_BASE_ADDR, 1); + int ret; + + ret = enable_lcdif_clock(dev->bus, 1); + if (ret) { + printf("Enable LCDIF clock failed, %d\n", ret); + return; + } + ret = enable_lvds_bridge(dev->bus); + if (ret) { + printf("Enable LVDS bridge failed, %d\n", ret); + return; + } + + imx_iomux_v3_setup_multiple_pads(lvds_ctrl_pads, + ARRAY_SIZE(lvds_ctrl_pads)); + + /* Enable CABC */ + gpio_direction_output(IMX_GPIO_NR(4, 18) , 1); + + /* Set Brightness to high */ + gpio_direction_output(IMX_GPIO_NR(6, 3) , 1); +} + +void do_enable_parallel_lcd(struct display_info_t const *dev) + +{ + int ret; + + ret = enable_lcdif_clock(dev->bus, 1); + if (ret) { + printf("Enable LCDIF clock failed, %d\n", ret); + return; + } imx_iomux_v3_setup_multiple_pads(lcd_pads, ARRAY_SIZE(lcd_pads)); @@ -520,9 +561,48 @@ static int setup_lcd(void) /* Set Brightness to high */ gpio_direction_output(IMX_GPIO_NR(6, 4) , 1); - - return 0; } + +struct display_info_t const displays[] = {{ + .bus = LCDIF2_BASE_ADDR, + .addr = 0, + .pixfmt = 18, + .detect = NULL, + .enable = do_enable_lvds, + .mode = { + .name = "Hannstar-XGA", + .xres = 1024, + .yres = 768, + .pixclock = 15385, + .left_margin = 220, + .right_margin = 40, + .upper_margin = 21, + .lower_margin = 7, + .hsync_len = 60, + .vsync_len = 10, + .sync = 0, + .vmode = FB_VMODE_NONINTERLACED +} }, { + .bus = MX6SX_LCDIF1_BASE_ADDR, + .addr = 0, + .pixfmt = 24, + .detect = NULL, + .enable = do_enable_parallel_lcd, + .mode = { + .name = "MCIMX28LCD", + .xres = 800, + .yres = 480, + .pixclock = 29850, + .left_margin = 89, + .right_margin = 164, + .upper_margin = 23, + .lower_margin = 10, + .hsync_len = 10, + .vsync_len = 10, + .sync = 0, + .vmode = FB_VMODE_NONINTERLACED +} } }; +size_t display_count = ARRAY_SIZE(displays); #endif int board_init(void) @@ -538,10 +618,6 @@ int board_init(void) board_qspi_init(); #endif -#ifdef CONFIG_VIDEO_MXS - setup_lcd(); -#endif - return 0; } diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h index 26aa157..45adfd4 100644 --- a/include/configs/mx6sxsabresd.h +++ b/include/configs/mx6sxsabresd.h @@ -16,7 +16,7 @@ #endif /* Size of malloc() pool */ -#define CONFIG_SYS_MALLOC_LEN (3 * SZ_1M) +#define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) #define CONFIG_MXC_UART #define CONFIG_MXC_UART_BASE UART1_BASE @@ -54,7 +54,7 @@ "fdt_addr=0x88000000\0" \ "boot_fdt=try\0" \ "ip_dyn=yes\0" \ - "videomode=video=ctfb:x:800,y:480,depth:24,pclk:29850,le:89,ri:164,up:23,lo:10,hs:10,vs:10,sync:0,vmode:0\0" \ + "panel=Hannstar-XGA\0" \ "mmcdev=2\0" \ "mmcpart=1\0" \ "mmcroot=/dev/mmcblk0p2 rootwait rw\0" \ @@ -211,7 +211,9 @@ #define CONFIG_BMP_16BPP #define CONFIG_VIDEO_BMP_RLE8 #define CONFIG_VIDEO_BMP_LOGO -#define MXS_LCDIF_BASE MX6SX_LCDIF1_BASE_ADDR +#define CONFIG_IMX_VIDEO_SKIP +#define CONFIG_SYS_CONSOLE_BG_COL 0x00 +#define CONFIG_SYS_CONSOLE_FG_COL 0xa0 #endif #endif |