From a672d18c3570e6991a1c1c0089697112a4cd71d0 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 31 Mar 2014 21:01:14 -0700 Subject: [PATCH] tegra124: Skip display init when vboot says we don't need it. If EFS is enabled and vboot didn't tell us it's going to use the display, we can skip initializing it and save some boot time. BUG=chrome-os-partner:27094 TEST=Built and booted on nyan without EFS in recovery mode and normal mode. Built and booted on nyan with EFS in recovery mode and normal mode. Verified that in normal mode with EFS the display initialization was skipped and boot time was essentially the same as when display initialization was simply commented out. BRANCH=None Change-Id: I1e2842b57a38061f40514407c8fab1e38b75be80 Signed-off-by: Gabe Black Reviewed-on: https://chromium-review.googlesource.com/192544 Reviewed-by: Tom Warren Reviewed-by: Hung-Te Lin Commit-Queue: Gabe Black Tested-by: Gabe Black --- src/soc/nvidia/tegra124/soc.c | 6 +++++- src/vendorcode/google/chromeos/chromeos.c | 16 ++++++++++++++++ src/vendorcode/google/chromeos/chromeos.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/soc/nvidia/tegra124/soc.c b/src/soc/nvidia/tegra124/soc.c index eec5821bf6..b9d7d602cd 100644 --- a/src/soc/nvidia/tegra124/soc.c +++ b/src/soc/nvidia/tegra124/soc.c @@ -26,6 +26,7 @@ #include #include "chip.h" #include +#include /* this sucks, but for now, fb size/location are hardcoded. * Will break if we get 2. Sigh. @@ -50,7 +51,10 @@ static void soc_enable(device_t dev) static void soc_init(device_t dev) { - display_startup(dev); + if (vboot_skip_display_init()) + printk(BIOS_INFO, "Skipping display init.\n"); + else + display_startup(dev); printk(BIOS_INFO, "CPU: Tegra124\n"); } diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c index 1506b07fcc..f211863e51 100644 --- a/src/vendorcode/google/chromeos/chromeos.c +++ b/src/vendorcode/google/chromeos/chromeos.c @@ -83,6 +83,22 @@ int recovery_mode_enabled(void) vboot_enable_recovery(); } +int vboot_skip_display_init(void) +{ +#if CONFIG_VBOOT_VERIFY_FIRMWARE + struct vboot_handoff *vbho; + + vbho = cbmem_find(CBMEM_ID_VBOOT_HANDOFF); + + if (vbho == NULL) + return 0; + + return !(vbho->init_params.out_flags & VB_INIT_OUT_ENABLE_DISPLAY); +#else + return 0; +#endif +} + #ifdef __PRE_RAM__ void __attribute__((weak)) save_chromeos_gpios(void) { diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index 371ed61648..5d09c669e8 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -42,6 +42,7 @@ void save_vbnv(const uint8_t *vbnv_copy); /* functions implemented in chromeos.c: */ int developer_mode_enabled(void); int recovery_mode_enabled(void); +int vboot_skip_display_init(void); /* functions implemented in vboot.c */ void init_chromeos(int bootmode);