U-Boot executes at EL3 is required to initalize those settings.
In other cases, they will be done by prior-stage firmware instead.
This fixes crash when U-Boot is at non-secure exception level.
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
#include <asm/mach-types.h>
#include <asm/processor.h>
#include <linux/errno.h>
+#include <asm/system.h>
DECLARE_GLOBAL_DATA_PTR;
void s_init(void)
{
- init_generic_timer();
+ if (current_el() == 3)
+ init_generic_timer();
}
int board_early_init_f(void)
/* address of boot parameters */
gd->bd->bi_boot_params = CONFIG_TEXT_BASE + 0x50000;
- init_gic_v3();
+ if (current_el() == 3)
+ init_gic_v3();
return 0;
}