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 <naresh.solanki@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79450
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Naresh Solanki 2023-12-08 16:58:52 +05:30 committed by Lean Sheng Tan
parent 18c83e1a94
commit 933d2b0f13
2 changed files with 9 additions and 3 deletions

View File

@ -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.

View File

@ -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