summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShuo Liu <shuo.liu@intel.com>2024-03-06 18:16:22 +0800
committerArthur Heymans <arthur@aheymans.xyz>2024-03-19 13:00:50 +0000
commit85e3fe12ed8df97c6a2e2d76d1db9f7cbde52d9a (patch)
treec02cbc3b6cebfb479a71f99ea4b6bc9aee1e1029
parentbb50190bec998b4ec1a6cf4e02f1ae4022b36084 (diff)
drivers/intel/fsp2_0: Use DECLARE_REGION for FSP-M heap
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 <shuo.liu@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81097 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
-rw-r--r--src/drivers/intel/fsp2_0/memory_init.c5
1 files 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);