Skip to content

Conversation

@marwaiehm-st
Copy link
Contributor

@marwaiehm-st marwaiehm-st commented Mar 24, 2025

Add ethernet node of stm32n6570_dk
Integrate GRMII and RMII interfaces

Based on this PR: #87593

@marwaiehm-st marwaiehm-st force-pushed the upstream_eth_disco_n6 branch 3 times, most recently from 264dc7a to 091627e Compare March 24, 2025 13:32
@maass-hamburg
Copy link
Member

maass-hamburg commented Mar 24, 2025

instead of using and extending the internal eth_phy_get_link_state(), maybe use the phy_get_link_state() or even phy_link_callback_set() from the ethernet phy api. The later also has the benefit, that autonegation can be done on every change of the link not just on startup. the internal eth_phy_get_link_state() could still be used for the one that don't have a st,stm32-mdio

@maass-hamburg
Copy link
Member

the st,stm32-mdio also uses only HAL_ETH_ReadPHYRegister() and HAL_ETH_WritePHYRegister() internally, like eth_phy_get_link_state(). That means, that eth_phy_get_link_state() can be fully replaced by the use of the ethernet phy api. It just have to make sure, that all soc, that select ETH_STM32_HAL_API_V2 also get the st,stm32-mdio dev. And all boards the also the generic ethernet-phy.

@maass-hamburg
Copy link
Member

started something like I described there: #87593

@marwaiehm-st marwaiehm-st force-pushed the upstream_eth_disco_n6 branch 2 times, most recently from ee39d6c to 6d119f4 Compare March 26, 2025 14:44
@marwaiehm-st marwaiehm-st marked this pull request as ready for review March 26, 2025 15:56
@marwaiehm-st marwaiehm-st added the DNM This PR should not be merged (Do Not Merge) label Mar 26, 2025
@pillo79 pillo79 assigned erwango and unassigned pillo79 Mar 27, 2025
@marwaiehm-st marwaiehm-st force-pushed the upstream_eth_disco_n6 branch from 6d119f4 to 3656cfe Compare March 27, 2025 14:33
@marwaiehm-st marwaiehm-st force-pushed the upstream_eth_disco_n6 branch 3 times, most recently from 3238878 to 3197859 Compare March 27, 2025 15:05
@marwaiehm-st marwaiehm-st force-pushed the upstream_eth_disco_n6 branch from 3197859 to a016e40 Compare March 28, 2025 13:29
@github-actions github-actions bot added the Release Notes To be mentioned in the release notes label Mar 28, 2025
@maass-hamburg
Copy link
Member

@marwaiehm-st please rebase to current main, now that #87593 is merged

@marwaiehm-st marwaiehm-st force-pushed the upstream_eth_disco_n6 branch from a016e40 to 51bdac7 Compare April 2, 2025 08:57
@marwaiehm-st marwaiehm-st removed the DNM This PR should not be merged (Do Not Merge) label Apr 2, 2025
@marwaiehm-st marwaiehm-st requested a review from erwango April 2, 2025 12:10
@decsny decsny removed their request for review April 2, 2025 15:57
@marwaiehm-st marwaiehm-st force-pushed the upstream_eth_disco_n6 branch from 09b9496 to 44f863d Compare April 3, 2025 20:46
Comment on lines 95 to 99
((DT_ENUM_HAS_VALUE(node_id, phy_connection_type, mii) ? ETH_MII_MODE : \
(DT_ENUM_HAS_VALUE(node_id, phy_connection_type, rmii) ? ETH_RMII_MODE : \
(DT_ENUM_HAS_VALUE(node_id, phy_connection_type, gmii) ? ETH_GMII_MODE : \
(DT_ENUM_HAS_VALUE(node_id, phy_connection_type, rgmii) ? ETH_RGMII_MODE : \
ETH_RMII_MODE)))))
Copy link
Member

@erwango erwango Apr 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since property is required, there is no need to default to ETH_RMII_MODE since there's already a check on ETH_RMII_MODE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, we must have a default, so I deleted the check on RMII and kept the default.

Add the Ethernet MAC and MDIO nodes in the device tree.
Add Kconfig for Ethernet Support.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <[email protected]>
- Added macros `STM32_ETH_PHY_MODE`
  to determine the PHY mode (RGMII, GMII, RMII, and MII)
  from the `phy_connection_type` property in the device tree.
- Removed previous definitions for ETH_MEDIA_INTERFACE_MII
  and ETH_MEDIA_INTERFACE_RMII.
- Updated STM32_ETH_PHY_MODE macro to use ETH_MII_MODE
  and ETH_RMII_MODE.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <[email protected]>
@kartben kartben merged commit 8db8591 into zephyrproject-rtos:main Apr 4, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Ethernet area: MDIO platform: STM32 ST Micro STM32 Release Notes To be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants