2019-07-22 22:23:47 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Lexmark International, Inc.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <kernel.h>
|
|
|
|
#include <device.h>
|
|
|
|
#include <init.h>
|
2020-03-22 22:19:22 +08:00
|
|
|
#include <arch/arm/aarch32/cortex_a_r/cmsis.h>
|
2019-07-22 22:23:47 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @brief Perform basic hardware initialization
|
|
|
|
*
|
|
|
|
* @return 0
|
|
|
|
*/
|
|
|
|
|
|
|
|
static int soc_init(struct device *arg)
|
|
|
|
{
|
|
|
|
ARG_UNUSED(arg);
|
|
|
|
|
|
|
|
/* Install default handler that simply resets the CPU
|
|
|
|
* if configured in the kernel, NOP otherwise
|
|
|
|
*/
|
|
|
|
NMI_INIT();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYS_INIT(soc_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
2019-10-16 15:46:48 +08:00
|
|
|
|
|
|
|
void z_platform_init(void)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Use normal exception vectors address range (0x0-0x1C).
|
|
|
|
*/
|
2020-02-12 13:48:21 +08:00
|
|
|
unsigned int sctlr = __get_SCTLR();
|
|
|
|
|
|
|
|
sctlr &= ~SCTLR_V_Msk;
|
|
|
|
__set_SCTLR(sctlr);
|
2019-10-16 15:46:48 +08:00
|
|
|
}
|