From 85e3fe12ed8df97c6a2e2d76d1db9f7cbde52d9a Mon Sep 17 00:00:00 2001 From: Shuo Liu Date: Wed, 6 Mar 2024 18:16:22 +0800 Subject: drivers/intel/fsp2_0: Use DECLARE_REGION for FSP-M heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are 2 ways of referring to linker symbols, as extern u8[] or extern u8*. Only the former will be correctly initiated into an immediate operand (a constant) to asm. DECLARE_REGION defines reference in form of extern u8[]. Use DECLARE_REGION as a standard way for these references. TEST=intel/archercity CRB Change-Id: I5f7d7855592d99b074f7ef49c285a13f8105f089 Signed-off-by: Shuo Liu Reviewed-on: https://review.coreboot.org/c/coreboot/+/81097 Reviewed-by: Julius Werner Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) Reviewed-by: Jérémy Compostella Reviewed-by: Arthur Heymans --- src/drivers/intel/fsp2_0/memory_init.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index 922bca2844..27921c6b26 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -178,10 +178,9 @@ static enum cb_err fsp_fill_common_arch_params(FSPM_ARCHx_UPD *arch_upd, if (CONFIG(FSP_USES_CB_STACK) && ENV_RAMINIT && CONFIG(FSP_SPEC_VIOLATION_XEON_SP_HEAP_WORKAROUND)) { - extern char _fspm_heap[]; - extern char _efspm_heap[]; + DECLARE_REGION(fspm_heap); arch_upd->StackBase = (uintptr_t)_fspm_heap; - arch_upd->StackSize = (size_t)(_efspm_heap - _fspm_heap); + arch_upd->StackSize = (size_t)REGION_SIZE(fspm_heap); } else if (CONFIG(FSP_USES_CB_STACK) || !ENV_CACHE_AS_RAM) { arch_upd->StackBase = (uintptr_t)temp_ram; arch_upd->StackSize = sizeof(temp_ram); -- cgit v1.2.3