aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/romstage.c
diff options
context:
space:
mode:
authorAndrey Petrov <andrey.petrov@intel.com>2016-03-08 21:59:01 -0800
committerMartin Roth <martinroth@google.com>2016-03-11 16:55:51 +0100
commit7109304cf241e22923d83344050eb6b30b31484d (patch)
treef16b7b235ed0df97c798df1681cb02d52a4facca /src/soc/intel/apollolake/romstage.c
parent468dc3332531510b0bf0708ecc446732fb0b8b2c (diff)
soc/intel/apollolake: Avoid hardcoding CAR region size for FSPM
Instead of having to supply CAR memory region during compilation time it is possible to determine it in runtime. FSP2.0 blobs carry a copy of UPD structure pre-populated with 'default' values. The default value for StackSize is actually the real value blob needs. Change-Id: I298e07bb12470ce659f63846ab096189138e594f Signed-off-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-on: https://review.coreboot.org/14001 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/apollolake/romstage.c')
-rw-r--r--src/soc/intel/apollolake/romstage.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c
index 2c8bbe80c9..7c8924dab4 100644
--- a/src/soc/intel/apollolake/romstage.c
+++ b/src/soc/intel/apollolake/romstage.c
@@ -141,10 +141,14 @@ void platform_fsp_memory_init_params_cb(struct FSPM_UPD *mupd)
mupd->FspmConfig.FitTablePtr = read32((void*) FIT_POINTER);
/* Reserve enough memory under TOLUD to save CBMEM header */
mupd->FspmArchUpd.BootLoaderTolumSize = cbmem_overhead_size();
- /* Let FSPM use memory right at the top of CAR */
- /* TODO: Add checks to see if we collide with other areas */
- mupd->FspmArchUpd.StackBase = _car_region_end - CONFIG_FSPM_STACK_SIZE;
- mupd->FspmArchUpd.StackSize = CONFIG_FSPM_STACK_SIZE;
+ /*
+ * FSPM_UPD passed here is populated with default values provided by
+ * the blob itself. We let FSPM use top of CAR region of the size it
+ * requests.
+ * TODO: add checks to avoid overlap/conflict of CAR usage.
+ */
+ mupd->FspmArchUpd.StackBase = _car_region_end -
+ mupd->FspmArchUpd.StackSize;
}
__attribute__ ((weak))