summaryrefslogtreecommitdiff
path: root/src/cpu/samsung/exynos5250/cpu.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2013-05-18 15:58:46 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-07-10 21:06:20 +0200
commit1e797bdb79b9b3d05640abfee93acf1359cda4db (patch)
tree659a4f01d1b17683fb1be502d983f837fa95dd37 /src/cpu/samsung/exynos5250/cpu.c
parent1387b439f125090550ee12fe178e571a1ca40337 (diff)
exynos5250: Simplify the graphics code by eliminating the unused color map.
The code that allocated space for the framebuffer was adding space for a vestigial color map which was never used. It was also passing around a structure which was used to calculate a single value which was already known when that structure was put together. Eliminate the extra space, and pass the single value instead of the structure. Change-Id: Ia6a41cefdf8b29fe7d68f9596a156eced6eb5df8 Signed-off-by: Gabe Black <gabeblack@chromium.org> Reviewed-on: http://review.coreboot.org/3652 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/cpu/samsung/exynos5250/cpu.c')
-rw-r--r--src/cpu/samsung/exynos5250/cpu.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/cpu/samsung/exynos5250/cpu.c b/src/cpu/samsung/exynos5250/cpu.c
index b51a591efb..3ab57c9f05 100644
--- a/src/cpu/samsung/exynos5250/cpu.c
+++ b/src/cpu/samsung/exynos5250/cpu.c
@@ -68,12 +68,10 @@ static void exynos_displayport_init(device_t dev)
/* put these on the stack. If, at some point, we want to move
* this code to a pre-ram stage, it will be much easier.
*/
- vidinfo_t vi;
struct exynos5_fimd_panel panel;
unsigned long int fb_size;
u32 lcdbase;
- memset(&vi, 0, sizeof(vi));
memset(&panel, 0, sizeof(panel));
panel.is_dp = 1; /* Display I/F is eDP */
@@ -94,18 +92,10 @@ static void exynos_displayport_init(device_t dev)
panel.xres = conf->xres;
panel.yres = conf->yres;
- vi.vl_col = conf->xres;
- vi.vl_row = conf->yres;
- vi.vl_bpix = conf->bpp;
- /*
- * The size is a magic number from hardware. Allocate enough for the
- * frame buffer and color map.
- */
+ /* The size is a magic number from hardware. */
fb_size = conf->xres * conf->yres * (conf->bpp / 8);
- lcdbase = (uintptr_t)cbmem_add(CBMEM_ID_CONSOLE, fb_size + 64*KiB);
- printk(BIOS_SPEW, "LCD colormap base is %p\n", (void *)(lcdbase));
- mmio_resource(dev, 0, lcdbase/KiB, 64);
- vi.cmap = (void *)lcdbase;
+ lcdbase = (uintptr_t)cbmem_add(CBMEM_ID_CONSOLE, fb_size);
+ printk(BIOS_SPEW, "LCD framebuffer base is %p\n", (void *)(lcdbase));
/*
* We need to clean and invalidate the framebuffer region and disable
@@ -119,18 +109,17 @@ static void exynos_displayport_init(device_t dev)
* FIXME: Is disabling/re-enabling the MMU entirely necessary?
*/
uint32_t lower = ALIGN_DOWN(lcdbase, MiB);
- uint32_t upper = ALIGN_UP(lcdbase + fb_size + 64*KiB, MiB);
+ uint32_t upper = ALIGN_UP(lcdbase + fb_size, MiB);
dcache_clean_invalidate_by_mva(lower, upper - lower);
dcache_mmu_disable();
mmu_config_range(lower/MiB, (upper - lower)/MiB, DCACHE_OFF);
dcache_mmu_enable();
- lcdbase += 64*KiB;
mmio_resource(dev, 1, lcdbase/KiB, (fb_size + KiB - 1)/KiB);
printk(BIOS_DEBUG,
"Initializing Exynos VGA, base %p\n", (void *)lcdbase);
memset((void *)lcdbase, 0, fb_size); /* clear the framebuffer */
- ret = lcd_ctrl_init(&vi, &panel, (void *)lcdbase);
+ ret = lcd_ctrl_init(fb_size, &panel, (void *)lcdbase);
}
static void cpu_init(device_t dev)