diff options
author | Jeroen Hofstee <jhofstee@victronenergy.com> | 2012-05-18 00:51:00 +0000 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2012-05-25 15:34:18 +0200 |
commit | d9c13aac14126c2f9446715b33a69f536336b2c0 (patch) | |
tree | c4fe51a5177fba0125041e6b0342bd3b850f352c /drivers/video/omap3_dss.c | |
parent | f714b0a911e24cc733553f02b30d508212f339fe (diff) | |
download | u-boot-imx-d9c13aac14126c2f9446715b33a69f536336b2c0.zip u-boot-imx-d9c13aac14126c2f9446715b33a69f536336b2c0.tar.gz u-boot-imx-d9c13aac14126c2f9446715b33a69f536336b2c0.tar.bz2 |
omap3_dss: add optional framebuffer
The beagle board uses the background color to show an orange screen during
startup. This patch adds the ability to add a frame buffer, with the
intention not to break the beagle board use case (I don't have one).
videomodes.c is not used. Scrolling depends on this patch:
http://patchwork.ozlabs.org/patch/155662/
cc: trini@ti.com
cc: s-paulraj@ti.com
cc: khasim@ti.com
Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
Diffstat (limited to 'drivers/video/omap3_dss.c')
-rw-r--r-- | drivers/video/omap3_dss.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/video/omap3_dss.c b/drivers/video/omap3_dss.c index b322cc3..dfe61b3 100644 --- a/drivers/video/omap3_dss.c +++ b/drivers/video/omap3_dss.c @@ -28,6 +28,7 @@ #include <common.h> #include <asm/io.h> #include <asm/arch/dss.h> +#include <video_fb.h> /* * Configure VENC for a given Mode (NTSC / PAL) @@ -105,6 +106,11 @@ void omap3_dss_venc_config(const struct venc_regs *venc_cfg, void omap3_dss_panel_config(const struct panel_config *panel_cfg) { struct dispc_regs *dispc = (struct dispc_regs *) OMAP3_DISPC_BASE; + struct dss_regs *dss = (struct dss_regs *) OMAP3_DSS_BASE; + + writel(DSS_SOFTRESET, &dss->sysconfig); + while (!(readl(&dss->sysstatus) & DSS_RESETDONE)) + ; writel(panel_cfg->timing_h, &dispc->timing_h); writel(panel_cfg->timing_v, &dispc->timing_v); @@ -115,6 +121,16 @@ void omap3_dss_panel_config(const struct panel_config *panel_cfg) writel(((panel_cfg->panel_type << TFTSTN_SHIFT) | (panel_cfg->data_lines << DATALINES_SHIFT)), &dispc->control); writel(panel_cfg->panel_color, &dispc->default_color0); + writel((u32) panel_cfg->frame_buffer, &dispc->gfx_ba0); + + if (!panel_cfg->frame_buffer) + return; + + writel(panel_cfg->load_mode << LOADMODE_SHIFT, &dispc->config); + writel(8 << GFX_FORMAT_SHIFT | GFX_ENABLE, &dispc->gfx_attributes); + writel(1, &dispc->gfx_row_inc); + writel(1, &dispc->gfx_pixel_inc); + writel(panel_cfg->lcd_size, &dispc->gfx_size); } /* @@ -129,3 +145,31 @@ void omap3_dss_enable(void) l |= DISPC_ENABLE; writel(l, &dispc->control); } + +#ifdef CONFIG_CFB_CONSOLE +int __board_video_init(void) +{ + return -1; +} + +int board_video_init(void) + __attribute__((weak, alias("__board_video_init"))); + +void *video_hw_init(void) +{ + static GraphicDevice dssfb; + GraphicDevice *pGD = &dssfb; + struct dispc_regs *dispc = (struct dispc_regs *) OMAP3_DISPC_BASE; + + if (board_video_init() || !readl(&dispc->gfx_ba0)) + return NULL; + + pGD->winSizeX = (readl(&dispc->size_lcd) & 0x7FF) + 1; + pGD->winSizeY = ((readl(&dispc->size_lcd) >> 16) & 0x7FF) + 1; + pGD->gdfBytesPP = 4; + pGD->gdfIndex = GDF_32BIT_X888RGB; + pGD->frameAdrs = readl(&dispc->gfx_ba0); + + return pGD; +} +#endif |