2020-04-08 17:34:30 +08:00
|
|
|
/*
|
|
|
|
* Copyright 2020 Broadcom
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <device.h>
|
|
|
|
#include <init.h>
|
|
|
|
#include <soc.h>
|
|
|
|
#include <arch/cpu.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Perform basic hardware initialization at boot.
|
|
|
|
*
|
|
|
|
* This needs to be run from the very beginning.
|
|
|
|
* So the init priority has to be 0 (zero).
|
|
|
|
*
|
|
|
|
* @return 0
|
|
|
|
*/
|
|
|
|
static int viper_init(struct device *arg)
|
|
|
|
{
|
2020-05-28 00:26:57 +08:00
|
|
|
uint32_t key;
|
2020-04-08 17:34:30 +08:00
|
|
|
|
|
|
|
ARG_UNUSED(arg);
|
|
|
|
|
|
|
|
key = irq_lock();
|
|
|
|
|
|
|
|
#ifdef CONFIG_SOC_BCM58402_M7
|
|
|
|
NMI_INIT();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
irq_unlock(key);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SYS_INIT(viper_init, PRE_KERNEL_1, 0);
|