x86: apl: Adjust FSP-M code to avoid hard-coded address
authorSimon Glass <sjg@chromium.org>
Fri, 17 Jul 2020 03:22:33 +0000 (21:22 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 17 Jul 2020 06:32:24 +0000 (14:32 +0800)
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@chromium.org>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/cpu/apollolake/fsp_m.c

index e19a2b0..cef9375 100644 (file)
@@ -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;