1 /*
2  * Copyright (c) 2019 Lexmark International, Inc.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  */
7 
8 #include <kernel.h>
9 #include <device.h>
10 #include <init.h>
11 #include <arch/arm/aarch32/cortex_a_r/cmsis.h>
12 
13 /**
14  *
15  * @brief Perform basic hardware initialization
16  *
17  * @return 0
18  */
19 
soc_init(const struct device * arg)20 static int soc_init(const struct device *arg)
21 {
22 	ARG_UNUSED(arg);
23 
24 	/* Install default handler that simply resets the CPU
25 	 * if configured in the kernel, NOP otherwise
26 	 */
27 	NMI_INIT();
28 	return 0;
29 }
30 
31 SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
32 
z_arm_platform_init(void)33 void z_arm_platform_init(void)
34 {
35 	/*
36 	 * Use normal exception vectors address range (0x0-0x1C).
37 	 */
38 	unsigned int sctlr = __get_SCTLR();
39 
40 	sctlr &= ~SCTLR_V_Msk;
41 	__set_SCTLR(sctlr);
42 }
43