board: ns3: add api to save boot parameters passed from BL31
Add API to save boot parameters passed from BL31 Use assembly implementation of save_boot_params instead of c function. Because generally ATF does not set up SP_EL2 on exiting. Thus, usage of a C function immediately after exiting with no stack setup done by ATF explicitly, may cause SP_EL2 to be not sane, which in turn causes a crash if this boot was not lucky to get an SP_EL2 in valid range. Replace C implementation with assembly one which does not use stack this early, and let u-boot to set up its stack later. Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com> Signed-off-by: Rajesh Ravi <rajesh.ravi@broadcom.com> Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <asm/io.h>
|
||||
#include <asm/system.h>
|
||||
#include <asm/armv8/mmu.h>
|
||||
#include <asm/arch-bcmns3/bl33_info.h>
|
||||
|
||||
static struct mm_region ns3_mem_map[] = {
|
||||
{
|
||||
@@ -33,8 +34,17 @@ struct mm_region *mem_map = ns3_mem_map;
|
||||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
/*
|
||||
* Force the bl33_info to the data-section, as .bss will not be valid
|
||||
* when save_boot_params is invoked.
|
||||
*/
|
||||
struct bl33_info *bl33_info __section(".data");
|
||||
|
||||
int board_init(void)
|
||||
{
|
||||
if (bl33_info->version != BL33_INFO_VERSION)
|
||||
printf("*** warning: ATF BL31 and U-Boot not in sync! ***\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user