[U-Boot] [PATCH 3/4] OMAP3: twister: add video support

Stefano Babic sbabic at denx.de
Thu Jun 14 10:29:47 CEST 2012


Signed-off-by: Stefano Babic <sbabic at denx.de>
---
 board/technexion/twister/twister.c |   49 ++++++++++++++++++++++++++++++++++++
 include/configs/twister.h          |   10 ++++++++
 2 files changed, 59 insertions(+)

diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c
index b927586..c1281b9 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -25,12 +25,15 @@
 
 #include <common.h>
 #include <netdev.h>
+#include <malloc.h>
+#include <video_fb.h>
 #include <asm/io.h>
 #include <asm/arch/mem.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/omap_gpio.h>
 #include <asm/arch/mmc_host_def.h>
+#include <asm/arch/dss.h>
 #include <i2c.h>
 #include <asm/gpio.h>
 #ifdef CONFIG_USB_EHCI
@@ -39,8 +42,23 @@
 #endif
 #include "twister.h"
 
+#define XRES	480
+#define YRES	272
+
 DECLARE_GLOBAL_DATA_PTR;
 
+static GraphicDevice panel;
+static const struct panel_config lcd_cfg = {
+	.timing_h	= 0x01101d1b, /* Horizontal timing */
+	.timing_v	= 0x01400b02, /* Vertical timing */
+	.pol_freq	= 0x00023000, /* Pol Freq */
+	.divisor	= 0x0001000d, /* 33Mhz Pixel Clock */
+	.lcd_size	= ((YRES - 1) << 16 | (XRES - 1)),
+	.panel_type	= 0x01, /* TFT */
+	.data_lines	= 0x03, /* 24 Bit RGB */
+	.load_mode	= 0x02 /* Frame Mode */
+};
+
 /* Timing definitions for Ethernet Controller */
 static const u32 gpmc_smc911[] = {
 	NET_GPMC_CONFIG1,
@@ -135,6 +153,37 @@ int board_mmc_init(bd_t *bis)
 {
 	return omap_mmc_init(0);
 }
+
+void *video_hw_init(void)
+{
+
+	void *fb;
+	u32 size;
+
+	size = XRES * YRES * lcd_cfg.data_lines;
+	fb = malloc(size);
+	if (!fb) {
+		printf("Frame buffer not allocated\n");
+		return NULL;
+	}
+
+	panel.winSizeX = XRES;
+	panel.winSizeY = YRES;
+	panel.plnSizeX = XRES;
+	panel.plnSizeY = YRES;
+
+	panel.frameAdrs = (u32)fb;
+	panel.memSize = size;
+
+	panel.gdfBytesPP = 2;
+	panel.gdfIndex = GDF_16BIT_565RGB;
+
+	omap3_dss_panel_config(&lcd_cfg);
+	omap3_dss_enable();
+	omap3_dss_setfb(fb);
+
+	return (void *)&panel;
+}
 #endif
 
 #ifdef CONFIG_SPL_OS_BOOT
diff --git a/include/configs/twister.h b/include/configs/twister.h
index a852481..fb96f30 100644
--- a/include/configs/twister.h
+++ b/include/configs/twister.h
@@ -48,6 +48,16 @@
 #define CONFIG_SMC911X_BASE		0x2C000000
 #define CONFIG_SMC911X_NO_EEPROM
 
+#define CONFIG_VIDEO
+#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
+#define CONFIG_VIDEO_OMAP3	/* DSS Support			*/
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV
+
 #define	CONFIG_EXTRA_ENV_SETTINGS	CONFIG_TAM3517_SETTINGS \
 	"bootcmd=run nandboot\0"
 
-- 
1.7.9.5



More information about the U-Boot mailing list