vboot: Remove CHIPSET_PROVIDES_VERSTAGE_MAIN_SYMBOL Kconfig option
CHIPSET_PROVIDES_VERSTAGE_MAIN_SYMBOL allows the SoC directory to provide its own main() symbol that can execute code before the generic verstage code runs. We have now established in other places (e.g. T210 ramstage) a sort of convention that SoCs which need to run code in any stage before main() should just override stage_entry() instead. This patch aligns the verstage with that model and gets rid of the extra Kconfig option. This also removes the need for aliasing between main() and verstage(). Like other stages the main verstage code is now just in main() and can be called from stage_entry(). Change-Id: If42c9c4fbab51fbd474e1530023a30b69495d1d6 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/18978 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
This commit is contained in:
parent
1210b41283
commit
94d9411415
|
@ -14,10 +14,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
#include <vendorcode/google/chromeos/chromeos.h>
|
#include <main_decl.h>
|
||||||
|
|
||||||
/* Provide an entry point for verstage when it's a separate stage. */
|
/* Provide an entry point for verstage when it's a separate stage. */
|
||||||
asmlinkage void car_stage_entry(void)
|
asmlinkage void car_stage_entry(void)
|
||||||
{
|
{
|
||||||
verstage();
|
main();
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ config CHROMEOS
|
||||||
select VBOOT_OPROM_MATTERS
|
select VBOOT_OPROM_MATTERS
|
||||||
select VBOOT_STARTS_IN_BOOTBLOCK
|
select VBOOT_STARTS_IN_BOOTBLOCK
|
||||||
select SEPARATE_VERSTAGE
|
select SEPARATE_VERSTAGE
|
||||||
select CHIPSET_PROVIDES_VERSTAGE_MAIN_SYMBOL
|
|
||||||
|
|
||||||
config TEGRA124_MODEL_TD570D
|
config TEGRA124_MODEL_TD570D
|
||||||
bool "TD570D"
|
bool "TD570D"
|
||||||
|
|
|
@ -45,9 +45,9 @@ void verstage_mainboard_init(void)
|
||||||
early_mainboard_init();
|
early_mainboard_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void main(void)
|
void stage_entry(void)
|
||||||
{
|
{
|
||||||
asm volatile ("bl arm_init_caches"
|
asm volatile ("bl arm_init_caches"
|
||||||
: : : "r0", "r1", "r2", "r3", "r4", "r5", "ip");
|
: : : "r0", "r1", "r2", "r3", "r4", "r5", "ip");
|
||||||
verstage();
|
main();
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,13 +95,6 @@ config RETURN_FROM_VERSTAGE
|
||||||
reused by the succeeding stage. This is useful if a RAM space is too
|
reused by the succeeding stage. This is useful if a RAM space is too
|
||||||
small to fit both the verstage and the succeeding stage.
|
small to fit both the verstage and the succeeding stage.
|
||||||
|
|
||||||
config CHIPSET_PROVIDES_VERSTAGE_MAIN_SYMBOL
|
|
||||||
bool "The chipset provides the main() entry point for verstage"
|
|
||||||
default n
|
|
||||||
depends on SEPARATE_VERSTAGE
|
|
||||||
help
|
|
||||||
The chipset code provides their own main() entry point.
|
|
||||||
|
|
||||||
config VBOOT_DYNAMIC_WORK_BUFFER
|
config VBOOT_DYNAMIC_WORK_BUFFER
|
||||||
bool "Vboot's work buffer is dynamically allocated."
|
bool "Vboot's work buffer is dynamically allocated."
|
||||||
default y if ARCH_ROMSTAGE_X86_32 && !SEPARATE_VERSTAGE
|
default y if ARCH_ROMSTAGE_X86_32 && !SEPARATE_VERSTAGE
|
||||||
|
|
|
@ -97,11 +97,10 @@ int vboot_platform_is_resuming(void);
|
||||||
|
|
||||||
/* ============================= VERSTAGE ================================== */
|
/* ============================= VERSTAGE ================================== */
|
||||||
/*
|
/*
|
||||||
* Main logic for verified boot. verstage() is the stage entry point
|
* Main logic for verified boot. verstage_main() is just the core vboot logic.
|
||||||
* while the verstage_main() is just the core logic.
|
* If the verstage is a separate stage, it should be entered via main().
|
||||||
*/
|
*/
|
||||||
void verstage_main(void);
|
void verstage_main(void);
|
||||||
void verstage(void);
|
|
||||||
void verstage_mainboard_init(void);
|
void verstage_mainboard_init(void);
|
||||||
|
|
||||||
/* Check boot modes */
|
/* Check boot modes */
|
||||||
|
|
|
@ -24,7 +24,7 @@ void __attribute__((weak)) verstage_mainboard_init(void)
|
||||||
/* Default empty implementation. */
|
/* Default empty implementation. */
|
||||||
}
|
}
|
||||||
|
|
||||||
void verstage(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
console_init();
|
console_init();
|
||||||
exception_init();
|
exception_init();
|
||||||
|
@ -37,8 +37,3 @@ void verstage(void)
|
||||||
hlt();
|
hlt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !IS_ENABLED(CONFIG_CHIPSET_PROVIDES_VERSTAGE_MAIN_SYMBOL)
|
|
||||||
/* This is for boards that rely on main() for an entry point of a stage. */
|
|
||||||
void main(void) __attribute__((alias ("verstage")));
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Reference in New Issue