diff options
-rw-r--r-- | common/cmd_vboot_twostop.c | 7 | ||||
-rw-r--r-- | drivers/video/tegra2.c | 19 |
2 files changed, 21 insertions, 5 deletions
diff --git a/common/cmd_vboot_twostop.c b/common/cmd_vboot_twostop.c index e922a116b80..44a30b615af 100644 --- a/common/cmd_vboot_twostop.c +++ b/common/cmd_vboot_twostop.c @@ -164,6 +164,7 @@ static void wipe_unused_memory(crossystem_data_t *cdata, VbCommonParams *cparams) { #ifdef CONFIG_OF_CONTROL + int fb_size, lcd_line_length; memory_wipe_t wipe; struct fdt_memory config; @@ -186,6 +187,12 @@ wipe_unused_memory(crossystem_data_t *cdata, VbCommonParams *cparams) (uintptr_t)TEGRA_LP0_ADDR, (uintptr_t)(TEGRA_LP0_ADDR + TEGRA_LP0_SIZE)); + /* Excludes the frame buffer. */ + fb_size = lcd_get_size(&lcd_line_length); + memory_wipe_exclude(&wipe, + (uintptr_t)gd->fb_base, + (uintptr_t)gd->fb_base + fb_size); + memory_wipe_execute(&wipe); #else printf("wipe_unused_memory depends on fdt_decode_memory which" diff --git a/drivers/video/tegra2.c b/drivers/video/tegra2.c index 2600d8d91cd..a8d83d3708c 100644 --- a/drivers/video/tegra2.c +++ b/drivers/video/tegra2.c @@ -233,12 +233,21 @@ void lcd_ctrl_init(void *lcdbase) } /* - * The device tree allows for the frame buffer to be specified if - * needed, but for now, U-Boot will set this. This may change if - * we find that Linux is unable to use the address that U-Boot picks, - * and this causes screen flicker. + * The framebuffer address should be specified in the device tree. + * This FDT value should be the same as the one defined in Linux kernel; + * otherwise, it causes screen flicker. The FDT value overrides the + * framebuffer allocated at the top of memory by board_init_f(). + * + * If the framebuffer address is not defined in the FDT, falls back to + * use the address allocated by board_init_f(). */ - config.frame_buffer = (u32)lcd_base; + if (config.frame_buffer != ADDR_T_NONE) { + gd->fb_base = config.frame_buffer; + lcd_base = (void *)(gd->fb_base); + } else { + config.frame_buffer = (u32)lcd_base; + } + update_panel_size(&config); size = lcd_get_size(&line_length), |