diff --git a/boards/arm/96b_aerocore2/96b_aerocore2.dts b/boards/arm/96b_aerocore2/96b_aerocore2.dts index 881595cfb45..5242681ec87 100644 --- a/boards/arm/96b_aerocore2/96b_aerocore2.dts +++ b/boards/arm/96b_aerocore2/96b_aerocore2.dts @@ -70,19 +70,32 @@ status = "okay"; }; +&spi1_nss_pa4 { slew-rate = "very-high-speed"; }; + &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; +&spi2_nss_pb12 { slew-rate = "very-high-speed"; }; + &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; &spi3 { + pinctrl-0 = <&spi3_sck_pc10 &spi3_miso_pc11 &spi3_mosi_pc12>; status = "okay"; }; +&spi4_nss_pe11 { slew-rate = "very-high-speed"; }; + &spi4 { + pinctrl-0 = <&spi4_nss_pe11 &spi4_sck_pe12 + &spi4_miso_pe13 &spi4_mosi_pe14>; status = "okay"; }; diff --git a/boards/arm/96b_aerocore2/pinmux.c b/boards/arm/96b_aerocore2/pinmux.c index 850f05bdfd4..d33adc9a4e6 100644 --- a/boards/arm/96b_aerocore2/pinmux.c +++ b/boards/arm/96b_aerocore2/pinmux.c @@ -14,42 +14,6 @@ /* pin assignments for board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F4_PINMUX_FUNC_PB12_SPI2_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_SPI2_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi3), okay) && CONFIG_SPI - {STM32_PIN_PC10, STM32F4_PINMUX_FUNC_PC10_SPI3_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PC11, STM32F4_PINMUX_FUNC_PC11_SPI3_MISO}, - {STM32_PIN_PC12, STM32F4_PINMUX_FUNC_PC12_SPI3_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi4), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PE11, STM32F4_PINMUX_FUNC_PE11_SPI4_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PE12, STM32F4_PINMUX_FUNC_PE12_SPI4_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PE13, STM32F4_PINMUX_FUNC_PE13_SPI4_MISO}, - {STM32_PIN_PE14, STM32F4_PINMUX_FUNC_PE14_SPI4_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/96b_argonkey/96b_argonkey.dts b/boards/arm/96b_argonkey/96b_argonkey.dts index 05ed1028d5e..4955d5fbf66 100644 --- a/boards/arm/96b_argonkey/96b_argonkey.dts +++ b/boards/arm/96b_argonkey/96b_argonkey.dts @@ -52,11 +52,19 @@ status = "okay"; }; +&spi1_nss_pa4 { slew-rate = "very-high-speed"; }; + &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; +&spi2_nss_pb12 { slew-rate = "very-high-speed"; }; + &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; /* ST Microelectronics LSM6DSL accel/gyro sensor */ diff --git a/boards/arm/96b_argonkey/pinmux.c b/boards/arm/96b_argonkey/pinmux.c index ac835489faf..b876ac6c9ae 100644 --- a/boards/arm/96b_argonkey/pinmux.c +++ b/boards/arm/96b_argonkey/pinmux.c @@ -14,26 +14,6 @@ /* pin assignments for 96boards Argonkey board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F4_PINMUX_FUNC_PB12_SPI2_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_SPI2_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(i2s5), okay) && CONFIG_I2S {STM32_PIN_PB0, STM32F4_PINMUX_FUNC_PB0_I2S5_CK}, {STM32_PIN_PB8, STM32F4_PINMUX_FUNC_PB8_I2S5_SD}, diff --git a/boards/arm/96b_carbon/96b_carbon.dts b/boards/arm/96b_carbon/96b_carbon.dts index 2cd636bd734..df4de0deceb 100644 --- a/boards/arm/96b_carbon/96b_carbon.dts +++ b/boards/arm/96b_carbon/96b_carbon.dts @@ -101,6 +101,8 @@ }; &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/96b_carbon/pinmux.c b/boards/arm/96b_carbon/pinmux.c index e1de25fc3cd..d207f14dd67 100644 --- a/boards/arm/96b_carbon/pinmux.c +++ b/boards/arm/96b_carbon/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for 96boards Carbon board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F4_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/96b_neonkey/96b_neonkey.dts b/boards/arm/96b_neonkey/96b_neonkey.dts index f957f6adf06..a3a489e01c5 100644 --- a/boards/arm/96b_neonkey/96b_neonkey.dts +++ b/boards/arm/96b_neonkey/96b_neonkey.dts @@ -87,6 +87,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/96b_neonkey/pinmux.c b/boards/arm/96b_neonkey/pinmux.c index f72d346f4be..f3f6c3f9cf0 100644 --- a/boards/arm/96b_neonkey/pinmux.c +++ b/boards/arm/96b_neonkey/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for 96boards Neonkey board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts b/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts index d9335a9a693..5dd54150062 100644 --- a/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts +++ b/boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts @@ -95,15 +95,27 @@ status = "okay"; }; +&spi1_nss_pa4 { slew-rate = "very-high-speed"; }; + &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; +&spi2_nss_pb9 { slew-rate = "very-high-speed"; }; + &spi2 { + pinctrl-0 = <&spi2_nss_pb9 &spi2_sck_pd3 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; +&spi4_nss_pe11 { slew-rate = "very-high-speed"; }; + &spi4 { + pinctrl-0 = <&spi4_nss_pe11 &spi4_sck_pe12 + &spi4_miso_pe13 &spi4_mosi_pe14>; status = "okay"; }; diff --git a/boards/arm/96b_stm32_sensor_mez/pinmux.c b/boards/arm/96b_stm32_sensor_mez/pinmux.c index ceff57681b2..c93d1e8409b 100644 --- a/boards/arm/96b_stm32_sensor_mez/pinmux.c +++ b/boards/arm/96b_stm32_sensor_mez/pinmux.c @@ -14,36 +14,6 @@ /* pin assignments for 96b_stm32_sensor_mez board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB9, STM32F4_PINMUX_FUNC_PB9_SPI2_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PD3, STM32F4_PINMUX_FUNC_PD3_SPI2_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi4), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PE11, STM32F4_PINMUX_FUNC_PE11_SPI4_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PE12, STM32F4_PINMUX_FUNC_PE12_SPI4_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PE13, STM32F4_PINMUX_FUNC_PE13_SPI4_MISO}, - {STM32_PIN_PE14, STM32F4_PINMUX_FUNC_PE14_SPI4_MOSI}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(i2s2), okay) && CONFIG_I2S {STM32_PIN_PC7, STM32F4_PINMUX_FUNC_PC7_I2S2_CK}, {STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_I2S2_SD}, diff --git a/boards/arm/96b_wistrio/96b_wistrio.dts b/boards/arm/96b_wistrio/96b_wistrio.dts index 04f7bc6e7eb..43649c1b118 100644 --- a/boards/arm/96b_wistrio/96b_wistrio.dts +++ b/boards/arm/96b_wistrio/96b_wistrio.dts @@ -63,6 +63,7 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; cs-gpios = <&gpiob 0 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/96b_wistrio/pinmux.c b/boards/arm/96b_wistrio/pinmux.c index c250aa00fe6..068d12a8196 100644 --- a/boards/arm/96b_wistrio/pinmux.c +++ b/boards/arm/96b_wistrio/pinmux.c @@ -14,12 +14,6 @@ #include static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L1X_PINMUX_FUNC_PA5_SPI1_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PA6, STM32L1X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L1X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif /* RF_CTX_PA */ {STM32_PIN_PA4, STM32_PUSHPULL_PULLUP}, /* RF_CRX_RX */ diff --git a/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts b/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts index 7bbb280806e..64995232edb 100644 --- a/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts +++ b/boards/arm/adafruit_feather_stm32f405/adafruit_feather_stm32f405.dts @@ -46,7 +46,11 @@ clock-frequency = ; }; +&spi1_nss_pa15 { slew-rate = "very-high-speed"; }; + &spi1 { + pinctrl-0 = <&spi1_nss_pa15 &spi1_sck_pb3 + &spi1_miso_pb4 &spi1_mosi_pb5>; status = "okay"; cs-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>; gd25q16: gd25q16c@0 { @@ -64,6 +68,7 @@ }; &spi2 { + pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/adafruit_feather_stm32f405/pinmux.c b/boards/arm/adafruit_feather_stm32f405/pinmux.c index 81cf4f35b1a..f82b6c3f2b8 100644 --- a/boards/arm/adafruit_feather_stm32f405/pinmux.c +++ b/boards/arm/adafruit_feather_stm32f405/pinmux.c @@ -14,21 +14,6 @@ /* pin assignments for Feather STM32F405 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA15, STM32F4_PINMUX_FUNC_PA15_SPI1_NSS | - STM32_OSPEEDR_VERY_HIGH_SPEED}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_SPI1_SCK | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PB5, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts b/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts index 5b650a4baa9..c359f48740c 100644 --- a/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts +++ b/boards/arm/b_l072z_lrwan1/b_l072z_lrwan1.dts @@ -76,6 +76,8 @@ arduino_i2c: &i2c1 {}; }; &spi1 { + pinctrl-0 = <&spi1_nss_pa15 &spi1_sck_pb3 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; cs-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>; @@ -100,6 +102,8 @@ arduino_i2c: &i2c1 {}; }; &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/b_l072z_lrwan1/pinmux.c b/boards/arm/b_l072z_lrwan1/pinmux.c index de9c406af61..2b22591fc1d 100644 --- a/boards/arm/b_l072z_lrwan1/pinmux.c +++ b/boards/arm/b_l072z_lrwan1/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for STMicroelectronics B-L072Z-LRWAN1 Discovery board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA15, STM32L0_PINMUX_FUNC_PA15_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB3, STM32L0_PINMUX_FUNC_PB3_SPI1_SCK}, - {STM32_PIN_PA6, STM32L0_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L0_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32L0_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32L0_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32L0_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32L0_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32L0_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32L0_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts index 0a1c09ffbed..1df9b8b9c23 100644 --- a/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts +++ b/boards/arm/b_l4s5i_iot01a/b_l4s5i_iot01a.dts @@ -102,10 +102,12 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; &spi3 { + pinctrl-0 = <&spi3_sck_pc10 &spi3_miso_pc11 &spi3_mosi_pc12>; status = "okay"; cs-gpios = <&gpiod 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>, diff --git a/boards/arm/b_l4s5i_iot01a/pinmux.c b/boards/arm/b_l4s5i_iot01a/pinmux.c index d2c5c6fdb39..c4dce371bd2 100644 --- a/boards/arm/b_l4s5i_iot01a/pinmux.c +++ b/boards/arm/b_l4s5i_iot01a/pinmux.c @@ -14,18 +14,6 @@ /* pin assignments for B_L4S5I_IOT01A board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi3), okay) && CONFIG_SPI - /* SPI3 is used for BT/WIFI, Sub GHZ communication */ - {STM32_PIN_PC10, STM32L4X_PINMUX_FUNC_PC10_SPI3_SCK}, - {STM32_PIN_PC11, STM32L4X_PINMUX_FUNC_PC11_SPI3_MISO | \ - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PC12, STM32L4X_PINMUX_FUNC_PC12_SPI3_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA10, STM32L4X_PINMUX_FUNC_PA10_OTG_FS_ID}, {STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM}, diff --git a/boards/arm/black_f407ve/black_f407ve.dts b/boards/arm/black_f407ve/black_f407ve.dts index 6d7e6c845b0..1e87b88ef67 100644 --- a/boards/arm/black_f407ve/black_f407ve.dts +++ b/boards/arm/black_f407ve/black_f407ve.dts @@ -98,6 +98,7 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pb3 &spi1_miso_pb4 &spi1_mosi_pb5>; status = "okay"; cs-gpios = <&gpiob 0 GPIO_ACTIVE_LOW>; w25q16cv: w25q16cv@0 { @@ -115,5 +116,6 @@ }; &spi2 { + pinctrl-0 = <&spi2_sck_pb10 &spi2_miso_pc2 &spi2_mosi_pc3>; status = "okay"; }; diff --git a/boards/arm/black_f407ve/pinmux.c b/boards/arm/black_f407ve/pinmux.c index a55ffe1cbf1..16640d70373 100644 --- a/boards/arm/black_f407ve/pinmux.c +++ b/boards/arm/black_f407ve/pinmux.c @@ -18,16 +18,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_SPI1_SCK}, - {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_SPI1_MISO}, - {STM32_PIN_PB5, STM32F4_PINMUX_FUNC_PB5_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_SPI2_SCK}, - {STM32_PIN_PC2, STM32F4_PINMUX_FUNC_PC2_SPI2_MISO}, - {STM32_PIN_PC3, STM32F4_PINMUX_FUNC_PC3_SPI2_MOSI}, -#endif }; static int pinmux_black_f407ve_init(const struct device *port) diff --git a/boards/arm/black_f407zg_pro/black_f407zg_pro.dts b/boards/arm/black_f407zg_pro/black_f407zg_pro.dts index da7fdb2bce4..f7976d4b930 100644 --- a/boards/arm/black_f407zg_pro/black_f407zg_pro.dts +++ b/boards/arm/black_f407zg_pro/black_f407zg_pro.dts @@ -98,5 +98,6 @@ }; &spi2 { + pinctrl-0 = <&spi2_sck_pb10 &spi2_miso_pc2 &spi2_mosi_pc3>; status = "okay"; }; diff --git a/boards/arm/black_f407zg_pro/pinmux.c b/boards/arm/black_f407zg_pro/pinmux.c index 5167ee31c58..9e40c1a2df5 100644 --- a/boards/arm/black_f407zg_pro/pinmux.c +++ b/boards/arm/black_f407zg_pro/pinmux.c @@ -18,16 +18,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PB3, STM32F4_PINMUX_FUNC_PB3_SPI1_SCK}, - {STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_SPI1_MISO}, - {STM32_PIN_PB5, STM32F4_PINMUX_FUNC_PB5_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - {STM32_PIN_PB10, STM32F4_PINMUX_FUNC_PB10_SPI2_SCK}, - {STM32_PIN_PC2, STM32F4_PINMUX_FUNC_PC2_SPI2_MISO}, - {STM32_PIN_PC3, STM32F4_PINMUX_FUNC_PC3_SPI2_MOSI}, -#endif }; diff --git a/boards/arm/blackpill_f411ce/blackpill_f411ce.dts b/boards/arm/blackpill_f411ce/blackpill_f411ce.dts index cde5671118b..db56ae5599a 100644 --- a/boards/arm/blackpill_f411ce/blackpill_f411ce.dts +++ b/boards/arm/blackpill_f411ce/blackpill_f411ce.dts @@ -100,6 +100,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_nss_pa4 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/blackpill_f411ce/pinmux.c b/boards/arm/blackpill_f411ce/pinmux.c index 593188963c7..f785352cc5c 100644 --- a/boards/arm/blackpill_f411ce/pinmux.c +++ b/boards/arm/blackpill_f411ce/pinmux.c @@ -14,15 +14,6 @@ /* pin assignments for Black Pill V2.0 board */ static const struct pin_config pinconf[] = { -#if (DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI) -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - /* V2.0 routes flash DO to PB4, V2.1+ uses PA6 */ - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts index 61f9c975481..6df0a3b18d8 100644 --- a/boards/arm/disco_l475_iot1/disco_l475_iot1.dts +++ b/boards/arm/disco_l475_iot1/disco_l475_iot1.dts @@ -118,6 +118,7 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/disco_l475_iot1/pinmux.c b/boards/arm/disco_l475_iot1/pinmux.c index 8279b3c3428..9b7279109f9 100644 --- a/boards/arm/disco_l475_iot1/pinmux.c +++ b/boards/arm/disco_l475_iot1/pinmux.c @@ -14,11 +14,6 @@ /* pin assignments for Disco L475 IOT1 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA10, STM32L4X_PINMUX_FUNC_PA10_OTG_FS_ID}, {STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM}, diff --git a/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts b/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts index b6729c3e2c3..c23a14afa93 100644 --- a/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts +++ b/boards/arm/mikroe_mini_m4_for_stm32/mikroe_mini_m4_for_stm32.dts @@ -50,6 +50,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c b/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c index 6841c60a46b..1bb57bd7552 100644 --- a/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c +++ b/boards/arm/mikroe_mini_m4_for_stm32/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for MINI-M4 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/nucleo_f030r8/nucleo_f030r8.dts b/boards/arm/nucleo_f030r8/nucleo_f030r8.dts index 90cb098dd6f..b319456a3e9 100644 --- a/boards/arm/nucleo_f030r8/nucleo_f030r8.dts +++ b/boards/arm/nucleo_f030r8/nucleo_f030r8.dts @@ -72,10 +72,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/nucleo_f030r8/pinmux.c b/boards/arm/nucleo_f030r8/pinmux.c index 7af1994d4fb..36753f234ef 100644 --- a/boards/arm/nucleo_f030r8/pinmux.c +++ b/boards/arm/nucleo_f030r8/pinmux.c @@ -15,22 +15,6 @@ /* pin assignments for NUCLEO-F030R8 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F0_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F0_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F0_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F0_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F0_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F0_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F0_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F0_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f070rb/nucleo_f070rb.dts b/boards/arm/nucleo_f070rb/nucleo_f070rb.dts index 2231ea70421..ae16d8fdb16 100644 --- a/boards/arm/nucleo_f070rb/nucleo_f070rb.dts +++ b/boards/arm/nucleo_f070rb/nucleo_f070rb.dts @@ -67,10 +67,12 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/nucleo_f070rb/pinmux.c b/boards/arm/nucleo_f070rb/pinmux.c index 546b26e27fd..595f453f154 100644 --- a/boards/arm/nucleo_f070rb/pinmux.c +++ b/boards/arm/nucleo_f070rb/pinmux.c @@ -15,16 +15,6 @@ /* pin assignments for NUCLEO_F070RB board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32F0_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F0_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F0_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - {STM32_PIN_PB13, STM32F0_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F0_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F0_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f091rc/nucleo_f091rc.dts b/boards/arm/nucleo_f091rc/nucleo_f091rc.dts index f88c32f811f..55b7c1912d7 100644 --- a/boards/arm/nucleo_f091rc/nucleo_f091rc.dts +++ b/boards/arm/nucleo_f091rc/nucleo_f091rc.dts @@ -66,10 +66,12 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/nucleo_f091rc/pinmux.c b/boards/arm/nucleo_f091rc/pinmux.c index 18b4e910c26..447777c867a 100644 --- a/boards/arm/nucleo_f091rc/pinmux.c +++ b/boards/arm/nucleo_f091rc/pinmux.c @@ -14,16 +14,6 @@ /* pin assignments for NUCLEO-F091RC board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32F0_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F0_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F0_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - {STM32_PIN_PB13, STM32F0_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F0_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F0_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f103rb/nucleo_f103rb.dts b/boards/arm/nucleo_f103rb/nucleo_f103rb.dts index 16a9fad9ae1..f6068ec2fce 100644 --- a/boards/arm/nucleo_f103rb/nucleo_f103rb.dts +++ b/boards/arm/nucleo_f103rb/nucleo_f103rb.dts @@ -59,10 +59,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5 + &spi1_miso_master_pa6 &spi1_mosi_master_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13 + &spi2_miso_master_pb14 &spi2_mosi_master_pb15>; status = "okay"; }; diff --git a/boards/arm/nucleo_f103rb/pinmux.c b/boards/arm/nucleo_f103rb/pinmux.c index 2353b196cc8..60a40c4c4db 100644 --- a/boards/arm/nucleo_f103rb/pinmux.c +++ b/boards/arm/nucleo_f103rb/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for NUCLEO-F103RB board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F1_PINMUX_FUNC_PA5_SPI1_MASTER_SCK}, - {STM32_PIN_PA6, STM32F1_PINMUX_FUNC_PA6_SPI1_MASTER_MISO}, - {STM32_PIN_PA7, STM32F1_PINMUX_FUNC_PA7_SPI1_MASTER_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F1_PINMUX_FUNC_PB12_SPI2_MASTER_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F1_PINMUX_FUNC_PB13_SPI2_MASTER_SCK}, - {STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO}, - {STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f302r8/nucleo_f302r8.dts b/boards/arm/nucleo_f302r8/nucleo_f302r8.dts index c28e0b2a4db..5e039e8addf 100644 --- a/boards/arm/nucleo_f302r8/nucleo_f302r8.dts +++ b/boards/arm/nucleo_f302r8/nucleo_f302r8.dts @@ -49,6 +49,8 @@ }; &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/nucleo_f302r8/pinmux.c b/boards/arm/nucleo_f302r8/pinmux.c index b7520f4fa84..8ea79d0eb6a 100644 --- a/boards/arm/nucleo_f302r8/pinmux.c +++ b/boards/arm/nucleo_f302r8/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for NUCLEO-F302R8 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f334r8/nucleo_f334r8.dts b/boards/arm/nucleo_f334r8/nucleo_f334r8.dts index 15b7c29e819..8cf2d587a8a 100644 --- a/boards/arm/nucleo_f334r8/nucleo_f334r8.dts +++ b/boards/arm/nucleo_f334r8/nucleo_f334r8.dts @@ -66,6 +66,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_f334r8/pinmux.c b/boards/arm/nucleo_f334r8/pinmux.c index 4a118645a49..884c0658754 100644 --- a/boards/arm/nucleo_f334r8/pinmux.c +++ b/boards/arm/nucleo_f334r8/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for NUCLEO-F334RB board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f401re/nucleo_f401re.dts b/boards/arm/nucleo_f401re/nucleo_f401re.dts index 4c71c6c29a5..69efd5fcde8 100644 --- a/boards/arm/nucleo_f401re/nucleo_f401re.dts +++ b/boards/arm/nucleo_f401re/nucleo_f401re.dts @@ -71,10 +71,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/nucleo_f401re/pinmux.c b/boards/arm/nucleo_f401re/pinmux.c index 0093687da2a..ba612148cab 100644 --- a/boards/arm/nucleo_f401re/pinmux.c +++ b/boards/arm/nucleo_f401re/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for NUCLEO-F401RE board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F4_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f411re/nucleo_f411re.dts b/boards/arm/nucleo_f411re/nucleo_f411re.dts index dc6113dace0..8261b6bcfce 100644 --- a/boards/arm/nucleo_f411re/nucleo_f411re.dts +++ b/boards/arm/nucleo_f411re/nucleo_f411re.dts @@ -71,6 +71,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_f411re/pinmux.c b/boards/arm/nucleo_f411re/pinmux.c index 744e3b6844e..30bb07870d5 100644 --- a/boards/arm/nucleo_f411re/pinmux.c +++ b/boards/arm/nucleo_f411re/pinmux.c @@ -14,11 +14,9 @@ /* pin assignments for NUCLEO-F411RE board */ static const struct pin_config pinconf[] = { -#if (DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI) || \ - (DT_NODE_HAS_STATUS(DT_NODELABEL(i2s1), okay) && CONFIG_I2S) -#ifdef CONFIG_SPI_STM32_USE_HW_SS +#if DT_NODE_HAS_STATUS(DT_NODELABEL(i2s1), okay) && CONFIG_I2S {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ + {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, diff --git a/boards/arm/nucleo_f412zg/nucleo_f412zg.dts b/boards/arm/nucleo_f412zg/nucleo_f412zg.dts index 2f5d3cc6f18..9b2b5231473 100644 --- a/boards/arm/nucleo_f412zg/nucleo_f412zg.dts +++ b/boards/arm/nucleo_f412zg/nucleo_f412zg.dts @@ -71,6 +71,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_f412zg/pinmux.c b/boards/arm/nucleo_f412zg/pinmux.c index ac582c79459..514acbe3bf6 100644 --- a/boards/arm/nucleo_f412zg/pinmux.c +++ b/boards/arm/nucleo_f412zg/pinmux.c @@ -18,14 +18,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f413zh/nucleo_f413zh.dts b/boards/arm/nucleo_f413zh/nucleo_f413zh.dts index 28187dd46b1..ecf97dfd81f 100644 --- a/boards/arm/nucleo_f413zh/nucleo_f413zh.dts +++ b/boards/arm/nucleo_f413zh/nucleo_f413zh.dts @@ -71,6 +71,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_f413zh/pinmux.c b/boards/arm/nucleo_f413zh/pinmux.c index a7564c1dbcd..4718736eaed 100644 --- a/boards/arm/nucleo_f413zh/pinmux.c +++ b/boards/arm/nucleo_f413zh/pinmux.c @@ -18,14 +18,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f429zi/nucleo_f429zi.dts b/boards/arm/nucleo_f429zi/nucleo_f429zi.dts index 950b1abacc0..17b36b37951 100644 --- a/boards/arm/nucleo_f429zi/nucleo_f429zi.dts +++ b/boards/arm/nucleo_f429zi/nucleo_f429zi.dts @@ -66,6 +66,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_f429zi/pinmux.c b/boards/arm/nucleo_f429zi/pinmux.c index d18f4e32d06..fc140b2d7b3 100644 --- a/boards/arm/nucleo_f429zi/pinmux.c +++ b/boards/arm/nucleo_f429zi/pinmux.c @@ -27,14 +27,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PG13, STM32F4_PINMUX_FUNC_PG13_ETH}, {STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_ETH}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/nucleo_f446re/nucleo_f446re.dts b/boards/arm/nucleo_f446re/nucleo_f446re.dts index 706b5ad9c42..9b77b34d2d3 100644 --- a/boards/arm/nucleo_f446re/nucleo_f446re.dts +++ b/boards/arm/nucleo_f446re/nucleo_f446re.dts @@ -73,6 +73,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_f446re/pinmux.c b/boards/arm/nucleo_f446re/pinmux.c index 1c9e158abb2..a443c6a2e54 100644 --- a/boards/arm/nucleo_f446re/pinmux.c +++ b/boards/arm/nucleo_f446re/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for stm32F446RE Nucleo board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F4_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F4_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F4_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f746zg/nucleo_f746zg.dts b/boards/arm/nucleo_f746zg/nucleo_f746zg.dts index b64bf0189df..253650b6691 100644 --- a/boards/arm/nucleo_f746zg/nucleo_f746zg.dts +++ b/boards/arm/nucleo_f746zg/nucleo_f746zg.dts @@ -92,9 +92,11 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; /* * WARNING: The pin PA7 will conflict on selection of SPI_1 and - * ETH_STM32_HAL. See pinmux.c for further details. + * ETH_STM32_HAL. */ status = "okay"; }; diff --git a/boards/arm/nucleo_f746zg/pinmux.c b/boards/arm/nucleo_f746zg/pinmux.c index 2caa5ba22a8..98ff3f625db 100644 --- a/boards/arm/nucleo_f746zg/pinmux.c +++ b/boards/arm/nucleo_f746zg/pinmux.c @@ -35,14 +35,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM }, { STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP }, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - { STM32_PIN_PA5, STM32F7_PINMUX_FUNC_PA5_SPI1_SCK }, - { STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO }, - { STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI }, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f756zg/nucleo_f756zg.dts b/boards/arm/nucleo_f756zg/nucleo_f756zg.dts index bef08ca2217..980e840448a 100644 --- a/boards/arm/nucleo_f756zg/nucleo_f756zg.dts +++ b/boards/arm/nucleo_f756zg/nucleo_f756zg.dts @@ -92,9 +92,11 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; /* * WARNING: The pin PA7 will conflict on selection of SPI_1 and - * ETH_STM32_HAL. See pinmux.c for further details. + * ETH_STM32_HAL. */ status = "okay"; }; diff --git a/boards/arm/nucleo_f756zg/pinmux.c b/boards/arm/nucleo_f756zg/pinmux.c index 4b03d9be0e6..818dd6bd7bc 100644 --- a/boards/arm/nucleo_f756zg/pinmux.c +++ b/boards/arm/nucleo_f756zg/pinmux.c @@ -35,14 +35,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM }, { STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP }, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - { STM32_PIN_PA5, STM32F7_PINMUX_FUNC_PA5_SPI1_SCK }, - { STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO }, - { STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI }, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_f767zi/nucleo_f767zi.dts b/boards/arm/nucleo_f767zi/nucleo_f767zi.dts index 7ff0f947c71..b3ac9f2955a 100644 --- a/boards/arm/nucleo_f767zi/nucleo_f767zi.dts +++ b/boards/arm/nucleo_f767zi/nucleo_f767zi.dts @@ -95,9 +95,11 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; /* * WARNING: The pin PA7 will conflict on selection of SPI_1 and - * ETH_STM32_HAL. See pinmux.c for further details. + * ETH_STM32_HAL. */ status = "okay"; }; diff --git a/boards/arm/nucleo_f767zi/pinmux.c b/boards/arm/nucleo_f767zi/pinmux.c index 4567199fdff..036ab7e0d31 100644 --- a/boards/arm/nucleo_f767zi/pinmux.c +++ b/boards/arm/nucleo_f767zi/pinmux.c @@ -35,14 +35,6 @@ static const struct pin_config pinconf[] = { { STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM }, { STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP }, #endif /* CONFIG_USB_DC_STM32 */ -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - { STM32_PIN_PA4, STM32F7_PINMUX_FUNC_PA4_SPI1_NSS }, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - { STM32_PIN_PA5, STM32F7_PINMUX_FUNC_PA5_SPI1_SCK }, - { STM32_PIN_PA6, STM32F7_PINMUX_FUNC_PA6_SPI1_MISO }, - { STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_SPI1_MOSI }, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_g431rb/nucleo_g431rb.dts b/boards/arm/nucleo_g431rb/nucleo_g431rb.dts index 18fc146d881..80cbc6e8a50 100644 --- a/boards/arm/nucleo_g431rb/nucleo_g431rb.dts +++ b/boards/arm/nucleo_g431rb/nucleo_g431rb.dts @@ -69,6 +69,21 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pb3 + &spi1_miso_pa6 &spi1_mosi_pa7>; + status = "okay"; +}; + +&spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; + status = "okay"; +}; + +&spi3 { + /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ + pinctrl-0 = <&spi3_nss_pa15 &spi3_sck_pc10 + &spi3_miso_pc11 &spi3_mosi_pc12>; status = "okay"; }; diff --git a/boards/arm/nucleo_g431rb/pinmux.c b/boards/arm/nucleo_g431rb/pinmux.c index f33096ffa71..e8c448473cd 100644 --- a/boards/arm/nucleo_g431rb/pinmux.c +++ b/boards/arm/nucleo_g431rb/pinmux.c @@ -14,34 +14,6 @@ /* pin assignments for NUCLEO-G431RB board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32G4X_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - /* SPI1_SCK should output on PA5, but is used for LD2 */ - {STM32_PIN_PB3, STM32G4X_PINMUX_FUNC_PB3_SPI1_SCK}, - {STM32_PIN_PA6, STM32G4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32G4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - /* SPI2 on the ST Morpho Connector CN10 pins 16, 30, 28, 26*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32G4X_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32G4X_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32G4X_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32G4X_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi3), okay) && CONFIG_SPI - /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA15, STM32G4X_PINMUX_FUNC_PA15_SPI3_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PC10, STM32G4X_PINMUX_FUNC_PC10_SPI3_SCK}, - {STM32_PIN_PC11, STM32G4X_PINMUX_FUNC_PC11_SPI3_MISO}, - {STM32_PIN_PC12, STM32G4X_PINMUX_FUNC_PC12_SPI3_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32G4X_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32G4X_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/nucleo_g474re/nucleo_g474re.dts b/boards/arm/nucleo_g474re/nucleo_g474re.dts index acd0410f9cd..4fe986268b2 100644 --- a/boards/arm/nucleo_g474re/nucleo_g474re.dts +++ b/boards/arm/nucleo_g474re/nucleo_g474re.dts @@ -69,6 +69,21 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pb3 + &spi1_miso_pa6 &spi1_mosi_pa7>; + status = "okay"; +}; + +&spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; + status = "okay"; +}; + +&spi3 { + /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ + pinctrl-0 = <&spi3_nss_pa15 &spi3_sck_pc10 + &spi3_miso_pc11 &spi3_mosi_pc12>; status = "okay"; }; diff --git a/boards/arm/nucleo_g474re/pinmux.c b/boards/arm/nucleo_g474re/pinmux.c index 909da9066ca..8ec2fedec48 100644 --- a/boards/arm/nucleo_g474re/pinmux.c +++ b/boards/arm/nucleo_g474re/pinmux.c @@ -14,34 +14,6 @@ /* pin assignments for NUCLEO-G474RE board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 on the Arduino connectors pins A2, D3, D11, D12 */ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32G4X_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - /* SPI1_SCK should output on PA5, but is used for LD2 */ - {STM32_PIN_PB3, STM32G4X_PINMUX_FUNC_PB3_SPI1_SCK}, - {STM32_PIN_PA6, STM32G4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32G4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - /* SPI2 on the ST Morpho Connector CN10 pins 16, 30, 28, 26*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32G4X_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32G4X_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32G4X_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32G4X_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi3), okay) && CONFIG_SPI - /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA15, STM32G4X_PINMUX_FUNC_PA15_SPI3_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PC10, STM32G4X_PINMUX_FUNC_PC10_SPI3_SCK}, - {STM32_PIN_PC11, STM32G4X_PINMUX_FUNC_PC11_SPI3_MISO}, - {STM32_PIN_PC12, STM32G4X_PINMUX_FUNC_PC12_SPI3_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32G4X_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32G4X_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/nucleo_l011k4/pinmux.c b/boards/arm/nucleo_l011k4/pinmux.c index ddb015b05b9..dce8be35bcb 100644 --- a/boards/arm/nucleo_l011k4/pinmux.c +++ b/boards/arm/nucleo_l011k4/pinmux.c @@ -13,11 +13,6 @@ /* pin assignments for NUCLEO-L011K4 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L0_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L0_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L0_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l053r8/nucleo_l053r8.dts b/boards/arm/nucleo_l053r8/nucleo_l053r8.dts index 95821e2c3af..464b1abe9e9 100644 --- a/boards/arm/nucleo_l053r8/nucleo_l053r8.dts +++ b/boards/arm/nucleo_l053r8/nucleo_l053r8.dts @@ -66,6 +66,7 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_l053r8/pinmux.c b/boards/arm/nucleo_l053r8/pinmux.c index f2bcf447717..e19335c4c3c 100644 --- a/boards/arm/nucleo_l053r8/pinmux.c +++ b/boards/arm/nucleo_l053r8/pinmux.c @@ -14,11 +14,6 @@ /* pin assignments for NUCLEO-L053R8 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L0_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L0_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L0_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l073rz/nucleo_l073rz.dts b/boards/arm/nucleo_l073rz/nucleo_l073rz.dts index dcbf89a475c..2fb87e2a619 100644 --- a/boards/arm/nucleo_l073rz/nucleo_l073rz.dts +++ b/boards/arm/nucleo_l073rz/nucleo_l073rz.dts @@ -60,6 +60,7 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_l073rz/pinmux.c b/boards/arm/nucleo_l073rz/pinmux.c index 3a783f4ad0e..e07c98114d9 100644 --- a/boards/arm/nucleo_l073rz/pinmux.c +++ b/boards/arm/nucleo_l073rz/pinmux.c @@ -14,11 +14,6 @@ /* pin assignments for NUCLEO-L073RZ board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L0_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L0_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L0_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l432kc/nucleo_l432kc.dts b/boards/arm/nucleo_l432kc/nucleo_l432kc.dts index cccfb8122ec..871a5fd6e47 100644 --- a/boards/arm/nucleo_l432kc/nucleo_l432kc.dts +++ b/boards/arm/nucleo_l432kc/nucleo_l432kc.dts @@ -45,6 +45,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_l432kc/pinmux.c b/boards/arm/nucleo_l432kc/pinmux.c index 87aaaf39318..23ce712e2ad 100644 --- a/boards/arm/nucleo_l432kc/pinmux.c +++ b/boards/arm/nucleo_l432kc/pinmux.c @@ -15,14 +15,6 @@ /* pin assignments for NUCLEO-L432KC board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi b/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi index 7ed51189661..11e383e0755 100644 --- a/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi +++ b/boards/arm/nucleo_l452re/nucleo_l452re_common.dtsi @@ -46,6 +46,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_l452re/pinmux.c b/boards/arm/nucleo_l452re/pinmux.c index 78c50d9ed13..f6175593266 100644 --- a/boards/arm/nucleo_l452re/pinmux.c +++ b/boards/arm/nucleo_l452re/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for NUCLEO-L452RE board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l476rg/nucleo_l476rg.dts b/boards/arm/nucleo_l476rg/nucleo_l476rg.dts index 8ce429fc6fa..31d31cb4175 100644 --- a/boards/arm/nucleo_l476rg/nucleo_l476rg.dts +++ b/boards/arm/nucleo_l476rg/nucleo_l476rg.dts @@ -72,9 +72,25 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pb3 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; +&spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; + status = "okay"; +}; + +&spi3 { + /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ + pinctrl-0 = <&spi3_nss_pa15 &spi3_sck_pc10 + &spi3_miso_pc11 &spi3_mosi_pc12>; + status = "okay"; +}; + + &timers2 { status = "okay"; diff --git a/boards/arm/nucleo_l476rg/pinmux.c b/boards/arm/nucleo_l476rg/pinmux.c index c4f8634a030..532e7b3e8e0 100644 --- a/boards/arm/nucleo_l476rg/pinmux.c +++ b/boards/arm/nucleo_l476rg/pinmux.c @@ -15,34 +15,6 @@ /* pin assignments for NUCLEO-L476RG board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - /* SPI1_SCK should output on PA5, but is used for LD2 */ - {STM32_PIN_PB3, STM32L4X_PINMUX_FUNC_PB3_SPI1_SCK}, - {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - /* SPI2 on the ST Morpho Connector CN10 pins 16, 30, 28, 26*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32L4X_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32L4X_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32L4X_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32L4X_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi3), okay) && CONFIG_SPI - /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA15, STM32L4X_PINMUX_FUNC_PA15_SPI3_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PC10, STM32L4X_PINMUX_FUNC_PC10_SPI3_SCK}, - {STM32_PIN_PC11, STM32L4X_PINMUX_FUNC_PC11_SPI3_MISO}, - {STM32_PIN_PC12, STM32L4X_PINMUX_FUNC_PC12_SPI3_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l496zg/nucleo_l496zg.dts b/boards/arm/nucleo_l496zg/nucleo_l496zg.dts index 5dd678f9a10..12d65960220 100644 --- a/boards/arm/nucleo_l496zg/nucleo_l496zg.dts +++ b/boards/arm/nucleo_l496zg/nucleo_l496zg.dts @@ -114,6 +114,7 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_l496zg/pinmux.c b/boards/arm/nucleo_l496zg/pinmux.c index 020def962a9..42c78642fb2 100644 --- a/boards/arm/nucleo_l496zg/pinmux.c +++ b/boards/arm/nucleo_l496zg/pinmux.c @@ -14,11 +14,6 @@ /* pin assignments for NUCLEO-L496ZG board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts b/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts index a14a18429ee..ba4f6ada633 100644 --- a/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts +++ b/boards/arm/nucleo_l4r5zi/nucleo_l4r5zi.dts @@ -84,6 +84,21 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; + status = "okay"; +}; + +&spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; + status = "okay"; +}; + +&spi3 { + /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ + pinctrl-0 = <&spi3_nss_pa15 &spi3_sck_pc10 + &spi3_miso_pc11 &spi3_mosi_pc12>; status = "okay"; }; diff --git a/boards/arm/nucleo_l4r5zi/pinmux.c b/boards/arm/nucleo_l4r5zi/pinmux.c index b8cc2631a5b..c76d16d7439 100644 --- a/boards/arm/nucleo_l4r5zi/pinmux.c +++ b/boards/arm/nucleo_l4r5zi/pinmux.c @@ -14,33 +14,6 @@ /* pin assignments for NUCLEO-L4R5ZI board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - /* SPI1 on the Arduino connectors pins A2, D3, D12, D11 */ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32L4X_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L4X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L4X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - /* SPI2 on the ST Morpho Connector CN10 pins 16, 30, 28, 26*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32L4X_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32L4X_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32L4X_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32L4X_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi3), okay) && CONFIG_SPI - /* SPI3 on the ST Morpho Connector CN7 pins 17, 1, 2, 3*/ -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA15, STM32L4X_PINMUX_FUNC_PA15_SPI3_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PC10, STM32L4X_PINMUX_FUNC_PC10_SPI3_SCK}, - {STM32_PIN_PC11, STM32L4X_PINMUX_FUNC_PC11_SPI3_MISO}, - {STM32_PIN_PC12, STM32L4X_PINMUX_FUNC_PC12_SPI3_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA10, STM32L4X_PINMUX_FUNC_PA10_OTG_FS_ID}, {STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM}, diff --git a/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts b/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts index e5d557b938c..cfab72d7b01 100644 --- a/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts +++ b/boards/arm/nucleo_wb55rg/nucleo_wb55rg.dts @@ -85,6 +85,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; diff --git a/boards/arm/nucleo_wb55rg/pinmux.c b/boards/arm/nucleo_wb55rg/pinmux.c index d11c080ef25..251b3f64096 100644 --- a/boards/arm/nucleo_wb55rg/pinmux.c +++ b/boards/arm/nucleo_wb55rg/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for NUCLEO-WB55RG board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32WBX_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32WBX_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32WBX_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32WBX_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(usb), okay) {STM32_PIN_PA11, STM32WBX_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32WBX_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts b/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts index 8d3bccd180d..ecdc16019a7 100644 --- a/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts +++ b/boards/arm/olimex_stm32_h103/olimex_stm32_h103.dts @@ -70,10 +70,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5 + &spi1_miso_master_pa6 &spi1_mosi_master_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13 + &spi2_miso_master_pb14 &spi2_mosi_master_pb15>; status = "okay"; }; diff --git a/boards/arm/olimex_stm32_h103/pinmux.c b/boards/arm/olimex_stm32_h103/pinmux.c index fc678dbb426..f94d093fdca 100644 --- a/boards/arm/olimex_stm32_h103/pinmux.c +++ b/boards/arm/olimex_stm32_h103/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for OLIMEX-STM32-H103 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F1_PINMUX_FUNC_PA5_SPI1_MASTER_SCK}, - {STM32_PIN_PA6, STM32F1_PINMUX_FUNC_PA6_SPI1_MASTER_MISO}, - {STM32_PIN_PA7, STM32F1_PINMUX_FUNC_PA7_SPI1_MASTER_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F1_PINMUX_FUNC_PB12_SPI2_MASTER_NSS_OE}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F1_PINMUX_FUNC_PB13_SPI2_MASTER_SCK}, - {STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO}, - {STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/olimexino_stm32/olimexino_stm32.dts b/boards/arm/olimexino_stm32/olimexino_stm32.dts index 7cc16889d7c..31dd97881af 100644 --- a/boards/arm/olimexino_stm32/olimexino_stm32.dts +++ b/boards/arm/olimexino_stm32/olimexino_stm32.dts @@ -80,10 +80,14 @@ uext_serial: &usart1 {}; }; &spi1 { + pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5 + &spi1_miso_master_pa6 &spi1_mosi_master_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13 + &spi2_miso_master_pb14 &spi2_mosi_master_pb15>; status = "okay"; cs-gpios = <&gpiod 2 GPIO_ACTIVE_HIGH>; diff --git a/boards/arm/olimexino_stm32/pinmux.c b/boards/arm/olimexino_stm32/pinmux.c index ddbbf963dd7..d43f47f2d31 100644 --- a/boards/arm/olimexino_stm32/pinmux.c +++ b/boards/arm/olimexino_stm32/pinmux.c @@ -15,22 +15,6 @@ /* pin assignments for OLIMEXINO-STM32 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F1_PINMUX_FUNC_PA5_SPI1_MASTER_SCK}, - {STM32_PIN_PA6, STM32F1_PINMUX_FUNC_PA6_SPI1_MASTER_MISO}, - {STM32_PIN_PA7, STM32F1_PINMUX_FUNC_PA7_SPI1_MASTER_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F1_PINMUX_FUNC_PB12_SPI2_MASTER_NSS_OE}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F1_PINMUX_FUNC_PB13_SPI2_MASTER_SCK}, - {STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO}, - {STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/sensortile_box/pinmux.c b/boards/arm/sensortile_box/pinmux.c index c0071e50260..d2138b4b439 100644 --- a/boards/arm/sensortile_box/pinmux.c +++ b/boards/arm/sensortile_box/pinmux.c @@ -14,25 +14,6 @@ /* pin assignments for SensorTile.box board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PE12, STM32L4X_PINMUX_FUNC_PE12_SPI1_NSS}, - {STM32_PIN_PE13, STM32L4X_PINMUX_FUNC_PE13_SPI1_SCK}, - {STM32_PIN_PE14, STM32L4X_PINMUX_FUNC_PE14_SPI1_MISO}, - {STM32_PIN_PE15, STM32L4X_PINMUX_FUNC_PE15_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - /* SPI2 on the ST Morpho Connector CN10 pins 16, 30, 28, 26*/ - {STM32_PIN_PB12, STM32L4X_PINMUX_FUNC_PB12_SPI2_NSS}, - {STM32_PIN_PB13, STM32L4X_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32L4X_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32L4X_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi3), okay) && CONFIG_SPI - {STM32_PIN_PA15, STM32L4X_PINMUX_FUNC_PA15_SPI3_NSS}, - {STM32_PIN_PB3, STM32L4X_PINMUX_FUNC_PB3_SPI3_SCK}, - {STM32_PIN_PB4, STM32L4X_PINMUX_FUNC_PB4_SPI3_MISO}, - {STM32_PIN_PB5, STM32L4X_PINMUX_FUNC_PB5_SPI3_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32L4X_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32L4X_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/sensortile_box/sensortile_box.dts b/boards/arm/sensortile_box/sensortile_box.dts index 09973def5d3..7370b163db9 100644 --- a/boards/arm/sensortile_box/sensortile_box.dts +++ b/boards/arm/sensortile_box/sensortile_box.dts @@ -93,6 +93,8 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pe12 &spi1_sck_pe13 + &spi1_miso_pe14 &spi1_mosi_pe15>; status = "okay"; cs-gpios = <&gpioe 11 GPIO_ACTIVE_LOW>, <&gpioe 12 GPIO_ACTIVE_LOW>, <&gpioe 10 GPIO_ACTIVE_LOW>; @@ -123,6 +125,8 @@ }; &spi3 { + pinctrl-0 = <&spi3_nss_pa15 &spi3_sck_pb3 + &spi3_miso_pb4 &spi3_mosi_pb5>; status = "okay"; cs-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>; diff --git a/boards/arm/stm32_min_dev/pinmux.c b/boards/arm/stm32_min_dev/pinmux.c index b4734439e2c..e31b6f1cf27 100644 --- a/boards/arm/stm32_min_dev/pinmux.c +++ b/boards/arm/stm32_min_dev/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for STM32_MIN_DEV board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS_OE}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F1_PINMUX_FUNC_PA5_SPI1_MASTER_SCK}, - {STM32_PIN_PA6, STM32F1_PINMUX_FUNC_PA6_SPI1_MASTER_MISO}, - {STM32_PIN_PA7, STM32F1_PINMUX_FUNC_PA7_SPI1_MASTER_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F1_PINMUX_FUNC_PB12_SPI2_MASTER_NSS_OE}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F1_PINMUX_FUNC_PB13_SPI2_MASTER_SCK}, - {STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO}, - {STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/stm32_min_dev/stm32_min_dev.dtsi b/boards/arm/stm32_min_dev/stm32_min_dev.dtsi index dc52bf63633..f3a5b972072 100644 --- a/boards/arm/stm32_min_dev/stm32_min_dev.dtsi +++ b/boards/arm/stm32_min_dev/stm32_min_dev.dtsi @@ -64,10 +64,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5 + &spi1_miso_master_pa6 &spi1_mosi_master_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13 + &spi2_miso_master_pb14 &spi2_mosi_master_pb15>; status = "okay"; }; diff --git a/boards/arm/stm32f072b_disco/pinmux.c b/boards/arm/stm32f072b_disco/pinmux.c index a24461eb156..ac4c0d76454 100644 --- a/boards/arm/stm32f072b_disco/pinmux.c +++ b/boards/arm/stm32f072b_disco/pinmux.c @@ -15,11 +15,6 @@ /* pin assignments for STM32F072B-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PB3, STM32F0_PINMUX_FUNC_PB3_SPI1_SCK}, - {STM32_PIN_PB4, STM32F0_PINMUX_FUNC_PB4_SPI1_MISO}, - {STM32_PIN_PB5, STM32F0_PINMUX_FUNC_PB5_SPI1_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/stm32f072b_disco/stm32f072b_disco.dts b/boards/arm/stm32f072b_disco/stm32f072b_disco.dts index ec802e9de0f..55c7b8308a4 100644 --- a/boards/arm/stm32f072b_disco/stm32f072b_disco.dts +++ b/boards/arm/stm32f072b_disco/stm32f072b_disco.dts @@ -76,6 +76,7 @@ }; &spi1 { + pinctrl-0 = <&spi1_sck_pb3 &spi1_miso_pb4 &spi1_mosi_pb5>; status = "okay"; }; diff --git a/boards/arm/stm32f3_disco/pinmux.c b/boards/arm/stm32f3_disco/pinmux.c index b194bbe813b..e16191b9745 100644 --- a/boards/arm/stm32f3_disco/pinmux.c +++ b/boards/arm/stm32f3_disco/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for STM32F3DISCOVERY board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F3_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F3_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32F3_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32F3_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F3_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F3_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32F3_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F3_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F3_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F3_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/stm32f3_disco/stm32f3_disco.dts b/boards/arm/stm32f3_disco/stm32f3_disco.dts index c4be66131bb..543a6ae7758 100644 --- a/boards/arm/stm32f3_disco/stm32f3_disco.dts +++ b/boards/arm/stm32f3_disco/stm32f3_disco.dts @@ -110,10 +110,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/stm32f429i_disc1/pinmux.c b/boards/arm/stm32f429i_disc1/pinmux.c index 4c286dd17f5..d20a6c60f2a 100644 --- a/boards/arm/stm32f429i_disc1/pinmux.c +++ b/boards/arm/stm32f429i_disc1/pinmux.c @@ -14,14 +14,6 @@ /* pin assignments for STM32F429I-DISC1 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi5), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PF6, STM32F4_PINMUX_FUNC_PF6_SPI5_MASTER_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PF7, STM32F4_PINMUX_FUNC_PF7_SPI5_MASTER_SCK}, - {STM32_PIN_PF8, STM32F4_PINMUX_FUNC_PF8_SPI5_MASTER_MISO}, - {STM32_PIN_PF9, STM32F4_PINMUX_FUNC_PF9_SPI5_MASTER_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts b/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts index 23f0b3a719f..821f9345e52 100644 --- a/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts +++ b/boards/arm/stm32f429i_disc1/stm32f429i_disc1.dts @@ -83,6 +83,8 @@ &spi5 { + pinctrl-0 = <&spi5_nss_pf6 &spi5_sck_pf7 + &spi5_miso_pf8 &spi5_mosi_pf9>; status = "okay"; cs-gpios = <&gpioc 2 GPIO_ACTIVE_LOW>; ili9340@0 { diff --git a/boards/arm/stm32f469i_disco/pinmux.c b/boards/arm/stm32f469i_disco/pinmux.c index aba67b24792..e8bfd695c09 100644 --- a/boards/arm/stm32f469i_disco/pinmux.c +++ b/boards/arm/stm32f469i_disco/pinmux.c @@ -14,11 +14,6 @@ /* pin assignments for STM32F469I-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - {STM32_PIN_PD3, STM32F4_PINMUX_FUNC_PD3_SPI2_SCK}, - {STM32_PIN_PB14, STM32F4_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F4_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F4_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/stm32f469i_disco/stm32f469i_disco.dts b/boards/arm/stm32f469i_disco/stm32f469i_disco.dts index a4c0fe9dedc..aa1ebab5d2c 100644 --- a/boards/arm/stm32f469i_disco/stm32f469i_disco.dts +++ b/boards/arm/stm32f469i_disco/stm32f469i_disco.dts @@ -79,6 +79,7 @@ arduino_serial: &usart6 {}; }; &spi2 { + pinctrl-0 = <&spi2_sck_pd3 &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/stm32f723e_disco/pinmux.c b/boards/arm/stm32f723e_disco/pinmux.c index e382257d3a9..3f279bcdf32 100644 --- a/boards/arm/stm32f723e_disco/pinmux.c +++ b/boards/arm/stm32f723e_disco/pinmux.c @@ -14,11 +14,6 @@ /* pin assignments for STM32F723E-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32F7_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PB4, STM32F7_PINMUX_FUNC_PB4_SPI1_MISO}, - {STM32_PIN_PB5, STM32F7_PINMUX_FUNC_PB5_SPI1_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/stm32f723e_disco/stm32f723e_disco.dts b/boards/arm/stm32f723e_disco/stm32f723e_disco.dts index 6775f2c5c5b..91ecdeed666 100644 --- a/boards/arm/stm32f723e_disco/stm32f723e_disco.dts +++ b/boards/arm/stm32f723e_disco/stm32f723e_disco.dts @@ -83,6 +83,7 @@ arduino_serial: &usart2 {}; }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pb4 &spi1_mosi_pb5>; status = "okay"; }; diff --git a/boards/arm/stm32f746g_disco/pinmux.c b/boards/arm/stm32f746g_disco/pinmux.c index 5c71f58abe7..582f03a97af 100644 --- a/boards/arm/stm32f746g_disco/pinmux.c +++ b/boards/arm/stm32f746g_disco/pinmux.c @@ -27,14 +27,6 @@ static const struct pin_config pinconf[] = { {STM32_PIN_PG13, STM32F7_PINMUX_FUNC_PG13_ETH}, {STM32_PIN_PG14, STM32F7_PINMUX_FUNC_PG14_ETH}, #endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PI0, STM32F7_PINMUX_FUNC_PI0_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PI1, STM32F7_PINMUX_FUNC_PI1_SPI2_SCK}, - {STM32_PIN_PB14, STM32F7_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F7_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #ifdef CONFIG_USB_DC_STM32 {STM32_PIN_PA11, STM32F7_PINMUX_FUNC_PA11_OTG_FS_DM}, {STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_OTG_FS_DP}, diff --git a/boards/arm/stm32f746g_disco/stm32f746g_disco.dts b/boards/arm/stm32f746g_disco/stm32f746g_disco.dts index 1a59055e2b3..26864d632a6 100644 --- a/boards/arm/stm32f746g_disco/stm32f746g_disco.dts +++ b/boards/arm/stm32f746g_disco/stm32f746g_disco.dts @@ -64,6 +64,8 @@ }; &spi2 { + pinctrl-0 = <&spi2_nss_pi0 &spi2_sck_pi1 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/stm32f769i_disco/pinmux.c b/boards/arm/stm32f769i_disco/pinmux.c index c6d77887772..cd59da0c2ad 100644 --- a/boards/arm/stm32f769i_disco/pinmux.c +++ b/boards/arm/stm32f769i_disco/pinmux.c @@ -14,11 +14,6 @@ /* pin assignments for STM32F769I-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI - {STM32_PIN_PA12, STM32F7_PINMUX_FUNC_PA12_SPI2_SCK}, - {STM32_PIN_PB14, STM32F7_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32F7_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(mac), okay) && CONFIG_NET_L2_ETHERNET {STM32_PIN_PC1, STM32F7_PINMUX_FUNC_PC1_ETH}, {STM32_PIN_PC4, STM32F7_PINMUX_FUNC_PC4_ETH}, diff --git a/boards/arm/stm32f769i_disco/stm32f769i_disco.dts b/boards/arm/stm32f769i_disco/stm32f769i_disco.dts index ad7a99c3241..e5b073b1fbc 100644 --- a/boards/arm/stm32f769i_disco/stm32f769i_disco.dts +++ b/boards/arm/stm32f769i_disco/stm32f769i_disco.dts @@ -80,6 +80,7 @@ arduino_serial: &usart6 {}; }; &spi2 { + pinctrl-0 = <&spi2_sck_pa12 &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/stm32l1_disco/pinmux.c b/boards/arm/stm32l1_disco/pinmux.c index 53dd3fc5d0e..a553444c8f0 100644 --- a/boards/arm/stm32l1_disco/pinmux.c +++ b/boards/arm/stm32l1_disco/pinmux.c @@ -13,22 +13,6 @@ #include static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32L1X_PINMUX_FUNC_PA4_SPI1_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32L1X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PA6, STM32L1X_PINMUX_FUNC_PA6_SPI1_MISO}, - {STM32_PIN_PA7, STM32L1X_PINMUX_FUNC_PA7_SPI1_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32L1X_PINMUX_FUNC_PB12_SPI2_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32L1X_PINMUX_FUNC_PB13_SPI2_SCK}, - {STM32_PIN_PB14, STM32L1X_PINMUX_FUNC_PB14_SPI2_MISO}, - {STM32_PIN_PB15, STM32L1X_PINMUX_FUNC_PB15_SPI2_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/stm32l1_disco/stm32l1_disco.dts b/boards/arm/stm32l1_disco/stm32l1_disco.dts index 54affb91c38..6036224084b 100644 --- a/boards/arm/stm32l1_disco/stm32l1_disco.dts +++ b/boards/arm/stm32l1_disco/stm32l1_disco.dts @@ -77,9 +77,13 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13 + &spi2_miso_pb14 &spi2_mosi_pb15>; status = "okay"; }; diff --git a/boards/arm/stm32l496g_disco/pinmux.c b/boards/arm/stm32l496g_disco/pinmux.c index aef4d7f0e12..df2a17c5130 100644 --- a/boards/arm/stm32l496g_disco/pinmux.c +++ b/boards/arm/stm32l496g_disco/pinmux.c @@ -15,11 +15,6 @@ /* pin assignments for STM32L476G-DISCO board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI - {STM32_PIN_PA5, STM32L4X_PINMUX_FUNC_PA5_SPI1_SCK}, - {STM32_PIN_PB4, STM32L4X_PINMUX_FUNC_PB4_SPI1_MISO}, - {STM32_PIN_PB5, STM32L4X_PINMUX_FUNC_PB5_SPI1_MOSI}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(sdmmc1), okay) && \ CONFIG_DISK_ACCESS_STM32_SDMMC {STM32_PIN_PC8, STM32L4X_PINMUX_FUNC_PC8_SDMMC1_D0}, diff --git a/boards/arm/stm32l496g_disco/stm32l496g_disco.dts b/boards/arm/stm32l496g_disco/stm32l496g_disco.dts index 980e5f66f42..41d2a84f0c2 100644 --- a/boards/arm/stm32l496g_disco/stm32l496g_disco.dts +++ b/boards/arm/stm32l496g_disco/stm32l496g_disco.dts @@ -95,6 +95,7 @@ arduino_serial: &lpuart1 {}; }; &spi1 { + pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pb4 &spi1_mosi_pb5>; status = "okay"; }; diff --git a/boards/arm/stm32mp157c_dk2/pinmux.c b/boards/arm/stm32mp157c_dk2/pinmux.c index 1e83950bfe9..82adeddcf7d 100644 --- a/boards/arm/stm32mp157c_dk2/pinmux.c +++ b/boards/arm/stm32mp157c_dk2/pinmux.c @@ -14,24 +14,6 @@ /* pin assignments for STM32MP157c_dk2 board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi4), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PE11, STM32MP1X_PINMUX_FUNC_PE11_SPI4_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PE12, STM32MP1X_PINMUX_FUNC_PE12_SPI4_SCK}, - {STM32_PIN_PE13, STM32MP1X_PINMUX_FUNC_PE13_SPI4_MISO | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PE14, STM32MP1X_PINMUX_FUNC_PE14_SPI4_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi5), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PF6, STM32MP1X_PINMUX_FUNC_PF6_SPI5_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PF7, STM32MP1X_PINMUX_FUNC_PF7_SPI5_SCK}, - {STM32_PIN_PF8, STM32MP1X_PINMUX_FUNC_PF8_SPI5_MISO | - STM32_OSPEEDR_VERY_HIGH_SPEED}, - {STM32_PIN_PF9, STM32MP1X_PINMUX_FUNC_PF9_SPI5_MOSI}, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts b/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts index a85b571da3e..e2b44a1f002 100644 --- a/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts +++ b/boards/arm/stm32mp157c_dk2/stm32mp157c_dk2.dts @@ -49,11 +49,19 @@ }; +&spi4_miso_pe13{ slew-rate = "very-high-speed"; }; + &spi4{ + pinctrl-0 = <&spi4_nss_pe11 &spi4_sck_pe12 + &spi4_miso_pe13 &spi4_mosi_pe14>; status = "okay"; }; +&spi5_miso_pf8{ slew-rate = "very-high-speed"; }; + &spi5{ + pinctrl-0 = <&spi5_nss_pf6 &spi5_sck_pf7 + &spi5_miso_pf8 &spi5_mosi_pf9>; status = "okay"; }; diff --git a/boards/arm/stm32vl_disco/pinmux.c b/boards/arm/stm32vl_disco/pinmux.c index 26db47eb388..b241f1d09ab 100644 --- a/boards/arm/stm32vl_disco/pinmux.c +++ b/boards/arm/stm32vl_disco/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for STM32 Discovery VL board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - { STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS }, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - { STM32_PIN_PA5, STM32F1_PINMUX_FUNC_PA5_SPI1_MASTER_SCK }, - { STM32_PIN_PA6, STM32F1_PINMUX_FUNC_PA6_SPI1_MASTER_MISO }, - { STM32_PIN_PA7, STM32F1_PINMUX_FUNC_PA7_SPI1_MASTER_MOSI }, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - { STM32_PIN_PB12, STM32F1_PINMUX_FUNC_PB12_SPI2_MASTER_NSS }, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - { STM32_PIN_PB13, STM32F1_PINMUX_FUNC_PB13_SPI2_MASTER_SCK }, - { STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO }, - { STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI }, -#endif }; static int pinmux_stm32_init(const struct device *port) diff --git a/boards/arm/stm32vl_disco/stm32vl_disco.dts b/boards/arm/stm32vl_disco/stm32vl_disco.dts index 8562bed0007..3c8998b021f 100644 --- a/boards/arm/stm32vl_disco/stm32vl_disco.dts +++ b/boards/arm/stm32vl_disco/stm32vl_disco.dts @@ -77,10 +77,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5 + &spi1_miso_master_pa6 &spi1_mosi_master_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13 + &spi2_miso_master_pb14 &spi2_mosi_master_pb15>; status = "okay"; }; diff --git a/boards/arm/waveshare_open103z/pinmux.c b/boards/arm/waveshare_open103z/pinmux.c index 7df503422be..e9300a25ad9 100644 --- a/boards/arm/waveshare_open103z/pinmux.c +++ b/boards/arm/waveshare_open103z/pinmux.c @@ -14,22 +14,6 @@ /* pin assignments for waveshre_open103z board */ static const struct pin_config pinconf[] = { -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi1), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PA4, STM32F1_PINMUX_FUNC_PA4_SPI1_MASTER_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PA5, STM32F1_PINMUX_FUNC_PA5_SPI1_MASTER_SCK}, - {STM32_PIN_PA6, STM32F1_PINMUX_FUNC_PA6_SPI1_MASTER_MISO}, - {STM32_PIN_PA7, STM32F1_PINMUX_FUNC_PA7_SPI1_MASTER_MOSI}, -#endif -#if DT_NODE_HAS_STATUS(DT_NODELABEL(spi2), okay) && CONFIG_SPI -#ifdef CONFIG_SPI_STM32_USE_HW_SS - {STM32_PIN_PB12, STM32F1_PINMUX_FUNC_PB12_SPI2_MASTER_NSS}, -#endif /* CONFIG_SPI_STM32_USE_HW_SS */ - {STM32_PIN_PB13, STM32F1_PINMUX_FUNC_PB13_SPI2_MASTER_SCK}, - {STM32_PIN_PB14, STM32F1_PINMUX_FUNC_PB14_SPI2_MASTER_MISO}, - {STM32_PIN_PB15, STM32F1_PINMUX_FUNC_PB15_SPI2_MASTER_MOSI}, -#endif #if DT_NODE_HAS_STATUS(DT_NODELABEL(usb), okay) && CONFIG_USB {STM32_PIN_PA11, STM32F1_PINMUX_FUNC_PA11_USB_DM}, {STM32_PIN_PA12, STM32F1_PINMUX_FUNC_PA12_USB_DP}, diff --git a/boards/arm/waveshare_open103z/waveshare_open103z.dts b/boards/arm/waveshare_open103z/waveshare_open103z.dts index 29fab04c03e..eeff37ee688 100644 --- a/boards/arm/waveshare_open103z/waveshare_open103z.dts +++ b/boards/arm/waveshare_open103z/waveshare_open103z.dts @@ -90,10 +90,14 @@ }; &spi1 { + pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5 + &spi1_miso_master_pa6 &spi1_mosi_master_pa7>; status = "okay"; }; &spi2 { + pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13 + &spi2_miso_master_pb14 &spi2_mosi_master_pb15>; status = "okay"; };