soc/amd/common/block/apob: Add Kconfig option to disable APOB NV

Add Kconfig option to disable the non-volatile APOB cache for a
mainboard using an SOC that supports APOB.

BUG=b:290763369
TEST=verify APOB cache is disabled when selected

Signed-off-by: Fred Reitberger <reitbergerfred@gmail.com>
Change-Id: I0170355bbf29ea6386fa69a318e61f057b9a9a3f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76566
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Fred Reitberger 2023-07-17 08:26:02 -04:00
parent 5f5e73cddd
commit 7bb960d7df
3 changed files with 16 additions and 7 deletions

View File

@ -4,6 +4,15 @@ config SOC_AMD_COMMON_BLOCK_APOB
Select this option to add firmware support for the non-volatile APOB Select this option to add firmware support for the non-volatile APOB
cache to the build. cache to the build.
config SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE
bool "Disable non-volatile APOB support"
depends on SOC_AMD_COMMON_BLOCK_APOB
help
Select this to disable non-volatile APOB cache and train memory
on every boot.
If unsure, say N.
config SOC_AMD_COMMON_BLOCK_APOB_HASH config SOC_AMD_COMMON_BLOCK_APOB_HASH
bool bool
help help

View File

@ -1,6 +1,6 @@
## SPDX-License-Identifier: GPL-2.0-only ## SPDX-License-Identifier: GPL-2.0-only
ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_APOB),y) ifneq ($(CONFIG_SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE),y)
romstage-y += apob_cache.c romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_APOB) += apob_cache.c
ramstage-y += apob_cache.c ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_APOB) += apob_cache.c
endif # CONFIG_SOC_AMD_COMMON_BLOCK_APOB endif # !CONFIG_SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE

View File

@ -5,13 +5,13 @@
#include <stddef.h> #include <stddef.h>
#if CONFIG(SOC_AMD_COMMON_BLOCK_APOB) #if CONFIG(SOC_AMD_COMMON_BLOCK_APOB) && !CONFIG(SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE)
/* Start loading the APOB as soon as possible so it is ready by the time we need it. */ /* Start loading the APOB as soon as possible so it is ready by the time we need it. */
void start_apob_cache_read(void); void start_apob_cache_read(void);
void *soc_fill_apob_cache(void); void *soc_fill_apob_cache(void);
#else /* CONFIG(SOC_AMD_COMMON_BLOCK_APOB) */ #else /* CONFIG(SOC_AMD_COMMON_BLOCK_APOB) && !CONFIG(SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE) */
static inline void start_apob_cache_read(void) {} static inline void start_apob_cache_read(void) {}
static inline void *soc_fill_apob_cache(void) { return NULL; } static inline void *soc_fill_apob_cache(void) { return NULL; }
#endif /* CONFIG(SOC_AMD_COMMON_BLOCK_APOB) */ #endif /* CONFIG(SOC_AMD_COMMON_BLOCK_APOB) && !CONFIG(SOC_AMD_COMMON_BLOCK_APOB_NV_DISABLE) */
#endif /* AMD_BLOCK_APOB_CACHE_H */ #endif /* AMD_BLOCK_APOB_CACHE_H */