boards: stm32: Move STM32 boards SPI pin configuration to device tree

Move SPI pin configuration to device tree for all STM32 based
boards.
This should not bring any change in pin configuration.

Though, some adjuments have been made on following boards for
coherency:

* b_l4s5i_iot01a1: Removed "very-high-speed" on SPI3 MOSI pin.
Tested with no impact.
* black_f407zg_pro: SPI1 pins configured but not SPI1 node.
Removed pin config as not documented neither.
* sensortile_box: SPI2 pins configured but not SPI2 node.
Removed pin config as not documented neither.
* nucleo_g431rb/nucleo_g474re/nucleo_l476rg/nucleo_l4r5zi:
SPI2 and SPI3 pins were configured but missing.
Added since they were documented.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
diff --git a/boards/arm/96b_aerocore2/96b_aerocore2.dts b/boards/arm/96b_aerocore2/96b_aerocore2.dts
index 881595c..5242681 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 850f05b..d33adc9 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 05ed102..4955d5f 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 ac83548..b876ac6 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 2cd636b..df4de0d 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 e1de25f..d207f14 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 f957f6a..a3a489e 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 f72d346..f3f6c3f 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 d9335a9..5dd5415 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 ceff576..c93d1e8 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 04f7bc6..43649c1 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 c250aa0..068d12a 100644
--- a/boards/arm/96b_wistrio/pinmux.c
+++ b/boards/arm/96b_wistrio/pinmux.c
@@ -14,12 +14,6 @@
 #include <pinmux/stm32/pinmux_stm32.h>
 
 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 7bbb280..6499523 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 = <I2C_BITRATE_FAST>;
 };
 
+&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 81cf4f3..f82b6c3 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 5b650a4..c359f48 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 @@
 };
 
 &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 @@
 };
 
 &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 de9c406..2b22591 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 0a1c09f..1df9b8b 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 d2c5c6f..c4dce37 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 6d7e6c8..1e87b88 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 a55ffe1..16640d7 100644
--- a/boards/arm/black_f407ve/pinmux.c
+++ b/boards/arm/black_f407ve/pinmux.c
@@ -18,16 +18,6 @@
 	{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 da7fdb2..f7976d4 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 5167ee3..9e40c1a 100644
--- a/boards/arm/black_f407zg_pro/pinmux.c
+++ b/boards/arm/black_f407zg_pro/pinmux.c
@@ -18,16 +18,6 @@
 	{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 cde5671..db56ae5 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 5931889..f785352 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 61f9c975..6df0a3b 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 8279b3c..9b72791 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 b6729c3..c23a14a 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 6841c60..1bb57bd 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 90cb098..b319456 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 7af1994..36753f2 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 2231ea7..ae16d8f 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 546b26e..595f453 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 f88c32f..55b7c19 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 18b4e91..447777c 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 16a9fad..f6068ec 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 2353b19..60a40c4 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 c28e0b2..5e039e8 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 b7520f4..8ea79d0 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 15b7c29..8cf2d58 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 4a11864..884c065 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 4c71c6c..69efd5f 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 0093687..ba61214 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 dc6113d..8261b6b 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 744e3b6..30bb078 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 2f5d3cc..9b2b523 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 ac582c7..514acbe 100644
--- a/boards/arm/nucleo_f412zg/pinmux.c
+++ b/boards/arm/nucleo_f412zg/pinmux.c
@@ -18,14 +18,6 @@
 	{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 28187dd..ecf97df 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 a7564c1..4718736 100644
--- a/boards/arm/nucleo_f413zh/pinmux.c
+++ b/boards/arm/nucleo_f413zh/pinmux.c
@@ -18,14 +18,6 @@
 	{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 950b1ab..17b36b3 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 d18f4e3..fc140b2 100644
--- a/boards/arm/nucleo_f429zi/pinmux.c
+++ b/boards/arm/nucleo_f429zi/pinmux.c
@@ -27,14 +27,6 @@
 	{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 706b5ad..9b77b34 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 1c9e158..a443c6a 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 b64bf01..253650b 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 2caa5ba..98ff3f6 100644
--- a/boards/arm/nucleo_f746zg/pinmux.c
+++ b/boards/arm/nucleo_f746zg/pinmux.c
@@ -35,14 +35,6 @@
 	{ 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 bef08ca..980e840 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 4b03d9b..818dd6b 100644
--- a/boards/arm/nucleo_f756zg/pinmux.c
+++ b/boards/arm/nucleo_f756zg/pinmux.c
@@ -35,14 +35,6 @@
 	{ 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 7ff0f94..b3ac9f2 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 4567199..036ab7e 100644
--- a/boards/arm/nucleo_f767zi/pinmux.c
+++ b/boards/arm/nucleo_f767zi/pinmux.c
@@ -35,14 +35,6 @@
 	{ 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 18fc146..80cbc6e 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 f33096f..e8c4484 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 acd0410..4fe9862 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 909da90..8ec2fed 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 ddb015b..dce8be3 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 95821e2..464b1ab 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 f2bcf44..e19335c 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 dcbf89a..2fb87e2 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 3a783f4..e07c981 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 cccfb81..871a5fd 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 87aaaf3..23ce712 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 7ed5118..11e383e 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 78c50d9..f617559 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 8ce429f..31d31cb 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 c4f8634..532e7b3 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 5dd678f..12d6596 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 020def9..42c7864 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 a14a184..ba4f6ad 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 b8cc263..c76d16d 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 e5d557b..cfab72d 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 d11c080..251b3f6 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 8d3bccd..ecdc160 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 fc678db..f94d093 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 7cc1688..31dd978 100644
--- a/boards/arm/olimexino_stm32/olimexino_stm32.dts
+++ b/boards/arm/olimexino_stm32/olimexino_stm32.dts
@@ -80,10 +80,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";
 	cs-gpios = <&gpiod 2 GPIO_ACTIVE_HIGH>;
 
diff --git a/boards/arm/olimexino_stm32/pinmux.c b/boards/arm/olimexino_stm32/pinmux.c
index ddbbf96..d43f47f 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 c0071e5..d2138b4 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 09973de..7370b16 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 b473443..e31b6f1 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 dc52bf6..f3a5b97 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 a24461e..ac4c0d7 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 ec802e9..55c7b83 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 b194bbe..e16191b 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 c4be661..543a6ae 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 4c286dd..d20a6c6 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 23f0b3a..821f934 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 aba67b2..e8bfd69 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 a4c0fe9..aa1ebab 100644
--- a/boards/arm/stm32f469i_disco/stm32f469i_disco.dts
+++ b/boards/arm/stm32f469i_disco/stm32f469i_disco.dts
@@ -79,6 +79,7 @@
 };
 
 &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 e382257..3f279bc 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 6775f2c..91ecdee 100644
--- a/boards/arm/stm32f723e_disco/stm32f723e_disco.dts
+++ b/boards/arm/stm32f723e_disco/stm32f723e_disco.dts
@@ -83,6 +83,7 @@
 };
 
 &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 5c71f58..582f03a 100644
--- a/boards/arm/stm32f746g_disco/pinmux.c
+++ b/boards/arm/stm32f746g_disco/pinmux.c
@@ -27,14 +27,6 @@
 	{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 1a59055..26864d6 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 c6d7788..cd59da0 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 ad7a99c..e5b073b 100644
--- a/boards/arm/stm32f769i_disco/stm32f769i_disco.dts
+++ b/boards/arm/stm32f769i_disco/stm32f769i_disco.dts
@@ -80,6 +80,7 @@
 };
 
 &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 53dd3fc..a553444 100644
--- a/boards/arm/stm32l1_disco/pinmux.c
+++ b/boards/arm/stm32l1_disco/pinmux.c
@@ -13,22 +13,6 @@
 #include <pinmux/stm32/pinmux_stm32.h>
 
 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 54affb9..6036224 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 aef4d7f..df2a17c 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 980e5f6..41d2a84 100644
--- a/boards/arm/stm32l496g_disco/stm32l496g_disco.dts
+++ b/boards/arm/stm32l496g_disco/stm32l496g_disco.dts
@@ -95,6 +95,7 @@
 };
 
 &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 1e83950..82adedd 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 a85b571..e2b44a1 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 26db47e..b241f1d 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 8562bed..3c8998b 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 7df5034..e9300a2 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 29fab04..eeff37e 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";
 };