[U-Boot] [PATCH 10/12] Davinci: ea20: added video support
Stefano Babic
sbabic at denx.de
Wed Oct 5 11:43:37 CEST 2011
Signed-off-by: Stefano Babic <sbabic at denx.de>
Cc: Anatolij Gustschin <agust at denx.de>
CC: Sandeep Paulraj <s-paulraj at ti.com>
---
board/davinci/ea20/ea20.c | 62 +++++++++++++++++++++++++++++++++++++++++++++
include/configs/ea20.h | 14 +++++++++-
2 files changed, 75 insertions(+), 1 deletions(-)
diff --git a/board/davinci/ea20/ea20.c b/board/davinci/ea20/ea20.c
index c28d8df..d581cdd 100644
--- a/board/davinci/ea20/ea20.c
+++ b/board/davinci/ea20/ea20.c
@@ -36,11 +36,27 @@
#include <asm/io.h>
#include <asm/arch/davinci_misc.h>
#include <asm/arch/gpio.h>
+#include <asm/arch/da8xx-fb.h>
DECLARE_GLOBAL_DATA_PTR;
#define pinmux(x) (&davinci_syscfg_regs->pinmux[x])
+static const struct da8xx_panel lcd_panel = {
+ /* Casio COM57H531x */
+ .name = "Casio_COM57H531x",
+ .width = 640,
+ .height = 480,
+ .hfp = 12,
+ .hbp = 144,
+ .hsw = 30,
+ .vfp = 10,
+ .vbp = 35,
+ .vsw = 3,
+ .pxl_clk = 25000000,
+ .invert_pxl_clk = 0,
+};
+
/* SPI0 pin muxer settings */
static const struct pinmux_config spi1_pins[] = {
{ pinmux(5), 1, 1 },
@@ -100,6 +116,29 @@ const struct pinmux_config gpio_pins[] = {
{ pinmux(14), 8, 1 } /* GPIO6[6] LCD_B_PWR*/
};
+const struct pinmux_config lcd_pins[] = {
+ { pinmux(17), 2, 1 }, /* LCD_D_0 */
+ { pinmux(17), 2, 0 }, /* LCD_D_1 */
+ { pinmux(16), 2, 7 }, /* LCD_D_2 */
+ { pinmux(16), 2, 6 }, /* LCD_D_3 */
+ { pinmux(16), 2, 5 }, /* LCD_D_4 */
+ { pinmux(16), 2, 4 }, /* LCD_D_5 */
+ { pinmux(16), 2, 3 }, /* LCD_D_6 */
+ { pinmux(16), 2, 2 }, /* LCD_D_7 */
+ { pinmux(18), 2, 1 }, /* LCD_D_8 */
+ { pinmux(18), 2, 0 }, /* LCD_D_9 */
+ { pinmux(17), 2, 7 }, /* LCD_D_10 */
+ { pinmux(17), 2, 6 }, /* LCD_D_11 */
+ { pinmux(17), 2, 5 }, /* LCD_D_12 */
+ { pinmux(17), 2, 4 }, /* LCD_D_13 */
+ { pinmux(17), 2, 3 }, /* LCD_D_14 */
+ { pinmux(17), 2, 2 }, /* LCD_D_15 */
+ { pinmux(18), 2, 6 }, /* LCD_PCLK */
+ { pinmux(19), 2, 0 }, /* LCD_HSYNC */
+ { pinmux(19), 2, 1 }, /* LCD_VSYNC */
+ { pinmux(19), 2, 6 }, /* DA850_NLCD_AC_ENB_CS */
+};
+
const struct pinmux_config halten_pin[] = {
{ pinmux(3), 4, 2 } /* GPIO8[6] HALTEN */
};
@@ -112,6 +151,9 @@ static const struct pinmux_resource pinmuxes[] = {
#ifdef CONFIG_NAND_DAVINCI
PINMUX_ITEM(nand_pins),
#endif
+#ifdef CONFIG_VIDEO
+ PINMUX_ITEM(lcd_pins),
+#endif
};
static const struct lpsc_resource lpsc[] = {
@@ -120,6 +162,7 @@ static const struct lpsc_resource lpsc[] = {
{ DAVINCI_LPSC_EMAC }, /* image download */
{ DAVINCI_LPSC_UART0 }, /* console */
{ DAVINCI_LPSC_GPIO },
+ { DAVINCI_LPSC_LCDC }, /* LCD */
};
int board_early_init_f(void)
@@ -208,6 +251,21 @@ int board_early_init_f(void)
DAVINCI_UART_PWREMU_MGMT_UTRST),
&davinci_uart0_ctrl_regs->pwremu_mgmt);
+ /*
+ * Reconfigure the LCDC priority to the highest to ensure that
+ * the throughput/latency requirements for the LCDC are met.
+ */
+ writel(readl(&davinci_syscfg_regs->mstpri[2]) & 0x0fffffff,
+ &davinci_syscfg_regs->mstpri[2]);
+
+ /* Set LCD_B_PWR low to power up LCD Backlight*/
+ writel((readl(&gpio6_base->set_data) | (1 << 6)),
+ &gpio6_base->set_data);
+
+ /* Set DISP_ON low to disable LCD output*/
+ writel((readl(&gpio6_base->set_data) | (1 << 1)),
+ &gpio6_base->set_data);
+
return 0;
}
@@ -219,6 +277,8 @@ int board_init(void)
/* address of boot parameters */
gd->bd->bi_boot_params = LINUX_BOOT_PARAM_ADDR;
+ da8xx_video_init(&lcd_panel, 16);
+
return 0;
}
@@ -238,6 +298,8 @@ int board_late_init(void)
&gpio8_base->set_data);
writel((readl(&gpio8_base->dir) & ~(1 << 6)), &gpio8_base->dir);
+ setenv("stdout", "serial");
+
return 0;
}
#endif /* BOARD_LATE_INIT */
diff --git a/include/configs/ea20.h b/include/configs/ea20.h
index 7c9e4da..aeeed09 100644
--- a/include/configs/ea20.h
+++ b/include/configs/ea20.h
@@ -32,6 +32,7 @@
#define CONFIG_DRIVER_TI_EMAC_USE_RMII
#define CONFIG_BOARD_EARLY_INIT_F
#define BOARD_LATE_INIT
+#define CONFIG_VIDEO
/*
* SoC Configuration
@@ -50,7 +51,7 @@
/*
* Memory Info
*/
-#define CONFIG_SYS_MALLOC_LEN (0x10000 + 1*1024*1024) /* malloc() len */
+#define CONFIG_SYS_MALLOC_LEN (0x10000 + 4*1024*1024) /* malloc() len */
#define PHYS_SDRAM_1 DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
#define PHYS_SDRAM_1_SIZE (64 << 20) /* SDRAM size 64MB */
#define CONFIG_MAX_RAM_BANK_SIZE (512 << 20) /* max size from SPRS586*/
@@ -109,6 +110,17 @@
#define CONFIG_SYS_NO_FLASH
#endif
+
+#if defined(CONFIG_VIDEO)
+#define CONFIG_VIDEO_DA8XX
+#define CONFIG_CFB_CONSOLE
+#define CONFIG_VGA_AS_SINGLE_DEVICE
+#define CONFIG_SPLASH_SCREEN
+#define CONFIG_VIDEO_LOGO
+#define CONFIG_VIDEO_BMP_RLE8
+#define CONFIG_CMD_BMP
+#endif
+
/*
* U-Boot general configuration
*/
--
1.7.1
More information about the U-Boot
mailing list