Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: ethernet: stm32: add support for DT pinctrl #29246

Merged
merged 2 commits into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions boards/arm/nucleo_f207zg/nucleo_f207zg.dts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pb13>;
};

&dac1 {
Expand Down
13 changes: 0 additions & 13 deletions boards/arm/nucleo_f207zg/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@

/* pin assignments for NUCLEO-F207ZG board */
static const struct pin_config pinconf[] = {
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mac), okay) && CONFIG_NET_L2_ETHERNET
{STM32_PIN_PC1, STM32F2_PINMUX_FUNC_PC1_ETH},
{STM32_PIN_PC4, STM32F2_PINMUX_FUNC_PC4_ETH},
{STM32_PIN_PC5, STM32F2_PINMUX_FUNC_PC5_ETH},

{STM32_PIN_PA1, STM32F2_PINMUX_FUNC_PA1_ETH},
{STM32_PIN_PA2, STM32F2_PINMUX_FUNC_PA2_ETH},
{STM32_PIN_PA7, STM32F2_PINMUX_FUNC_PA7_ETH},

{STM32_PIN_PG11, STM32F2_PINMUX_FUNC_PG11_ETH},
{STM32_PIN_PG13, STM32F2_PINMUX_FUNC_PG13_ETH},
{STM32_PIN_PB13, STM32F2_PINMUX_FUNC_PB13_ETH},
#endif
#ifdef CONFIG_USB_DC_STM32
{STM32_PIN_PA11, STM32F2_PINMUX_FUNC_PA11_OTG_FS_DM},
{STM32_PIN_PA12, STM32F2_PINMUX_FUNC_PA12_OTG_FS_DP},
Expand Down
9 changes: 9 additions & 0 deletions boards/arm/nucleo_f429zi/nucleo_f429zi.dts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pb13>;
};

&flash0 {
Expand Down
13 changes: 0 additions & 13 deletions boards/arm/nucleo_f429zi/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@

/* pin assignments for NUCLEO-F429ZI board */
static const struct pin_config pinconf[] = {
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mac), okay) && CONFIG_NET_L2_ETHERNET
{STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_ETH},
{STM32_PIN_PC4, STM32F4_PINMUX_FUNC_PC4_ETH},
{STM32_PIN_PC5, STM32F4_PINMUX_FUNC_PC5_ETH},

{STM32_PIN_PA1, STM32F4_PINMUX_FUNC_PA1_ETH},
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_ETH},
{STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_ETH},

{STM32_PIN_PG11, STM32F4_PINMUX_FUNC_PG11_ETH},
{STM32_PIN_PG13, STM32F4_PINMUX_FUNC_PG13_ETH},
{STM32_PIN_PB13, STM32F4_PINMUX_FUNC_PB13_ETH},
#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},
Expand Down
20 changes: 16 additions & 4 deletions boards/arm/nucleo_f746zg/nucleo_f746zg.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#include <st/f7/stm32f746zgtx-pinctrl.dtsi>
#include "arduino_r3_connector.dtsi"

/*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and ETH_STM32_HAL.
* If you require both peripherals, and you do not need Arduino Uno v3
* comaptability, the pin PB5 (also on ST Zio connector) can be used
* for the SPI_1 MOSI signal.
*/

/ {
model = "STMicroelectronics STM32F746ZG-NUCLEO board";
compatible = "st,stm32f746zg-nucleo";
Expand Down Expand Up @@ -94,10 +101,6 @@
&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.
*/
status = "okay";
};

Expand Down Expand Up @@ -130,4 +133,13 @@

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pb13>;
};
19 changes: 1 addition & 18 deletions boards/arm/nucleo_f746zg/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,8 @@

#include <pinmux/stm32/pinmux_stm32.h>

/* NUCLEO-F746ZG pin configurations
*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and ETH_STM32_HAL.
* If you require both peripherals, and you do not need Arduino Uno v3
* comaptability, the pin PB5 (also on ST Zio connector) can be used
* for the SPI_1 MOSI signal.
*/
/* NUCLEO-F746ZG pin configurations */
static const struct pin_config pinconf[] = {
#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 },
{ STM32_PIN_PC5, STM32F7_PINMUX_FUNC_PC5_ETH },
{ STM32_PIN_PA1, STM32F7_PINMUX_FUNC_PA1_ETH },
{ STM32_PIN_PA2, STM32F7_PINMUX_FUNC_PA2_ETH },
{ STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_ETH },
{ STM32_PIN_PG11, STM32F7_PINMUX_FUNC_PG11_ETH },
{ STM32_PIN_PG13, STM32F7_PINMUX_FUNC_PG13_ETH },
{ STM32_PIN_PB13, STM32F7_PINMUX_FUNC_PB13_ETH },
#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 },
Expand Down
20 changes: 16 additions & 4 deletions boards/arm/nucleo_f756zg/nucleo_f756zg.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#include <st/f7/stm32f756zgtx-pinctrl.dtsi>
#include "arduino_r3_connector.dtsi"

/*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and ETH_STM32_HAL.
* If you require both peripherals, and you do not need Arduino Uno v3
* comaptability, the pin PB5 (also on ST Zio connector) can be used
* for the SPI_1 MOSI signal.
*/

/ {
model = "STMicroelectronics STM32F756ZG-NUCLEO board";
compatible = "st,stm32f756zg-nucleo";
Expand Down Expand Up @@ -94,13 +101,18 @@
&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.
*/
status = "okay";
};

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pb13>;
};
19 changes: 1 addition & 18 deletions boards/arm/nucleo_f756zg/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,8 @@

#include <pinmux/stm32/pinmux_stm32.h>

/* NUCLEO-F756ZG pin configurations
*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and ETH_STM32_HAL.
* If you require both peripherals, and you do not need Arduino Uno v3
* comaptability, the pin PB5 (also on ST Zio connector) can be used
* for the SPI_1 MOSI signal.
*/
/* NUCLEO-F756ZG pin configurations */
static const struct pin_config pinconf[] = {
#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 },
{ STM32_PIN_PC5, STM32F7_PINMUX_FUNC_PC5_ETH },
{ STM32_PIN_PA1, STM32F7_PINMUX_FUNC_PA1_ETH },
{ STM32_PIN_PA2, STM32F7_PINMUX_FUNC_PA2_ETH },
{ STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_ETH },
{ STM32_PIN_PG11, STM32F7_PINMUX_FUNC_PG11_ETH },
{ STM32_PIN_PG13, STM32F7_PINMUX_FUNC_PG13_ETH },
{ STM32_PIN_PB13, STM32F7_PINMUX_FUNC_PB13_ETH },
#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 },
Expand Down
16 changes: 16 additions & 0 deletions boards/arm/nucleo_f767zi/nucleo_f767zi.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
#include <st/f7/stm32f767zitx-pinctrl.dtsi>
#include "arduino_r3_connector.dtsi"

/*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and ETH_STM32_HAL.
* If you require both peripherals, and you do not need Arduino Uno v3
* comaptability, the pin PB5 (also on ST Zio connector) can be used
* for the SPI_1 MOSI signal.
*/

/ {
model = "STMicroelectronics STM32F767ZI-NUCLEO board";
compatible = "st,stm32f767zi-nucleo";
Expand Down Expand Up @@ -133,6 +140,15 @@

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pb13>;
};

&flash0 {
Expand Down
19 changes: 1 addition & 18 deletions boards/arm/nucleo_f767zi/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,8 @@

#include <pinmux/stm32/pinmux_stm32.h>

/* NUCLEO-F767ZI pin configurations
*
* WARNING: The pin PA7 will conflict on selection of SPI_1 and ETH_STM32_HAL.
* If you require both peripherals, and you do not need Arduino Uno v3
* comaptability, the pin PB5 (also on ST Zio connector) can be used
* for the SPI_1 MOSI signal.
*/
/* NUCLEO-F767ZI pin configurations */
static const struct pin_config pinconf[] = {
#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 },
{ STM32_PIN_PC5, STM32F7_PINMUX_FUNC_PC5_ETH },
{ STM32_PIN_PA1, STM32F7_PINMUX_FUNC_PA1_ETH },
{ STM32_PIN_PA2, STM32F7_PINMUX_FUNC_PA2_ETH },
{ STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_ETH },
{ STM32_PIN_PG11, STM32F7_PINMUX_FUNC_PG11_ETH },
{ STM32_PIN_PG13, STM32F7_PINMUX_FUNC_PG13_ETH },
{ STM32_PIN_PB13, STM32F7_PINMUX_FUNC_PB13_ETH },
#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 },
Expand Down
16 changes: 16 additions & 0 deletions boards/arm/nucleo_h745zi_q/nucleo_h745zi_q_m7.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
#include <st/h7/stm32h745zitx-pinctrl.dtsi>
#include "nucleo_h745zi_q.dtsi"

/*
* WARNING:
* Possible pin conflicts: The pins PA2 and PB13 may conflict on selection of
* ETH_STM32_HAL, since they are used in ST Zio or ST morpho connectors. To
* avoid conflicting states the jumpers JP6 and JP7 must be in ON state.
*/

/ {
model = "STMicroelectronics STM32H745ZI-Q-NUCLEO board";
compatible = "st,stm32h745zi-q-nucleo";
Expand Down Expand Up @@ -66,6 +73,15 @@

&mac {
status = "okay";
pinctrl-0 = <&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_crs_dv_pa7
&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pb13>;
};

&rng {
Expand Down
21 changes: 1 addition & 20 deletions boards/arm/nucleo_h745zi_q/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,8 @@

#include <pinmux/stm32/pinmux_stm32.h>

/* NUCLEO-F745ZI-Q pin configurations
*
* WARNING:
* Possible pin conflicts:
* The pins PA2 and PB13 may conflict on selection of ETH_STM32_HAL,
* since they are used in ST Zio or ST morpho connectors.
* To avoid conflicting states the jumpers JP6 and JP7
* must be in ON state.
*/
/* NUCLEO-F745ZI-Q pin configurations */
static const struct pin_config pinconf[] = {
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mac), okay) && CONFIG_NET_L2_ETHERNET
{ STM32_PIN_PA1, STM32H7_PINMUX_FUNC_PA1_ETH_REF_CLK },
{ STM32_PIN_PA2, STM32H7_PINMUX_FUNC_PA2_ETH_MDIO },
{ STM32_PIN_PA7, STM32H7_PINMUX_FUNC_PA7_ETH_CRS_DV },
{ STM32_PIN_PC1, STM32H7_PINMUX_FUNC_PC1_ETH_MDC },
{ STM32_PIN_PC4, STM32H7_PINMUX_FUNC_PC4_ETH_RXD0 },
{ STM32_PIN_PC5, STM32H7_PINMUX_FUNC_PC5_ETH_RXD1 },
{ STM32_PIN_PG11, STM32H7_PINMUX_FUNC_PG11_ETH_TX_EN },
{ STM32_PIN_PG13, STM32H7_PINMUX_FUNC_PG13_ETH_TXD0 },
{ STM32_PIN_PB13, STM32H7_PINMUX_FUNC_PB13_ETH_TXD1 },
#endif
};

static int pinmux_stm32_init(const struct device *port)
Expand Down
10 changes: 10 additions & 0 deletions boards/arm/olimex_stm32_e407/olimex_stm32_e407.dts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,14 @@ usb_otg2: &usbotg_hs {

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_col_pa3
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pg14>;
};
14 changes: 0 additions & 14 deletions boards/arm/olimex_stm32_e407/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@

/* pin assignments for OLIMEX-STM32-E407 board */
static const struct pin_config pinconf[] = {
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mac), okay) && CONFIG_NET_L2_ETHERNET
{STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_ETH},
{STM32_PIN_PC4, STM32F4_PINMUX_FUNC_PC4_ETH},
{STM32_PIN_PC5, STM32F4_PINMUX_FUNC_PC5_ETH},

{STM32_PIN_PA1, STM32F4_PINMUX_FUNC_PA1_ETH},
{STM32_PIN_PA2, STM32F4_PINMUX_FUNC_PA2_ETH},
{STM32_PIN_PA3, STM32F4_PINMUX_FUNC_PA3_ETH},
{STM32_PIN_PA7, STM32F4_PINMUX_FUNC_PA7_ETH},

{STM32_PIN_PG11, STM32F4_PINMUX_FUNC_PG11_ETH},
{STM32_PIN_PG13, STM32F4_PINMUX_FUNC_PG13_ETH},
{STM32_PIN_PG14, STM32F4_PINMUX_FUNC_PG14_ETH},
#endif
#ifdef CONFIG_USB_DC_STM32
#if DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_otgfs), okay)
{STM32_PIN_PA11, STM32F4_PINMUX_FUNC_PA11_OTG_FS_DM},
Expand Down
13 changes: 0 additions & 13 deletions boards/arm/stm32f746g_disco/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@

/* pin assignments for STM32F746G-DISCO board */
static const struct pin_config pinconf[] = {
#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},
{STM32_PIN_PC5, STM32F7_PINMUX_FUNC_PC5_ETH},

{STM32_PIN_PA1, STM32F7_PINMUX_FUNC_PA1_ETH},
{STM32_PIN_PA2, STM32F7_PINMUX_FUNC_PA2_ETH},
{STM32_PIN_PA7, STM32F7_PINMUX_FUNC_PA7_ETH},

{STM32_PIN_PG11, STM32F7_PINMUX_FUNC_PG11_ETH},
{STM32_PIN_PG13, STM32F7_PINMUX_FUNC_PG13_ETH},
{STM32_PIN_PG14, STM32F7_PINMUX_FUNC_PG14_ETH},
#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},
Expand Down
9 changes: 9 additions & 0 deletions boards/arm/stm32f746g_disco/stm32f746g_disco.dts
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,13 @@

&mac {
status = "okay";
pinctrl-0 = <&eth_mdc_pc1
&eth_rxd0_pc4
&eth_rxd1_pc5
&eth_ref_clk_pa1
&eth_mdio_pa2
&eth_crs_dv_pa7
&eth_tx_en_pg11
&eth_txd0_pg13
&eth_txd1_pg14>;
};
Loading