Skip to content

Commit 4034b0f

Browse files
ananglcarlescufi
authored andcommitted
[nrf noup] drivers: pinctrl_nrf: Extend handling of SDP MSPI pins
nrf-squash! [nrf noup] drivers: pinctrl: Add SDP MSPI pin configuration Make it possible to use SDP_MSPI_* functions also in pinctrl nodes assigned to VPR cores and also for nRF54H SoCs. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent ac2957c commit 4034b0f

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

drivers/pinctrl/pinctrl_nrf.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,17 @@ static const nrf_gpio_pin_drive_t drive_modes[NRF_DRIVE_COUNT] = {
112112
#define NRF_PSEL_TDM(reg, line) ((NRF_TDM_Type *)reg)->PSEL.line
113113
#endif
114114

115-
#if defined(CONFIG_SOC_NRF54L15_CPUAPP)
116-
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller) || defined(CONFIG_MSPI_NRFE)
117-
#define NRF_PSEL_SDP_MSPI(psel) \
115+
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller) || \
116+
defined(CONFIG_MSPI_NRFE) || \
117+
DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(nordic_nrf_vpr_coprocessor, pinctrl_0)
118+
#if defined(CONFIG_SOC_SERIES_NRF54LX)
119+
#define NRF_PSEL_SDP_MSPI(psel) \
118120
nrf_gpio_pin_control_select(psel, NRF_GPIO_PIN_SEL_VPR);
121+
#elif defined(CONFIG_SOC_SERIES_NRF54HX)
122+
/* On nRF54H, pin routing is controlled by secure domain, via UICR. */
123+
#define NRF_PSEL_SDP_MSPI(psel)
119124
#endif
120-
#endif
125+
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller) || ... */
121126

122127
int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
123128
uintptr_t reg)
@@ -472,8 +477,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
472477
input = NRF_GPIO_PIN_INPUT_CONNECT;
473478
break;
474479
#endif /* defined(NRF_PSEL_TWIS) */
475-
#if defined(CONFIG_SOC_NRF54L15_CPUAPP)
476-
#if DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller)
480+
#if defined(NRF_PSEL_SDP_MSPI)
477481
case NRF_FUN_SDP_MSPI_CS0:
478482
case NRF_FUN_SDP_MSPI_CS1:
479483
case NRF_FUN_SDP_MSPI_CS2:
@@ -492,8 +496,7 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
492496
dir = NRF_GPIO_PIN_DIR_OUTPUT;
493497
input = NRF_GPIO_PIN_INPUT_CONNECT;
494498
break;
495-
#endif /* DT_HAS_COMPAT_STATUS_OKAY(nordic_nrfe_mspi_controller) */
496-
#endif /* CONFIG_SOC_NRF54L15_CPUAPP */
499+
#endif /* defined(NRF_PSEL_SDP_MSPI) */
497500
default:
498501
return -ENOTSUP;
499502
}

0 commit comments

Comments
 (0)