diff mbox series

[v2,37/44] x86: apl: Adjust FSP-M code to avoid hard-coded address

Message ID 20200708033246.2626378-18-sjg@chromium.org
State Accepted
Commit 487852b51b10ec53d42ec7e0585db9f357d1993d
Headers show
Series x86: Programmatic generation of ACPI tables (Part C) | expand

Commit Message

Simon Glass July 8, 2020, 3:32 a.m. UTC
Update this code to calculate the address to use, rather than hard-coding
it. Obtain the requested stack size from the FSP.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
---

Changes in v2:
- Split out the boot_mode change into a separate patch

 arch/x86/cpu/apollolake/fsp_m.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bin Meng July 13, 2020, 6:03 a.m. UTC | #1
On Wed, Jul 8, 2020 at 11:34 AM Simon Glass <sjg at chromium.org> wrote:
>
> Update this code to calculate the address to use, rather than hard-coding
> it. Obtain the requested stack size from the FSP.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
> ---
>
> Changes in v2:
> - Split out the boot_mode change into a separate patch
>
>  arch/x86/cpu/apollolake/fsp_m.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/cpu/apollolake/fsp_m.c b/arch/x86/cpu/apollolake/fsp_m.c
index e19a2b0826..cef937573b 100644
--- a/arch/x86/cpu/apollolake/fsp_m.c
+++ b/arch/x86/cpu/apollolake/fsp_m.c
@@ -24,7 +24,8 @@  int fspm_update_config(struct udevice *dev, struct fspm_upd *upd)
 	cache_ret = prepare_mrc_cache(upd);
 	if (cache_ret && cache_ret != -ENOENT)
 		return log_msg_ret("mrc", cache_ret);
-	arch->stack_base = (void *)0xfef96000;
+	arch->stack_base = (void *)(CONFIG_SYS_CAR_ADDR + CONFIG_SYS_CAR_SIZE -
+		 arch->stack_size);
 	arch->boot_loader_tolum_size = 0;
 	arch->boot_mode = cache_ret ? FSP_BOOT_WITH_FULL_CONFIGURATION :
 		FSP_BOOT_ASSUMING_NO_CONFIGURATION_CHANGES;