diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-21 21:17:01 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-31 13:16:55 -0400 |
commit | 91caa3bb89b112a1421ee2ee3661baf67c64bab9 (patch) | |
tree | f70b4d2452f8ca45025916cd85f0d1af684902bb /arch/x86/cpu/coreboot/coreboot.c | |
parent | 6a32bfae61652f9dae621410ca6e094f374a1f11 (diff) |
event: Use an event to replace last_stage_init()
Add a new event which handles this function. Convert existing use of
the function to use the new event instead.
Make sure that EVENT is enabled by affected boards, by selecting it from
the LAST_STAGE_INIT option. For x86, enable it by default since all boards
need it.
For controlcenterdc, inline the get_tpm() function and make sure the event
is not built in SPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/cpu/coreboot/coreboot.c')
-rw-r--r-- | arch/x86/cpu/coreboot/coreboot.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/cpu/coreboot/coreboot.c b/arch/x86/cpu/coreboot/coreboot.c index d7eedbd743..835b2c7774 100644 --- a/arch/x86/cpu/coreboot/coreboot.c +++ b/arch/x86/cpu/coreboot/coreboot.c @@ -7,6 +7,7 @@ #include <common.h> #include <cpu_func.h> +#include <event.h> #include <fdtdec.h> #include <init.h> #include <usb.h> @@ -74,8 +75,11 @@ static void board_final_init(void) } } -int last_stage_init(void) +static int last_stage_init(void) { + if (IS_ENABLED(CONFIG_SPL_BUILD)) + return 0; + /* start usb so that usb keyboard can be used as input device */ if (IS_ENABLED(CONFIG_USB_KEYBOARD)) usb_init(); @@ -84,3 +88,4 @@ int last_stage_init(void) return 0; } +EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init); |