@@ -80,9 +80,18 @@ static const struct device *eth_stm32_phy_dev = DEVICE_DT_GET(DT_INST_PHANDLE(0,
80
80
81
81
#define MAC_NODE DT_NODELABEL(mac)
82
82
83
+ #if DT_HAS_COMPAT_STATUS_OKAY (st_stm32n6_ethernet )
84
+ #define STM32_ETH_PHY_MODE (node_id ) \
85
+ ((DT_ENUM_HAS_VALUE(node_id, phy_connection_type, mii) ? HAL_ETH_MII_MODE : \
86
+ (DT_ENUM_HAS_VALUE(node_id, phy_connection_type, rmii) ? HAL_ETH_RMII_MODE : \
87
+ (DT_ENUM_HAS_VALUE(node_id, phy_connection_type, gmii) ? HAL_ETH_GMII_MODE : \
88
+ (DT_ENUM_HAS_VALUE(node_id, phy_connection_type, rgmii) ? HAL_ETH_RGMII_MODE : \
89
+ HAL_ETH_RMII_MODE)))))
90
+ #else
83
91
#define STM32_ETH_PHY_MODE (node_id ) \
84
92
(DT_ENUM_HAS_VALUE(node_id, phy_connection_type, mii) ? \
85
93
ETH_MEDIA_INTERFACE_MII : ETH_MEDIA_INTERFACE_RMII)
94
+ #endif
86
95
87
96
#define ETH_DMA_TX_TIMEOUT_MS 20U /* transmit timeout in milliseconds */
88
97
@@ -1138,7 +1147,12 @@ static void set_mac_config(const struct device *dev, struct phy_link_state *stat
1138
1147
mac_config .DuplexMode =
1139
1148
PHY_LINK_IS_FULL_DUPLEX (state -> speed ) ? ETH_FULLDUPLEX_MODE : ETH_HALFDUPLEX_MODE ;
1140
1149
1141
- mac_config .Speed = PHY_LINK_IS_SPEED_100M (state -> speed ) ? ETH_SPEED_100M : ETH_SPEED_10M ;
1150
+ mac_config .Speed =
1151
+ #if DT_HAS_COMPAT_STATUS_OKAY (st_stm32n6_ethernet )
1152
+ PHY_LINK_IS_SPEED_1000M (state -> speed ) ? ETH_SPEED_1000M :
1153
+ #endif
1154
+ PHY_LINK_IS_SPEED_100M (state -> speed ) ? ETH_SPEED_100M : ETH_SPEED_10M ;
1155
+
1142
1156
1143
1157
hal_ret = HAL_ETH_SetMACConfig (heth , & mac_config );
1144
1158
if (hal_ret != HAL_OK ) {
@@ -1476,7 +1490,9 @@ static const struct eth_stm32_hal_dev_cfg eth0_config = {
1476
1490
};
1477
1491
1478
1492
BUILD_ASSERT (DT_ENUM_HAS_VALUE (MAC_NODE , phy_connection_type , mii ) ||
1479
- DT_ENUM_HAS_VALUE (MAC_NODE , phy_connection_type , rmii ),
1493
+ DT_ENUM_HAS_VALUE (MAC_NODE , phy_connection_type , rmii ) ||
1494
+ DT_ENUM_HAS_VALUE (MAC_NODE , phy_connection_type , rgmii ) ||
1495
+ DT_ENUM_HAS_VALUE (MAC_NODE , phy_connection_type , gmii ),
1480
1496
"Unsupported PHY connection type selected" );
1481
1497
1482
1498
static struct eth_stm32_hal_dev_data eth0_data = {
0 commit comments