From 933d2b0f1317aeba74d5005b1d177a507aae0847 Mon Sep 17 00:00:00 2001 From: Naresh Solanki Date: Fri, 8 Dec 2023 16:58:52 +0530 Subject: [PATCH] lib: ramdetect: Add Kconfig PROBE_RAM Previously ramdetect.c was compiled only for VENDOR_EMULATION. Hence add Kconfig option PROBE_RAM which allows board outside the scope of VENDOR_EMULATION to select and utilize probe_ram function to runtime detect usable RAM in emulation environment. PROBE_RAM is default selected if VENDOR_EMULATION is set so that existing boards under VENDOR_EMULATION scope are not affected. Other boards can explicitly select PROBE_RAM to use probe_ram. TEST=Build mb/arm/rdn2 with PROBE_RAM selected & make sure there is no any error. Also checked qemu-aarch64 build to make sure build is success. Change-Id: Id909ddaee6958cfa8a6c263a11f9a90d94710aa7 Signed-off-by: Naresh Solanki Reviewed-on: https://review.coreboot.org/c/coreboot/+/79450 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/lib/Kconfig | 6 ++++++ src/lib/Makefile.inc | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lib/Kconfig b/src/lib/Kconfig index 23647947a4..80efe75dc9 100644 --- a/src/lib/Kconfig +++ b/src/lib/Kconfig @@ -143,3 +143,9 @@ config DECOMPRESS_OFAST default y help Compile the decompressing function in -Ofast instead of standard -Os + +config PROBE_RAM + def_bool y if VENDOR_EMULATION + help + When enabled it will be possible to detect usable RAM using probe_ram + function. diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 0f4600813b..fd3f464ffd 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -83,7 +83,7 @@ verstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c verstage-$(CONFIG_GENERIC_UDELAY) += timer.c verstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c -romstage-$(CONFIG_VENDOR_EMULATION) += ramdetect.c +romstage-$(CONFIG_PROBE_RAM) += ramdetect.c romstage-y += prog_loaders.c romstage-y += prog_ops.c romstage-y += memchr.c @@ -129,7 +129,7 @@ endif romstage-$(CONFIG_GENERIC_UDELAY) += timer.c -ramstage-$(CONFIG_VENDOR_EMULATION) += ramdetect.c +ramstage-$(CONFIG_PROBE_RAM) += ramdetect.c ramstage-y += prog_loaders.c ramstage-y += prog_ops.c ramstage-y += hardwaremain.c @@ -183,7 +183,7 @@ ramstage-y += cbmem_common.c ramstage-y += imd_cbmem.c ramstage-y += imd.c -postcar-$(CONFIG_VENDOR_EMULATION) += ramdetect.c +postcar-$(CONFIG_PROBE_RAM) += ramdetect.c postcar-y += cbmem_common.c postcar-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c postcar-y += imd_cbmem.c