Skip to content

Commit 792f9fb

Browse files
nordic-krchmasz-nordic
authored andcommitted
[nrf fromlist] soc: nordic: nrf54l: Add initialization of GPPI resources
Add initialization of GPPI resources for nrf54l series. Upstream PR #: 98327 Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 57d05de commit 792f9fb

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

soc/nordic/nrf54l/soc.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <zephyr/cache.h>
2323
#include <lib/nrfx_coredep.h>
2424
#include <soc.h>
25+
#include <helpers/nrfx_gppi.h>
26+
#include <helpers/nrfx_gppi_lumos.h>
2527
LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
2628

2729
#if (defined(NRF_APPLICATION) && !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE)) || \
@@ -35,6 +37,8 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
3537
#define LFXO_NODE DT_NODELABEL(lfxo)
3638
#define HFXO_NODE DT_NODELABEL(hfxo)
3739

40+
static nrfx_gppi_t gppi_instance;
41+
3842
static inline void power_and_clock_configuration(void)
3943
{
4044
/* NRF_REGULATORS and NRF_OSCILLATORS are configured to be secure
@@ -147,6 +151,30 @@ static inline void power_and_clock_configuration(void)
147151
}
148152
#endif /* NRF_APPLICATION && !CONFIG_TRUSTED_EXECUTION_NONSECURE */
149153

154+
#if defined(CONFIG_NRFX_GPPI) && !defined(CONFIG_NRFX_GPPI_V1)
155+
void gppi_init(void)
156+
{
157+
gppi_instance.routes = nrfx_gppi_routes_get();
158+
gppi_instance.route_map = nrfx_gppi_route_map_get();
159+
gppi_instance.nodes = nrfx_gppi_nodes_get();
160+
161+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC00, NRFX_BIT_MASK(DPPIC00_CH_NUM_SIZE));
162+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC10, NRFX_BIT_MASK(DPPIC10_CH_NUM_SIZE));
163+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC20, NRFX_BIT_MASK(DPPIC20_CH_NUM_SIZE));
164+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_DPPIC30, NRFX_BIT_MASK(DPPIC30_CH_NUM_SIZE));
165+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB00_10, NRFX_BIT_MASK(PPIB10_NTASKSEVENTS_SIZE));
166+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB11_21, NRFX_BIT_MASK(PPIB11_NTASKSEVENTS_SIZE));
167+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB01_20, NRFX_BIT_MASK(PPIB01_NTASKSEVENTS_SIZE));
168+
nrfx_gppi_channel_init(NRFX_GPPI_NODE_PPIB22_30, NRFX_BIT_MASK(PPIB22_NTASKSEVENTS_SIZE));
169+
170+
nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC00, NRFX_BIT_MASK(DPPIC00_GROUP_NUM_SIZE));
171+
nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC10, NRFX_BIT_MASK(DPPIC10_GROUP_NUM_SIZE));
172+
nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC20, NRFX_BIT_MASK(DPPIC20_GROUP_NUM_SIZE));
173+
nrfx_gppi_groups_init(NRFX_GPPI_NODE_DPPIC30, NRFX_BIT_MASK(DPPIC30_GROUP_NUM_SIZE));
174+
nrfx_gppi_init(&gppi_instance);
175+
}
176+
#endif
177+
150178
int nordicsemi_nrf54l_init(void)
151179
{
152180
/* Update the SystemCoreClock global variable with current core clock
@@ -161,6 +189,10 @@ int nordicsemi_nrf54l_init(void)
161189
power_and_clock_configuration();
162190
#endif
163191

192+
#if defined(CONFIG_NRFX_GPPI) && !defined(CONFIG_NRFX_GPPI_V1)
193+
gppi_init();
194+
#endif
195+
164196
return 0;
165197
}
166198

0 commit comments

Comments
 (0)