Skip to content

Commit c08964a

Browse files
joerchancarlescufi
authored andcommitted
soc: nrf5340: Produce a Kconfig error when GPIO cannot be forwarded
Make Kconfig produce an error when GPIOs cannot be forwarded in the current configuration instead of silently excluding the forwarding. Signed-off-by: Joakim Andersson <[email protected]>
1 parent 1432d05 commit c08964a

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

boards/arm/bl5340_dvk/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ config BT_HCI_VS
3939

4040
config BOARD_ENABLE_CPUNET
4141
bool "NRF53 Network MCU"
42+
select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \
43+
$(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER))
4244
help
4345
This option enables releasing the Network 'force off' signal, which
4446
as a consequence will power up the Network MCU during system boot.

boards/arm/nrf5340dk_nrf5340/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ config BOARD_ENABLE_DCDC_HV
2222

2323
config BOARD_ENABLE_CPUNET
2424
bool "NRF53 Network MCU"
25+
select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \
26+
$(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER))
2527
help
2628
This option enables releasing the Network 'force off' signal, which
2729
as a consequence will power up the Network MCU during system boot.

boards/arm/thingy53_nrf5340/Kconfig

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ config BOARD_ENABLE_DCDC_HV
3434

3535
config BOARD_ENABLE_CPUNET
3636
bool "NRF53 Network MCU"
37+
select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \
38+
$(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER))
3739
help
3840
This option enables releasing the Network 'force off' signal, which
3941
as a consequence will power up the Network MCU during system boot.

soc/arm/nordic_nrf/nrf53/Kconfig.soc

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ config SOC_DCDC_NRF53X_HV
4545
help
4646
Enable nRF53 series System on Chip High Voltage DC/DC converter.
4747

48+
config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340
49+
bool
50+
depends on NRF_SOC_SECURE_SUPPORTED
51+
help
52+
hidden option for including the nRF GPIO pin forwarding
53+
4854
if !TRUSTED_EXECUTION_NONSECURE || BUILD_WITH_TFM
4955

5056
config SOC_ENABLE_LFXO

soc/arm/nordic_nrf/nrf53/soc.c

+2-8
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,7 @@ extern void z_arm_nmi_init(void);
5151
#error "Unknown nRF53 SoC."
5252
#endif
5353

54-
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_forwarder) && \
55-
defined(CONFIG_BOARD_ENABLE_CPUNET) && \
56-
(!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM))
57-
#define NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED
58-
#endif
59-
60-
#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED)
54+
#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340)
6155
#define GPIOS_PSEL_BY_IDX(node_id, prop, idx) \
6256
NRF_DT_GPIOS_TO_PSEL_BY_IDX(node_id, prop, idx),
6357
#define ALL_GPIOS_IN_NODE(node_id) \
@@ -169,7 +163,7 @@ static int nordicsemi_nrf53_init(const struct device *arg)
169163
nrf_regulators_dcdcen_vddh_set(NRF_REGULATORS, true);
170164
#endif
171165

172-
#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED)
166+
#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340)
173167
static const uint8_t forwarded_psels[] = {
174168
DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio_forwarder, ALL_GPIOS_IN_FORWARDER)
175169
};

0 commit comments

Comments
 (0)