summaryrefslogtreecommitdiff
path: root/drivers/video/am335x-fb.c
diff options
context:
space:
mode:
authorMartin Pietryka <martin.pietryka@chello.at>2016-04-27 21:39:16 +0200
committerAnatolij Gustschin <agust@denx.de>2016-04-28 16:51:17 +0200
commit3d47b2d741683023de05f08f9adb4bd25c189c46 (patch)
treea1abb79c3ae6b061711e39a97ce1da196afe88b0 /drivers/video/am335x-fb.c
parent7d045170ac1bf512ed148e97432b7a8d772943e9 (diff)
downloadu-boot-3d47b2d741683023de05f08f9adb4bd25c189c46.tar.gz
u-boot-3d47b2d741683023de05f08f9adb4bd25c189c46.tar.bz2
u-boot-3d47b2d741683023de05f08f9adb4bd25c189c46.zip
drivers/video/am335x-fb: Properly point framebuffer behind palette
The DMA was outputting the palette on the screen because the base for the DMA was not after the palette. In addition to that, the ceiling was also too high, this led that the output on the screen was shifted. NOTE: According to the TRM, even in 16/24bit mode a palette is required in the first 32 bytes of the framebuffer. See also: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/234967/834483#834483 "In this mode, the LCDC will assume all information is data and thus you need to ensure that the DMA points to the first pixel of data and not the first entry in the frame buffer which is the beginning of the 512 byte palette." Signed-off-by: Martin Pietryka <martin.pietryka@chello.at> Reviewed-by: Hannes Schmelzer <oe5hpm@oevsv.at> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Diffstat (limited to 'drivers/video/am335x-fb.c')
-rw-r--r--drivers/video/am335x-fb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/am335x-fb.c b/drivers/video/am335x-fb.c
index d984435ea4..bb5cc9788a 100644
--- a/drivers/video/am335x-fb.c
+++ b/drivers/video/am335x-fb.c
@@ -143,6 +143,8 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
/* palette default entry */
memset((void *)gd->fb_base, 0, 0x20);
*(unsigned int *)gd->fb_base = 0x4000;
+ /* point fb behind palette */
+ gd->fb_base += 0x20;
/* turn ON display through powercontrol function if accessible */
if (0 != panel->panel_power_ctrl)
@@ -154,9 +156,9 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
lcdhw->raster_ctrl = 0;
lcdhw->ctrl = LCD_CLK_DIVISOR(panel->pxl_clk_div) | LCD_RASTER_MODE;
lcdhw->lcddma_fb0_base = gd->fb_base;
- lcdhw->lcddma_fb0_ceiling = gd->fb_base + FBSIZE(panel) + 0x20;
+ lcdhw->lcddma_fb0_ceiling = gd->fb_base + FBSIZE(panel);
lcdhw->lcddma_fb1_base = gd->fb_base;
- lcdhw->lcddma_fb1_ceiling = gd->fb_base + FBSIZE(panel) + 0x20;
+ lcdhw->lcddma_fb1_ceiling = gd->fb_base + FBSIZE(panel);
lcdhw->lcddma_ctrl = LCD_DMA_BURST_SIZE(LCD_DMA_BURST_16);
lcdhw->raster_timing0 = LCD_HORLSB(panel->hactive) |
@@ -179,8 +181,6 @@ int am335xfb_init(struct am335x_lcdpanel *panel)
LCD_TFT_MODE |
LCD_RASTER_ENABLE;
- gd->fb_base += 0x20; /* point fb behind palette */
-
debug("am335x-fb: waiting picture to be stable.\n.");
mdelay(panel->pon_delay);