blob: 047b317281e34efb2319db751259ea6e6db1c754 [file] [log] [blame]
/*
* Copyright (c) 2022 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <zephyr/arch/arm/aarch32/cortex_m/cmsis.h>
#include <zephyr/arch/arm/aarch32/nmi.h>
void sys_arch_reboot(int type)
{
ARG_UNUSED(type);
NVIC_SystemReset();
}
static int renesas_da14699_init(const struct device *dev)
{
ARG_UNUSED(dev);
NMI_INIT();
/* Freeze watchdog until configured */
GPREG->SET_FREEZE_REG = GPREG_SET_FREEZE_REG_FRZ_SYS_WDOG_Msk;
/* Reset clock dividers to 0 */
CRG_TOP->CLK_AMBA_REG &= ~(CRG_TOP_CLK_AMBA_REG_HCLK_DIV_Msk |
CRG_TOP_CLK_AMBA_REG_PCLK_DIV_Msk);
/* Enable all power domains except for radio */
CRG_TOP->PMU_CTRL_REG = 0x02;
return 0;
}
SYS_INIT(renesas_da14699_init, PRE_KERNEL_1, 0);