Skip to content

Commit 75ec3a1

Browse files
masz-nordicrlubos
authored andcommitted
[nrf fromtree] modules: hal_nordic: nrfx: cleanup
* Move all KConfig configuration from CMake to `nrfx_kconfig.h` * Move macro utils from `nrfx_kconfig.h` to `nrfx_zephyr_utils.h` * Move GRTC channels allocation from `nrfx_kconfig.h` to `nrfx_reserved_resources.h` Signed-off-by: Marcin Szymczyk <[email protected]> (cherry picked from commit 94589b7)
1 parent 6f794f9 commit 75ec3a1

File tree

8 files changed

+187
-108
lines changed

8 files changed

+187
-108
lines changed

modules/hal_nordic/nrfx/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,6 @@ if(CONFIG_SOC_NRF54L_CPUAPP_COMMON)
188188
zephyr_compile_definitions("NRF_CONFIG_CPU_FREQ_MHZ=${clock_frequency_mhz}")
189189
endif()
190190

191-
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG NRF_SKIP_CLOCK_CONFIGURATION)
192-
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_DISABLE_FICR_TRIMCNF NRF_DISABLE_FICR_TRIMCNF)
193-
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE NRF_SKIP_GLITCHDETECTOR_DISABLE)
194-
195-
# Inject code to skip TAMPC setup for nRF54L20 and nRF54L09. It is not supported for now.
196-
# It needs to be removed when support is provided.
197-
if(CONFIG_SOC_NRF54L20_ENGA_CPUAPP OR CONFIG_SOC_NRF54L09_ENGA_CPUAPP)
198-
zephyr_compile_definitions(NRF_SKIP_TAMPC_SETUP)
199-
endif()
200-
201191
if(CONFIG_SOC_COMPATIBLE_NRF54LX AND CONFIG_NRFX_GPPI)
202192
zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib_lumos.c)
203193
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c)

modules/hal_nordic/nrfx/nrfx_config.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,22 @@
1212
#define NRFX_CONFIG_API_VER_MINOR 8
1313
#define NRFX_CONFIG_API_VER_MICRO 0
1414

15+
/* Macros used in zephyr-specific config files. */
16+
#include "nrfx_zephyr_utils.h"
17+
1518
/* Define nrfx configuration based on Zephyrs KConfigs. */
1619
#include "nrfx_kconfig.h"
1720

21+
/* Define resources reserved outside nrfx scope. */
22+
#ifdef CONFIG_NRFX_RESERVED_RESOURCES_HEADER
23+
#include CONFIG_NRFX_RESERVED_RESOURCES_HEADER
24+
#endif
25+
26+
/* Include babble-sim configuration. */
27+
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
28+
#include "nrfx_config_bsim.h"
29+
#endif
30+
1831
/* Use defaults for undefined symbols. */
1932
#include <templates/nrfx_config_common.h>
2033
#if defined(NRF51)

modules/hal_nordic/nrfx/nrfx_glue.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,6 @@ void nrfx_busy_wait(uint32_t usec_to_wait);
312312
(void)size; \
313313
} while (0)
314314

315-
/*------------------------------------------------------------------------------*/
316-
317-
#ifdef CONFIG_NRFX_RESERVED_RESOURCES_HEADER
318-
#include CONFIG_NRFX_RESERVED_RESOURCES_HEADER
319-
#endif
320-
321-
//------------------------------------------------------------------------------
322-
323315
/**
324316
* @brief Function helping to integrate nrfx IRQ handlers with IRQ_CONNECT.
325317
*

modules/hal_nordic/nrfx/nrfx_kconfig.h

Lines changed: 14 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
#ifndef NRFX_KCONFIG_H__
88
#define NRFX_KCONFIG_H__
99

10-
#include <zephyr/devicetree.h>
11-
#include <zephyr/sys/util_macro.h>
12-
1310
/*
1411
* These are mappings of Kconfig options enabling nrfx drivers and particular
1512
* peripheral instances to the corresponding symbols used inside of nrfx.
@@ -967,85 +964,31 @@
967964
CONFIG_NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE
968965
#endif
969966

970-
#if defined(CONFIG_SOC_SERIES_BSIM_NRFXX)
971-
#include "nrfx_config_bsim.h"
967+
#ifdef CONFIG_SOC_NRF54LX_SKIP_CLOCK_CONFIG
968+
#define NRF_SKIP_CLOCK_CONFIGURATION
972969
#endif
973970

974-
/*
975-
* For chips with TrustZone support, MDK provides CMSIS-Core peripheral
976-
* accessing symbols in two flavors, with secure and non-secure base address
977-
* mappings. Their names contain the suffix _S or _NS, respectively.
978-
* Because nrfx HALs and drivers require these peripheral accessing symbols
979-
* without any suffixes, the following macro is provided that will translate
980-
* their names according to the kind of the target that is built.
981-
*/
982-
#if defined(NRF_TRUSTZONE_NONSECURE)
983-
#define NRF_PERIPH(P) P##_NS
984-
#else
985-
#define NRF_PERIPH(P) P##_S
971+
#ifdef CONFIG_SOC_NRF54LX_DISABLE_FICR_TRIMCNF
972+
#define NRF_DISABLE_FICR_TRIMCNF
986973
#endif
987974

988-
#define NRFX_CONFIG_BIT_DT(node_id, prop, idx) BIT(DT_PROP_BY_IDX(node_id, prop, idx))
989-
#define NRFX_CONFIG_MASK_DT(node_id, prop) \
990-
(COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
991-
(DT_FOREACH_PROP_ELEM_SEP(node_id, prop, NRFX_CONFIG_BIT_DT, (|))), \
992-
(0)))
975+
#ifdef CONFIG_SOC_NRF54LX_SKIP_GLITCHDETECTOR_DISABLE
976+
#define NRF_SKIP_GLITCHDETECTOR_DISABLE
977+
#endif
993978

994-
/* If the GRTC system timer driver is to be used, prepare definitions required
995-
* by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and
996-
* NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree.
997-
*/
998-
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc)
999-
#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \
1000-
(NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \
1001-
~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels))
1002-
#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \
1003-
(DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \
1004-
DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0))
1005-
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */
1006-
1007-
/* If global of local DPPIC peripherals are used, provide the following macro
1008-
* definitions required by the interconnect/apb layer:
1009-
* - NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
1010-
* - NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
1011-
* - NRFX_DPPI_PUB_OR_SUB_MASK(inst_num)
1012-
* - NRFX_DPPI_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num)
1013-
* - NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE
1014-
* - NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE
1015-
* based on information from devicetree.
979+
/*
980+
* Inject code to skip TAMPC setup for nRF54L20 and nRF54L09. It is not supported for now.
981+
* It needs to be removed when support is provided.
1016982
*/
983+
#if defined(CONFIG_SOC_NRF54L20_ENGA_CPUAPP) || defined(CONFIG_SOC_NRF54L09_ENGA_CPUAPP)
984+
#define NRF_SKIP_TAMPC_SETUP
985+
#endif
986+
1017987
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || \
1018988
DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_local)
1019989
#ifndef NRFX_DPPI_ENABLED
1020990
#define NRFX_DPPI_ENABLED 1
1021991
#endif
1022-
/* Source (publish) channels masks generation. */
1023-
#define NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
1024-
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels)
1025-
1026-
/* Sink (subscribe) channels masks generation. */
1027-
#define NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
1028-
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels)
1029-
1030-
#define NRFX_DPPI_PUB_OR_SUB_MASK(inst_num) \
1031-
UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels), \
1032-
DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels))
1033-
1034-
/* Variables names generation. */
1035-
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) _CONCAT(_CONCAT(m_, node_id), _channels)
1036-
#define NRFX_DPPI_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num) \
1037-
NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(DT_NODELABEL(_CONCAT(dppic, inst_num)))
1038-
1039-
/* Variables entries generation. */
1040-
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY(node_id) \
1041-
static nrfx_atomic_t NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) \
1042-
__attribute__((used)) = \
1043-
NRFX_CONFIG_MASK_DT(node_id, source_channels) | \
1044-
NRFX_CONFIG_MASK_DT(node_id, sink_channels);
1045-
#define NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE \
1046-
DT_FOREACH_STATUS_OKAY(nordic_nrf_dppic_global, NRFX_CONFIG_DPPI_CHANNELS_ENTRY)
1047-
#define NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE \
1048-
DT_FOREACH_STATUS_OKAY(nordic_nrf_dppic_local, NRFX_CONFIG_DPPI_CHANNELS_ENTRY)
1049992
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || ... */
1050993

1051994
/* If local or global DPPIC peripherals are used, provide the following macro

modules/hal_nordic/nrfx/nrfx_reserved_resources.h

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@
3131
*/
3232
#define NRFX_TIMERS_USED 0
3333

34+
/* If the GRTC system timer driver is to be used, prepare definitions required
35+
* by the nrfx_grtc driver (NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK and
36+
* NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS) based on information from devicetree.
37+
*/
38+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc)
39+
#define NRFX_GRTC_CONFIG_ALLOWED_CC_CHANNELS_MASK \
40+
(NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), owned_channels) & \
41+
~NRFX_CONFIG_MASK_DT(DT_INST(0, nordic_nrf_grtc), child_owned_channels))
42+
#define NRFX_GRTC_CONFIG_NUM_OF_CC_CHANNELS \
43+
(DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), owned_channels, 0) - \
44+
DT_PROP_LEN_OR(DT_INST(0, nordic_nrf_grtc), child_owned_channels, 0))
45+
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_grtc) */
46+
3447
/*
3548
* The enabled Bluetooth controller subsystem is responsible for providing
3649
* definitions of the BT_CTLR_USED_* symbols used below in a file named
@@ -40,34 +53,32 @@
4053
*/
4154
#if defined(CONFIG_BT_LL_SW_SPLIT)
4255
#include <bt_ctlr_used_resources.h>
43-
#if defined(DPPI_PRESENT)
44-
#if defined(NRF53_SERIES)
56+
#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X)
57+
#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS
58+
#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS
59+
#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X)
4560
#define NRFX_DPPI0_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS
4661
#define NRFX_DPPI0_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS
47-
#elif defined(NRF54L_SERIES)
62+
#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX)
4863
#define NRFX_DPPI10_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS
4964
#define NRFX_DPPI10_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS
5065
#endif
51-
#else /* defined(DPPI_PRESENT) */
52-
#define NRFX_PPI_CHANNELS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_CHANNELS
53-
#define NRFX_PPI_GROUPS_USED_BY_BT_CTLR BT_CTLR_USED_PPI_GROUPS
54-
#endif /* defined(DPPI_PRESENT) */
5566
#endif /* defined(CONFIG_BT_LL_SW_SPLIT) */
5667

5768
#if defined(CONFIG_NRF_802154_RADIO_DRIVER)
58-
#if defined(NRF52_SERIES)
69+
#if defined(CONFIG_SOC_COMPATIBLE_NRF52X)
5970
#include <../src/nrf_802154_peripherals_nrf52.h>
6071
#define NRFX_PPI_CHANNELS_USED_BY_802154_DRV NRF_802154_PPI_CHANNELS_USED_MASK
6172
#define NRFX_PPI_GROUPS_USED_BY_802154_DRV NRF_802154_PPI_GROUPS_USED_MASK
62-
#elif defined(NRF53_SERIES)
73+
#elif defined(CONFIG_SOC_COMPATIBLE_NRF53X)
6374
#include <../src/nrf_802154_peripherals_nrf53.h>
6475
#define NRFX_DPPI0_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK
6576
#define NRFX_DPPI0_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK
66-
#elif defined(NRF54L_SERIES)
77+
#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX)
6778
#include <../src/nrf_802154_peripherals_nrf54l.h>
6879
#define NRFX_DPPI10_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK
6980
#define NRFX_DPPI10_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK
70-
#elif defined(NRF54H_SERIES)
81+
#elif defined(CONFIG_SOC_SERIES_NRF54HX)
7182
#include <../src/nrf_802154_peripherals_nrf54h.h>
7283
#define NRFX_DPPI020_CHANNELS_USED_BY_802154_DRV NRF_802154_DPPI_CHANNELS_USED_MASK
7384
#define NRFX_DPPI020_GROUPS_USED_BY_802154_DRV NRF_802154_DPPI_GROUPS_USED_MASK
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/*
2+
* Copyright (c) 2024, Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef NRFX_ZEPHYR_UTILS_H__
8+
#define NRFX_ZEPHYR_UTILS_H__
9+
10+
#include <zephyr/devicetree.h>
11+
#include <zephyr/sys/util_macro.h>
12+
13+
/*
14+
* For chips with TrustZone support, MDK provides CMSIS-Core peripheral
15+
* accessing symbols in two flavors, with secure and non-secure base address
16+
* mappings. Their names contain the suffix _S or _NS, respectively.
17+
* Because nrfx HALs and drivers require these peripheral accessing symbols
18+
* without any suffixes, the following macro is provided that will translate
19+
* their names according to the kind of the target that is built.
20+
*/
21+
#if defined(NRF_TRUSTZONE_NONSECURE)
22+
#define NRF_PERIPH(P) P##_NS
23+
#else
24+
#define NRF_PERIPH(P) P##_S
25+
#endif
26+
27+
#define NRFX_CONFIG_BIT_DT(node_id, prop, idx) BIT(DT_PROP_BY_IDX(node_id, prop, idx))
28+
#define NRFX_CONFIG_MASK_DT(node_id, prop) \
29+
(COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
30+
(DT_FOREACH_PROP_ELEM_SEP(node_id, prop, NRFX_CONFIG_BIT_DT, (|))), \
31+
(0)))
32+
33+
/* If global of local DPPIC peripherals are used, provide the following macro
34+
* definitions required by the interconnect/apb layer:
35+
* - NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
36+
* - NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
37+
* - NRFX_DPPI_PUB_OR_SUB_MASK(inst_num)
38+
* - NRFX_DPPI_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num)
39+
* - NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE
40+
* - NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE
41+
* based on information from devicetree.
42+
*/
43+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || \
44+
DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_local)
45+
/* Source (publish) channels masks generation. */
46+
#define NRFX_DPPI_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
47+
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels)
48+
49+
/* Sink (subscribe) channels masks generation. */
50+
#define NRFX_DPPI_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
51+
NRFX_CONFIG_MASK_DT(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels)
52+
53+
#define NRFX_DPPI_PUB_OR_SUB_MASK(inst_num) \
54+
UTIL_OR(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), source_channels), \
55+
DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(dppic, inst_num)), sink_channels))
56+
57+
/* Variables names generation. */
58+
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) _CONCAT(_CONCAT(m_, node_id), _channels)
59+
#define NRFX_DPPI_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num) \
60+
NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(DT_NODELABEL(_CONCAT(dppic, inst_num)))
61+
62+
/* Variables entries generation. */
63+
#define NRFX_CONFIG_DPPI_CHANNELS_ENTRY(node_id) \
64+
static nrfx_atomic_t NRFX_CONFIG_DPPI_CHANNELS_ENTRY_NAME(node_id) \
65+
__attribute__((used)) = \
66+
NRFX_CONFIG_MASK_DT(node_id, source_channels) | \
67+
NRFX_CONFIG_MASK_DT(node_id, sink_channels);
68+
#define NRFX_INTERCONNECT_APB_GLOBAL_DPPI_DEFINE \
69+
DT_FOREACH_STATUS_OKAY(nordic_nrf_dppic_global, NRFX_CONFIG_DPPI_CHANNELS_ENTRY)
70+
#define NRFX_INTERCONNECT_APB_LOCAL_DPPI_DEFINE \
71+
DT_FOREACH_STATUS_OKAY(nordic_nrf_dppic_local, NRFX_CONFIG_DPPI_CHANNELS_ENTRY)
72+
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_dppic_global) || ... */
73+
74+
/* If local or global DPPIC peripherals are used, provide the following macro
75+
* definitions required by the interconnect/ipct layer:
76+
* - NRFX_IPCTx_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
77+
* - NRFX_IPCTx_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num)
78+
* - NRFX_IPCT_PUB_OR_SUB_MASK(inst_num)
79+
* - NRFX_IPCTx_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num)
80+
* - NRFX_INTERCONNECT_IPCT_GLOBAL_DEFINE
81+
* - NRFX_INTERCONNECT_IPCT_LOCAL_DEFINE
82+
* based on information from devicetree.
83+
*/
84+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_ipct_global) || \
85+
DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_ipct_local)
86+
/* Channels masks generation. */
87+
#define NRFX_CONFIG_IPCT_MASK_DT(node_id) \
88+
COND_CODE_1(DT_NODE_HAS_PROP(node_id, owned_channels), \
89+
(NRFX_CONFIG_MASK_DT(node_id, owned_channels)), \
90+
(COND_CODE_1(DT_NODE_HAS_COMPAT(node_id, nordic_nrf_ipct_local), \
91+
(BIT_MASK(DT_PROP(node_id, channels))), (0))))
92+
93+
#if defined(NRF_APPLICATION)
94+
#define NRFX_CONFIG_IPCT_LOCAL_NODE DT_NODELABEL(cpuapp_ipct)
95+
#elif defined(NRF_RADIOCORE)
96+
#define NRFX_CONFIG_IPCT_LOCAL_NODE DT_NODELABEL(cpurad_ipct)
97+
#endif
98+
#define NRFX_CONFIG_IPCT_NODE_BY_INST_NUM(inst_num) \
99+
COND_CODE_1(IS_EMPTY(inst_num), \
100+
(NRFX_CONFIG_IPCT_LOCAL_NODE), \
101+
(DT_NODELABEL(_CONCAT(ipct, inst_num))))
102+
103+
#define NRFX_IPCTx_PUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
104+
NRFX_CONFIG_IPCT_MASK_DT(NRFX_CONFIG_IPCT_NODE_BY_INST_NUM(inst_num))
105+
106+
#define NRFX_IPCTx_SUB_CONFIG_ALLOWED_CHANNELS_MASK_BY_INST_NUM(inst_num) \
107+
NRFX_CONFIG_IPCT_MASK_DT(NRFX_CONFIG_IPCT_NODE_BY_INST_NUM(inst_num))
108+
109+
#define NRFX_IPCT_PUB_OR_SUB_MASK(inst_num) \
110+
COND_CODE_1(IS_EMPTY(inst_num), \
111+
(DT_NODE_HAS_STATUS_OKAY(NRFX_CONFIG_IPCT_LOCAL_NODE)), \
112+
(DT_NODE_HAS_PROP(DT_NODELABEL(_CONCAT(ipct, inst_num)), owned_channels)))
113+
114+
/* Variables names generation. */
115+
#define NRFX_CONFIG_IPCT_CHANNELS_ENTRY_NAME(node_id) _CONCAT(_CONCAT(m_, node_id), _channels)
116+
#define NRFX_IPCTx_CHANNELS_SINGLE_VAR_NAME_BY_INST_NUM(inst_num) \
117+
COND_CODE_1(IS_EMPTY(inst_num), \
118+
(NRFX_CONFIG_IPCT_CHANNELS_ENTRY_NAME(NRFX_CONFIG_IPCT_LOCAL_NODE)), \
119+
(NRFX_CONFIG_IPCT_CHANNELS_ENTRY_NAME(DT_NODELABEL(_CONCAT(ipct, inst_num)))))
120+
121+
/* Variables entries generation. */
122+
#define NRFX_CONFIG_IPCT_CHANNELS_ENTRY(node_id) \
123+
static nrfx_atomic_t NRFX_CONFIG_IPCT_CHANNELS_ENTRY_NAME(node_id) \
124+
__attribute__((used)) = \
125+
NRFX_CONFIG_IPCT_MASK_DT(node_id);
126+
#define NRFX_INTERCONNECT_IPCT_LOCAL_DEFINE \
127+
DT_FOREACH_STATUS_OKAY(nordic_nrf_ipct_local, NRFX_CONFIG_IPCT_CHANNELS_ENTRY)
128+
#define NRFX_INTERCONNECT_IPCT_GLOBAL_DEFINE \
129+
DT_FOREACH_STATUS_OKAY(nordic_nrf_ipct_global, NRFX_CONFIG_IPCT_CHANNELS_ENTRY)
130+
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_ipct_global) || ... */
131+
132+
#endif /* NRFX_ZEPHYR_UTILS_H__ */

subsys/bluetooth/controller/ll_sw/nordic/hal/nrf5/nrfx_glue/bt_ctlr_used_resources.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* conditionally compile them based on feature Kconfig defines in those
1313
* resources header file.
1414
*/
15-
#ifdef DPPI_PRESENT
16-
#include "../radio/radio_nrf5_dppi_resources.h"
17-
#else
15+
#if defined(CONFIG_SOC_SERIES_NRF51X) || defined(CONFIG_SOC_COMPATIBLE_NRF52X)
1816
#include "../radio/radio_nrf5_ppi_resources.h"
17+
#else
18+
#include "../radio/radio_nrf5_dppi_resources.h"
1919
#endif
2020

2121
/* Mask with all (D)PPI channels used by the bluetooth controller. */
@@ -78,7 +78,7 @@
7878
#endif
7979

8080
#if defined(CONFIG_BT_CTLR_DF_PHYEND_OFFSET_COMPENSATION_ENABLE)
81-
#ifdef DPPI_PRESENT
81+
#if !defined(CONFIG_SOC_SERIES_NRF51X) && !defined(CONFIG_SOC_COMPATIBLE_NRF52X)
8282
#define HAL_USED_PPI_CHANNELS_7 \
8383
(BIT(HAL_SW_SWITCH_TIMER_PHYEND_DELAY_COMPENSATION_DISABLE_PPI))
8484
#else

0 commit comments

Comments
 (0)