From bc98cc66b2fe787173ec04b84ea11bc3e57fe373 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 2 Sep 2015 09:21:36 -0500 Subject: bootmode: add display_init_required() Some of the Chrome OS boards were directly calling vboot called in some form after contorting around #ifdef preprocessor macros. The reasoning is that Chrome OS doesn't always do display initialization during startup. It's runtime dependent. While this is a requirement that doesn't mean vboot functions should be sprinkled around in the mainboard and chipset code. Instead provide one function, display_init_required(), that provides the policy for determining display initialization action. For Chrome OS devices this function honors vboot_skip_display_init() and all other configurations default to initializing display. Change-Id: I403213e22c0e621e148773597a550addfbaf3f7e Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/11490 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/soc/nvidia/tegra124/soc.c | 8 ++++---- src/soc/nvidia/tegra132/soc.c | 13 +++++++------ src/soc/nvidia/tegra210/soc.c | 13 +++++++------ 3 files changed, 18 insertions(+), 16 deletions(-) (limited to 'src/soc/nvidia') diff --git a/src/soc/nvidia/tegra124/soc.c b/src/soc/nvidia/tegra124/soc.c index 406457bc79..c38232daec 100644 --- a/src/soc/nvidia/tegra124/soc.c +++ b/src/soc/nvidia/tegra124/soc.c @@ -20,13 +20,13 @@ */ #include +#include #include #include #include #include #include #include -#include #include "chip.h" @@ -53,10 +53,10 @@ static void soc_enable(device_t dev) static void soc_init(device_t dev) { - if (vboot_skip_display_init()) - printk(BIOS_INFO, "Skipping display init.\n"); - else + if (display_init_required()) display_startup(dev); + else + printk(BIOS_INFO, "Skipping display init.\n"); printk(BIOS_INFO, "CPU: Tegra124\n"); } diff --git a/src/soc/nvidia/tegra132/soc.c b/src/soc/nvidia/tegra132/soc.c index 4ca866cbf6..a65f36d430 100644 --- a/src/soc/nvidia/tegra132/soc.c +++ b/src/soc/nvidia/tegra132/soc.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include "chip.h" @@ -101,12 +101,13 @@ static void soc_init(device_t dev) /* Lock down VPR */ lock_down_vpr(); -#if IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) - if (vboot_skip_display_init()) - printk(BIOS_INFO, "Skipping display init.\n"); - else + if (!IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT)) + return; + + if (display_init_required()) display_startup(dev); -#endif + else + printk(BIOS_INFO, "Skipping display init.\n"); } static struct device_operations soc_ops = { diff --git a/src/soc/nvidia/tegra210/soc.c b/src/soc/nvidia/tegra210/soc.c index 9e67531b76..981b09c8a2 100644 --- a/src/soc/nvidia/tegra210/soc.c +++ b/src/soc/nvidia/tegra210/soc.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include #include -#include #include #include @@ -92,12 +92,13 @@ static void soc_init(device_t dev) spintable_init((void *)cfg->spintable_addr); arch_initialize_cpus(dev, &cntrl_ops); -#if IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT) - if (vboot_skip_display_init()) - printk(BIOS_INFO, "Skipping display init.\n"); - else + if (!IS_ENABLED(CONFIG_MAINBOARD_DO_NATIVE_VGA_INIT)) + return; + + if (display_init_required()) display_startup(dev); -#endif + else + printk(BIOS_INFO, "Skipping display init.\n"); } static void soc_noop(device_t dev) -- cgit v1.2.3