File tree Expand file tree Collapse file tree 4 files changed +47
-2
lines changed Expand file tree Collapse file tree 4 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 1919#include <hal/nrf_power.h>
2020#include <lib/nrfx_coredep.h>
2121#include <zephyr/logging/log.h>
22+ #include <helpers/nrfx_gppi.h>
2223
2324#include <cmsis_core.h>
2425
2526#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
2627LOG_MODULE_REGISTER (soc );
2728
29+ void gppi_init (void )
30+ {
31+ static nrfx_gppi_t gppi_instance ;
32+
33+ gppi_instance .ch_mask = BIT_MASK (PPI_CH_NUM ) & ~NRFX_PPI_CHANNELS_USED ;
34+ gppi_instance .group_mask = BIT_MASK (PPI_GROUP_NUM ) & ~NRFX_PPI_GROUPS_USED ;
35+
36+ nrfx_gppi_init (& gppi_instance );
37+ }
38+
2839static int nordicsemi_nrf52_init (void )
2940{
3041#ifdef CONFIG_NRF_ENABLE_ICACHE
@@ -41,6 +52,10 @@ static int nordicsemi_nrf52_init(void)
4152 nrf_power_dcdcen_vddh_set (NRF_POWER , true);
4253#endif
4354
55+ if (IS_ENABLED (CONFIG_NRFX_GPPI ) && !IS_ENABLED (CONFIG_NRFX_GPPI_V1 )) {
56+ gppi_init ();
57+ }
58+
4459 return 0 ;
4560}
4661
Original file line number Diff line number Diff line change @@ -477,6 +477,17 @@ static int rtc_pretick_init(void)
477477}
478478#endif /* CONFIG_SOC_NRF53_RTC_PRETICK */
479479
480+ BUILD_ASSERT (DPPIC_CH_NUM == 32 );
481+ void gppi_init (void )
482+ {
483+ static nrfx_gppi_t gppi_instance ;
484+
485+ gppi_instance .ch_mask = UINT32_MAX & ~NRFX_DPPI_CHANNELS_USED ;
486+ gppi_instance .group_mask = BIT_MASK (DPPIC_GROUP_NUM ) & ~NRFX_DPPI_GROUPS_USED ;
487+
488+ nrfx_gppi_init (& gppi_instance );
489+ }
490+
480491void soc_early_init_hook (void )
481492{
482493#if defined(CONFIG_SOC_NRF5340_CPUAPP ) && defined(CONFIG_NRF_ENABLE_CACHE )
@@ -557,6 +568,10 @@ void soc_early_init_hook(void)
557568 __ASSERT_NO_MSG (err == 0 );
558569 (void )err ;
559570#endif
571+
572+ if (IS_ENABLED (CONFIG_NRFX_GPPI ) && !IS_ENABLED (CONFIG_NRFX_GPPI_V1 )) {
573+ gppi_init ();
574+ }
560575}
561576
562577void soc_late_init_hook (void )
Original file line number Diff line number Diff line change @@ -37,8 +37,6 @@ LOG_MODULE_REGISTER(soc, CONFIG_SOC_LOG_LEVEL);
3737#define LFXO_NODE DT_NODELABEL(lfxo)
3838#define HFXO_NODE DT_NODELABEL(hfxo)
3939
40- static nrfx_gppi_t gppi_instance ;
41-
4240static inline void power_and_clock_configuration (void )
4341{
4442/* NRF_REGULATORS and NRF_OSCILLATORS are configured to be secure
@@ -153,6 +151,8 @@ static inline void power_and_clock_configuration(void)
153151
154152void gppi_init (void )
155153{
154+ static nrfx_gppi_t gppi_instance ;
155+
156156 gppi_instance .routes = nrfx_gppi_routes_get ();
157157 gppi_instance .route_map = nrfx_gppi_route_map_get ();
158158 gppi_instance .nodes = nrfx_gppi_nodes_get ();
Original file line number Diff line number Diff line change 1616#include <zephyr/init.h>
1717#include <lib/nrfx_coredep.h>
1818#include <zephyr/logging/log.h>
19+ #include <helpers/nrfx_gppi.h>
1920
2021#include <cmsis_core.h>
2122
2223#define LOG_LEVEL CONFIG_SOC_LOG_LEVEL
2324LOG_MODULE_REGISTER (soc );
2425
26+ void gppi_init (void )
27+ {
28+ static nrfx_gppi_t gppi_instance ;
29+
30+ gppi_instance .ch_mask = BIT_MASK (DPPIC_CH_NUM ) & ~NRFX_DPPI_CHANNELS_USED ;
31+ gppi_instance .group_mask = BIT_MASK (DPPIC_GROUP_NUM ) & ~NRFX_DPPI_GROUPS_USED ;
32+
33+ nrfx_gppi_init (& gppi_instance );
34+ }
35+
2536static int nordicsemi_nrf91_init (void )
2637{
2738#ifdef CONFIG_NRF_ENABLE_ICACHE
2839 /* Enable the instruction cache */
2940 NRF_NVMC -> ICACHECNF = NVMC_ICACHECNF_CACHEEN_Msk ;
3041#endif
3142
43+ if (IS_ENABLED (CONFIG_NRFX_GPPI ) && !IS_ENABLED (CONFIG_NRFX_GPPI_V1 )) {
44+ gppi_init ();
45+ }
46+
3247 return 0 ;
3348}
3449
You can’t perform that action at this time.
0 commit comments