Andrey Petrov (andrey.petrov@intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14001
-gerrit
commit 6fad2891a89eab329a6043be294e42d962068f2c Author: Andrey Petrov andrey.petrov@intel.com Date: Tue Mar 8 21:59:01 2016 -0800
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 --- src/soc/intel/apollolake/Kconfig | 6 ------ src/soc/intel/apollolake/romstage.c | 12 ++++++++---- 2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig index 022c2e4..a11c5a2 100644 --- a/src/soc/intel/apollolake/Kconfig +++ b/src/soc/intel/apollolake/Kconfig @@ -98,10 +98,4 @@ config ROMSTAGE_ADDR help The base address (in CAR) where romstage should be linked
-config FSPM_STACK_SIZE - hex - default 0x40000 - help - The amount of CAR memory FSPM needs. Recommended at least 256KiB - endif diff --git a/src/soc/intel/apollolake/romstage.c b/src/soc/intel/apollolake/romstage.c index 2c8bbe8..7c8924d 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))