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>
This commit is contained in:
Simon Glass
2023-08-21 21:17:01 -06:00
committed by Tom Rini
parent 6a32bfae61
commit 91caa3bb89
54 changed files with 95 additions and 80 deletions

View File

@@ -9,6 +9,7 @@
#include <cpu_func.h>
#include <dm.h>
#include <env.h>
#include <event.h>
#include <init.h>
#include <log.h>
#include <net.h>
@@ -184,7 +185,7 @@ int misc_init_r(void)
return 0;
}
int last_stage_init(void)
static int last_stage_init(void)
{
void *fdt = get_fdt_virt();
int len = 0;
@@ -204,6 +205,7 @@ int last_stage_init(void)
return 0;
}
EVENT_SPY_SIMPLE(EVT_LAST_STAGE_INIT, last_stage_init);
static uint64_t get_linear_ram_size(void)
{