diff --git a/soc/nordic/nrf54h/soc.c b/soc/nordic/nrf54h/soc.c index cf134dc99b1..1d071f96b20 100644 --- a/soc/nordic/nrf54h/soc.c +++ b/soc/nordic/nrf54h/soc.c @@ -12,6 +12,7 @@ #include #include +#include #include LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); @@ -26,6 +27,12 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL); DT_REG_ADDR(DT_PHANDLE_BY_NAME(node_id, nordic_ficrs, name)) + \ DT_PHA_BY_NAME(node_id, nordic_ficrs, name, offset) +#define SPU_INSTANCE_GET(p_addr) \ + ((NRF_SPU_Type *)((p_addr) & (ADDRESS_REGION_Msk | \ + ADDRESS_SECURITY_Msk | \ + ADDRESS_DOMAIN_Msk | \ + ADDRESS_BUS_Msk))) + static void power_domain_init(void) { /* @@ -83,6 +90,16 @@ static int nordicsemi_nrf54h_init(void) trim_hsfll(); +#if DT_NODE_HAS_STATUS(DT_NODELABEL(ccm030), okay) + /* DMASEC is set to non-secure by default, which prevents CCM from + * accessing secure memory. Change DMASEC to secure. + */ + uint32_t ccm030_addr = DT_REG_ADDR(DT_NODELABEL(ccm030)); + NRF_SPU_Type *spu = SPU_INSTANCE_GET(ccm030_addr); + + nrf_spu_periph_perm_dmasec_set(spu, nrf_address_slave_get(ccm030_addr), true); +#endif + return 0; }