From d314253fbb9b981b63aac9b84fb175a0eadd44d3 Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Wed, 16 Oct 2019 16:46:48 +0900 Subject: [PATCH] soc: arm: xilinx_zynqmp: Relocate platform-specific initialisation. This commit relocates the exception vector table address range configuration routine that was previously implemented as part of Cortex-R architecture reset function to SoC platform-specific initialisation routine. Signed-off-by: Stephanos Ioannidis --- soc/arm/xilinx_zynqmp/Kconfig.soc | 1 + soc/arm/xilinx_zynqmp/soc.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/soc/arm/xilinx_zynqmp/Kconfig.soc b/soc/arm/xilinx_zynqmp/Kconfig.soc index 90b43e63642..3c83d58c11f 100644 --- a/soc/arm/xilinx_zynqmp/Kconfig.soc +++ b/soc/arm/xilinx_zynqmp/Kconfig.soc @@ -9,3 +9,4 @@ config SOC_XILINX_ZYNQMP_RPU select GIC_V1 select MULTI_LEVEL_INTERRUPTS select 2ND_LEVEL_INTERRUPTS + select PLATFORM_SPECIFIC_INIT diff --git a/soc/arm/xilinx_zynqmp/soc.c b/soc/arm/xilinx_zynqmp/soc.c index 68fae6a2c8d..9deecdf11cc 100644 --- a/soc/arm/xilinx_zynqmp/soc.c +++ b/soc/arm/xilinx_zynqmp/soc.c @@ -9,7 +9,6 @@ #include #include -#include /** * * @brief Perform basic hardware initialization @@ -29,3 +28,15 @@ static int soc_init(struct device *arg) } SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); + +void z_platform_init(void) +{ + /* + * Use normal exception vectors address range (0x0-0x1C). + */ + __asm__ volatile( + "mrc p15, 0, r0, c1, c0, 0;" /* SCTLR */ + "bic r0, r0, #" TOSTR(HIVECS) ";" /* Clear HIVECS */ + "mcr p15, 0, r0, c1, c0, 0;" + : : : "memory"); +}