CBMEM: Change declarations for initialization hooks

There are efforts to have bootflows that do not follow a traditional
bootblock-romstage-postcar-ramstage model. As part of that CBMEM
initialisation hooks will need to move from romstage to bootblock.

The interface towards platforms and drivers will change to use one of
CBMEM_CREATION_HOOK() or CBMEM_READY_HOOK(). Former will only be called
in the first stage with CBMEM available.

Change-Id: Ie24bf4e818ca69f539196c3a814f3c52d4103d7e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63375
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Kyösti Mälkki
2022-03-31 07:40:10 +03:00
committed by Arthur Heymans
parent 20a87c0bed
commit fa3bc049f5
26 changed files with 65 additions and 90 deletions

View File

@@ -109,7 +109,7 @@ static void save_hob_list(int is_recovery)
*cbmem_loc = (uintptr_t)hob_list;
}
ROMSTAGE_CBMEM_INIT_HOOK(save_hob_list);
CBMEM_CREATION_HOOK(save_hob_list);
const void *fsp_get_hob_list(void)
{

View File

@@ -680,7 +680,7 @@ static void migrate_ehci_debug(int is_recovery)
struct ehci_debug_info *dbg_info_cbmem;
int rv;
if (ENV_ROMSTAGE) {
if (ENV_CREATES_CBMEM) {
/* Move state from CAR to CBMEM. */
struct ehci_debug_info *dbg_info = dbgp_ehci_info();
dbg_info_cbmem = cbmem_add(CBMEM_ID_EHCI_DEBUG,
@@ -706,9 +706,7 @@ static void migrate_ehci_debug(int is_recovery)
printk(BIOS_DEBUG, "usbdebug: " ENV_STRING " starting...\n");
}
ROMSTAGE_CBMEM_INIT_HOOK(migrate_ehci_debug);
POSTCAR_CBMEM_INIT_HOOK(migrate_ehci_debug);
RAMSTAGE_CBMEM_INIT_HOOK(migrate_ehci_debug);
CBMEM_READY_HOOK(migrate_ehci_debug);
int dbgp_ep_is_active(struct dbgp_pipe *pipe)
{
@@ -728,7 +726,7 @@ struct dbgp_pipe *dbgp_console_input(void)
void usbdebug_init(void)
{
/* USB console init is done early in romstage, yet delayed to
* CBMEM_INIT_HOOKs for postcar and ramstage as we recover state
* CBMEM_READY_HOOKs for postcar and ramstage as we recover state
* from CBMEM.
*/
if (CONFIG(USBDEBUG_IN_PRE_RAM)

View File

@@ -295,4 +295,4 @@ bool vpd_get_int(const char *const key, const enum vpd_region region, int *const
return true;
}
ROMSTAGE_CBMEM_INIT_HOOK(cbmem_add_cros_vpd)
CBMEM_CREATION_HOOK(cbmem_add_cros_vpd);