soc: nordic: vpr: add enabling of RT peripherals in PRE_KERNEL

Real Time peripherals should be enabled by default.
Add a common initialization point for all VPRs and enable them.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
This commit is contained in:
Marcin Szymczyk 2024-04-17 11:07:57 +02:00 committed by Fabio Baltieri
commit 63a5f97019
2 changed files with 20 additions and 1 deletions

View file

@ -3,6 +3,6 @@
zephyr_include_directories(.)
zephyr_library_sources(soc_context.S soc_idle.c)
zephyr_library_sources(soc_context.S soc_idle.c soc_init.c)
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/riscv/common/linker.ld CACHE INTERNAL "")

View file

@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <hal/nrf_vpr_csr.h>
static int vpr_init(void)
{
/* RT peripherals for VPR all share one enable.
* To prevent redundant calls, do it here once.
*/
nrf_vpr_csr_rtperiph_enable_set(true);
return 0;
}
SYS_INIT(vpr_init, PRE_KERNEL_1, 0);