From ec3c8b552dc5334208e7579076afe1a45753363d Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sat, 12 Jan 2019 11:44:08 +0100 Subject: drivers/intel/fsp1.1: Read stack guards later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Read back the stack guards after most of the romstage took place. Change-Id: Ia7dc26c7ed1750d4ebbe7514ed87da57f9e34a89 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/30875 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki --- src/drivers/intel/fsp1_1/car.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/drivers/intel/fsp1_1/car.c b/src/drivers/intel/fsp1_1/car.c index 63c5042776..79dd3681c3 100644 --- a/src/drivers/intel/fsp1_1/car.c +++ b/src/drivers/intel/fsp1_1/car.c @@ -39,6 +39,7 @@ asmlinkage void *cache_as_ram_main(struct cache_as_ram_params *car_params) const int num_guards = 4; const u32 stack_guard = 0xdeadbeef; u32 *stack_base; + void *ram_stack; u32 size; /* Size of unallocated CAR. */ @@ -78,6 +79,9 @@ asmlinkage void *cache_as_ram_main(struct cache_as_ram_params *car_params) set_fih_car(car_params->fih); + /* Return new stack value in RAM back to assembly stub. */ + ram_stack = cache_as_ram_stage_main(car_params->fih); + /* Check the stack. */ for (i = 0; i < num_guards; i++) { if (stack_base[i] == stack_guard) @@ -85,8 +89,7 @@ asmlinkage void *cache_as_ram_main(struct cache_as_ram_params *car_params) printk(BIOS_DEBUG, "Smashed stack detected in romstage!\n"); } - /* Return new stack value in RAM back to assembly stub. */ - return cache_as_ram_stage_main(car_params->fih); + return ram_stack; } /* Entry point taken when romstage is called after a separate verstage. */ -- cgit v1.2.3