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 <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2022-09-28 15:33:52 +02:00 committed by Carles Cufí
parent 1432d05c29
commit c08964afd5
5 changed files with 14 additions and 8 deletions

View file

@ -39,6 +39,8 @@ config BT_HCI_VS
config BOARD_ENABLE_CPUNET
bool "NRF53 Network MCU"
select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \
$(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER))
help
This option enables releasing the Network 'force off' signal, which
as a consequence will power up the Network MCU during system boot.

View file

@ -22,6 +22,8 @@ config BOARD_ENABLE_DCDC_HV
config BOARD_ENABLE_CPUNET
bool "NRF53 Network MCU"
select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \
$(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER))
help
This option enables releasing the Network 'force off' signal, which
as a consequence will power up the Network MCU during system boot.

View file

@ -34,6 +34,8 @@ config BOARD_ENABLE_DCDC_HV
config BOARD_ENABLE_CPUNET
bool "NRF53 Network MCU"
select SOC_NRF_GPIO_FORWARDER_FOR_NRF5340 if \
$(dt_compat_enabled,$(DT_COMPAT_NORDIC_NRF_GPIO_FORWARDER))
help
This option enables releasing the Network 'force off' signal, which
as a consequence will power up the Network MCU during system boot.

View file

@ -45,6 +45,12 @@ config SOC_DCDC_NRF53X_HV
help
Enable nRF53 series System on Chip High Voltage DC/DC converter.
config SOC_NRF_GPIO_FORWARDER_FOR_NRF5340
bool
depends on NRF_SOC_SECURE_SUPPORTED
help
hidden option for including the nRF GPIO pin forwarding
if !TRUSTED_EXECUTION_NONSECURE || BUILD_WITH_TFM
config SOC_ENABLE_LFXO

View file

@ -51,13 +51,7 @@ extern void z_arm_nmi_init(void);
#error "Unknown nRF53 SoC."
#endif
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrf_gpio_forwarder) && \
defined(CONFIG_BOARD_ENABLE_CPUNET) && \
(!defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM))
#define NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED
#endif
#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED)
#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340)
#define GPIOS_PSEL_BY_IDX(node_id, prop, idx) \
NRF_DT_GPIOS_TO_PSEL_BY_IDX(node_id, prop, idx),
#define ALL_GPIOS_IN_NODE(node_id) \
@ -169,7 +163,7 @@ static int nordicsemi_nrf53_init(const struct device *arg)
nrf_regulators_dcdcen_vddh_set(NRF_REGULATORS, true);
#endif
#if defined(NRF_GPIO_FORWARDER_FOR_NRF5340_CPUAPP_ENABLED)
#if defined(CONFIG_SOC_NRF_GPIO_FORWARDER_FOR_NRF5340)
static const uint8_t forwarded_psels[] = {
DT_FOREACH_STATUS_OKAY(nordic_nrf_gpio_forwarder, ALL_GPIOS_IN_FORWARDER)
};