From 7a12db25f4656015a77f4467a60eee170e6117dc Mon Sep 17 00:00:00 2001 From: Firefly Date: Tue, 13 Oct 2015 10:48:03 +0800 Subject: [PATCH] [u-boot] rk boot: commandline logo information depend on logo on state from kernel dtb. Signed-off-by: Firefly --- .../board/rockchip/common/rkboot/fastboot.c | 19 ++++++++++------- u-boot/common/cmd_bootrk.c | 21 +++++++++++++------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/u-boot/board/rockchip/common/rkboot/fastboot.c b/u-boot/board/rockchip/common/rkboot/fastboot.c index 6d1883b817..ca9a5234d5 100755 --- a/u-boot/board/rockchip/common/rkboot/fastboot.c +++ b/u-boot/board/rockchip/common/rkboot/fastboot.c @@ -39,6 +39,9 @@ extern void powerOn(void); extern int g_ir_keycode; #endif +#ifdef CONFIG_LCD +int g_logo_on_state = 0; +#endif /** * return 1 if is charging. @@ -393,17 +396,19 @@ void board_fbt_preboot(void) board_fbt_low_power_check(); #endif - int logo_on = 0; #ifdef CONFIG_LCD + /* logo state defautl init = 0 */ + g_logo_on_state = 0; + if (gd->fdt_blob) { int node = fdt_path_offset(gd->fdt_blob, "/fb"); - logo_on = fdtdec_get_int(gd->fdt_blob, node, "rockchip,uboot-logo-on", 0); + g_logo_on_state = fdtdec_get_int(gd->fdt_blob, node, "rockchip,uboot-logo-on", 0); } - printf("read logo_on switch from dts [%d]\n", logo_on); + printf("read logo on state from dts [%d]\n", g_logo_on_state); - if (logo_on) { + if (g_logo_on_state != 0) { lcd_enable_logo(true); - drv_lcd_init(); //move backlight enable to board_init_r, for don't show logo in rockusb + drv_lcd_init(); } #endif @@ -417,7 +422,7 @@ void board_fbt_preboot(void) || (frt == FASTBOOT_REBOOT_CHARGE)) { #ifdef CONFIG_CMD_CHARGE_ANIM char *charge[] = { "charge" }; - if (logo_on && do_charge(NULL, 0, ARRAY_SIZE(charge), charge)) { + if ((g_logo_on_state != 0) && do_charge(NULL, 0, ARRAY_SIZE(charge), charge)) { //boot from charge animation. frt = FASTBOOT_REBOOT_NORMAL; lcd_clear(); @@ -431,7 +436,7 @@ void board_fbt_preboot(void) powerOn(); #ifdef CONFIG_LCD - if (logo_on) { + if (g_logo_on_state != 0) { //lcd_enable_logo(true); lcd_standby(0); //mdelay(100); diff --git a/u-boot/common/cmd_bootrk.c b/u-boot/common/cmd_bootrk.c index 596b1b5681..06e662ffdf 100755 --- a/u-boot/common/cmd_bootrk.c +++ b/u-boot/common/cmd_bootrk.c @@ -15,6 +15,10 @@ DECLARE_GLOBAL_DATA_PTR; +#ifdef CONFIG_LCD +extern int g_logo_on_state; +#endif + #if defined(CONFIG_RK_HDMI) extern int g_hdmi_vic; #endif @@ -450,13 +454,15 @@ static void rk_commandline_setenv(const char *boot_name, rk_boot_img_hdr *hdr, b * size - fb size, address - fb address, offset - kernel bmp logo offset. * offset is optional, depend on resource image has kernel_logo.bmp. */ - snprintf(command_line, sizeof(command_line), - "%s uboot_logo=0x%08x@0x%08lx", command_line, CONFIG_RK_LCD_SIZE, gd->fb_base); -#if defined(CONFIG_KERNEL_LOGO) - if (g_rk_fb_size != -1) + if (g_logo_on_state != 0) { snprintf(command_line, sizeof(command_line), - "%s:0x%08x", command_line, g_rk_fb_size); + "%s uboot_logo=0x%08x@0x%08lx", command_line, CONFIG_RK_LCD_SIZE, gd->fb_base); +#if defined(CONFIG_KERNEL_LOGO) + if (g_rk_fb_size != -1) + snprintf(command_line, sizeof(command_line), + "%s:0x%08x", command_line, g_rk_fb_size); #endif /* CONFIG_KERNEL_LOGO */ + } #endif /* CONFIG_RK_FB_DDREND */ snprintf(command_line, sizeof(command_line), @@ -529,7 +535,10 @@ int do_bootrk(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } } #if defined(CONFIG_LCD) && defined(CONFIG_KERNEL_LOGO) - rk_load_kernel_logo(); + /* if uboot logo enable, load logo */ + if (g_logo_on_state != 0) { + rk_load_kernel_logo(); + } #endif #if defined(CONFIG_UBOOT_CHARGE) && defined(CONFIG_POWER_FG_ADC)