From fa3bc049f5ca51eeb35fafb61f043d5a54f30c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 31 Mar 2022 07:40:10 +0300 Subject: CBMEM: Change declarations for initialization hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63375 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Julius Werner Reviewed-by: Raul Rangel --- src/soc/intel/baytrail/romstage/romstage.c | 2 +- src/soc/intel/braswell/romstage/romstage.c | 2 +- src/soc/intel/broadwell/pch/power_state.c | 2 +- src/soc/intel/common/block/pmc/pmclib.c | 2 +- src/soc/intel/quark/storage_test.c | 6 ++---- 5 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/soc/intel') diff --git a/src/soc/intel/baytrail/romstage/romstage.c b/src/soc/intel/baytrail/romstage/romstage.c index 74238e2721..658da2c44b 100644 --- a/src/soc/intel/baytrail/romstage/romstage.c +++ b/src/soc/intel/baytrail/romstage/romstage.c @@ -32,7 +32,7 @@ static void migrate_power_state(int is_recovery) } memcpy(ps_cbmem, ps_car, sizeof(*ps_cbmem)); } -ROMSTAGE_CBMEM_INIT_HOOK(migrate_power_state) +CBMEM_CREATION_HOOK(migrate_power_state); static struct chipset_power_state *fill_power_state(void) { diff --git a/src/soc/intel/braswell/romstage/romstage.c b/src/soc/intel/braswell/romstage/romstage.c index daa1b2d19f..a1623e13f9 100644 --- a/src/soc/intel/braswell/romstage/romstage.c +++ b/src/soc/intel/braswell/romstage/romstage.c @@ -26,7 +26,7 @@ static void migrate_power_state(int is_recovery) } memcpy(ps_cbmem, &power_state, sizeof(*ps_cbmem)); } -ROMSTAGE_CBMEM_INIT_HOOK(migrate_power_state); +CBMEM_CREATION_HOOK(migrate_power_state); struct chipset_power_state *fill_power_state(void) { diff --git a/src/soc/intel/broadwell/pch/power_state.c b/src/soc/intel/broadwell/pch/power_state.c index 12bee7d127..b1ab622b72 100644 --- a/src/soc/intel/broadwell/pch/power_state.c +++ b/src/soc/intel/broadwell/pch/power_state.c @@ -30,7 +30,7 @@ static void migrate_power_state(int is_recovery) } memcpy(ps_cbmem, ps_car, sizeof(*ps_cbmem)); } -ROMSTAGE_CBMEM_INIT_HOOK(migrate_power_state) +CBMEM_CREATION_HOOK(migrate_power_state); /* Return 0, 3, or 5 to indicate the previous sleep state. */ static int prev_sleep_state(const struct chipset_power_state *ps) diff --git a/src/soc/intel/common/block/pmc/pmclib.c b/src/soc/intel/common/block/pmc/pmclib.c index 0f1da72577..bfe26c31ca 100644 --- a/src/soc/intel/common/block/pmc/pmclib.c +++ b/src/soc/intel/common/block/pmc/pmclib.c @@ -85,7 +85,7 @@ static void migrate_power_state(int is_recovery) } memcpy(ps_cbmem, &power_state, sizeof(*ps_cbmem)); } -ROMSTAGE_CBMEM_INIT_HOOK(migrate_power_state) +CBMEM_CREATION_HOOK(migrate_power_state); static void print_num_status_bits(int num_bits, uint32_t status, const char *const bit_names[]) diff --git a/src/soc/intel/quark/storage_test.c b/src/soc/intel/quark/storage_test.c index 04c673616d..f15d295a61 100644 --- a/src/soc/intel/quark/storage_test.c +++ b/src/soc/intel/quark/storage_test.c @@ -159,7 +159,7 @@ void storage_test(uint32_t bar, int full_initialization) /* Get the structure addresses */ media = NULL; - if (ENV_ROMSTAGE) + if (ENV_CREATES_CBMEM) media = (struct storage_media *)drivers_storage; else media = cbmem_find(CBMEM_ID_STORAGE_DATA); @@ -225,7 +225,6 @@ void storage_test(uint32_t bar, int full_initialization) } #endif -#if ENV_ROMSTAGE static void copy_storage_structures(int is_recovery) { struct storage_media *media; @@ -242,5 +241,4 @@ static void copy_storage_structures(int is_recovery) media->ctrlr = &sdhci_ctrlr->sd_mmc_ctrlr; } -ROMSTAGE_CBMEM_INIT_HOOK(copy_storage_structures); -#endif +CBMEM_CREATION_HOOK(copy_storage_structures); -- cgit v1.2.3