From 73e0f18b35f154dc54994474448df283f51d659d Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 12 Jul 2021 09:21:51 -0600 Subject: soc/amd/cezanne: Move APOB update into ramstage There is no technical reason this needs to be done in romstage. Moving it into ramstage allow us (in future CLs) to use threads to pre-load the apob from SPI. BUG=b:179699789 TEST=Boot and Ezkinil and Guybrush and verify APOB update still work Signed-off-by: Raul E Rangel Change-Id: I960437ff4400645de5a3e7447fcdbc52de85943e Reviewed-on: https://review.coreboot.org/c/coreboot/+/56227 Tested-by: build bot (Jenkins) Reviewed-by: Karthik Ramasubramanian --- src/soc/amd/common/block/apob/Makefile.inc | 1 + src/soc/amd/common/block/apob/apob_cache.c | 4 +++- src/soc/amd/common/block/include/amdblocks/apob_cache.h | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/soc/amd/common') diff --git a/src/soc/amd/common/block/apob/Makefile.inc b/src/soc/amd/common/block/apob/Makefile.inc index 16baf81813..6e217df648 100644 --- a/src/soc/amd/common/block/apob/Makefile.inc +++ b/src/soc/amd/common/block/apob/Makefile.inc @@ -1,3 +1,4 @@ ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_APOB),y) romstage-y += apob_cache.c +ramstage-y += apob_cache.c endif # CONFIG_SOC_AMD_COMMON_BLOCK_APOB diff --git a/src/soc/amd/common/block/apob/apob_cache.c b/src/soc/amd/common/block/apob/apob_cache.c index 34d54727fc..c41627b7ac 100644 --- a/src/soc/amd/common/block/apob/apob_cache.c +++ b/src/soc/amd/common/block/apob/apob_cache.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -96,7 +97,7 @@ static void *get_apob_from_nv_region(struct region *region) } /* Save APOB buffer to flash */ -void soc_update_apob_cache(void) +static void soc_update_apob_cache(void *unused) { struct apob_base_header *apob_rom; struct region_device write_rdev; @@ -183,3 +184,4 @@ void *soc_fill_apob_cache(void) */ return get_apob_nv_address(); } +BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT, soc_update_apob_cache, NULL); diff --git a/src/soc/amd/common/block/include/amdblocks/apob_cache.h b/src/soc/amd/common/block/include/amdblocks/apob_cache.h index 1d29ddc279..79228e5de2 100644 --- a/src/soc/amd/common/block/include/amdblocks/apob_cache.h +++ b/src/soc/amd/common/block/include/amdblocks/apob_cache.h @@ -4,6 +4,5 @@ #define AMD_BLOCK_APOB_CACHE_H void *soc_fill_apob_cache(void); -void soc_update_apob_cache(void); #endif /* AMD_BLOCK_APOB_CACHE_H */ -- cgit v1.2.3