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
commit fa3bc049f5
26 changed files with 65 additions and 90 deletions

View file

@ -39,8 +39,8 @@ struct tcpa_table *tcpa_log_init(void)
if (!cbmem_possibly_online() &&
!CONFIG(VBOOT_RETURN_FROM_VERSTAGE))
return (struct tcpa_table *)_tpm_tcpa_log;
else if (ENV_ROMSTAGE &&
!CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) {
else if (ENV_CREATES_CBMEM
&& !CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) {
tclt = tcpa_cbmem_init();
if (!tclt)
return (struct tcpa_table *)_tpm_tcpa_log;
@ -154,7 +154,7 @@ static void recover_tcpa_log(int is_recovery)
memcpy(tce->digest, preram_log->entries[i].digest, tce->digest_length);
}
}
ROMSTAGE_CBMEM_INIT_HOOK(recover_tcpa_log);
CBMEM_CREATION_HOOK(recover_tcpa_log);
#endif
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, tcpa_log_dump, NULL);

View file

@ -96,4 +96,4 @@ static void vboot_setup_cbmem(int unused)
assert(rv == VB2_SUCCESS);
}
ROMSTAGE_CBMEM_INIT_HOOK(vboot_setup_cbmem)
CBMEM_CREATION_HOOK(vboot_setup_cbmem);