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

Ethernet: Add support stm32n6570_dk #87562

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

marwaiehm-st
Copy link
Collaborator

@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
Collaborator

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
Collaborator

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
Collaborator

started something like I described there: #87593

add mdio for legacy stm32 api

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The api takes care, if the mdio bus_enable and bus_disable
are not needed, so there is no need to have tis in the driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
add mdio and phy node to every stm32board that
supports ethernet.
Also set the phy-handle for every ethernet mac.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
mac and mdio are now on the same level, this way
phy-handle can be used.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
@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 4 times, most recently from 3238878 to 3197859 Compare March 27, 2025 15:05
<&rcc STM32_CLOCK(AHB1, 28U)>;
status = "disabled";
compatible = "st,stm32-ethernet-parent";
clock-names = "stmmaceth";
Copy link
Member

Choose a reason for hiding this comment

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

Nit: if this clock is remove from mac, then following would be more suited:

Suggested change
clock-names = "stmmaceth";
clock-names = "stm-eth";

This would likely require driver update.

Copy link
Collaborator

Choose a reason for hiding this comment

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

changed in #87593

Copy link
Member

Choose a reason for hiding this comment

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

:-D commented in the wrong PR

maass-hamburg and others added 7 commits March 28, 2025 09:13
move stmmaceth clock to parent, so it can also be
used by mdio and rename it to ``stm-eth``.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
rewirte code and remove code that use internal phy functions.
A few Kconfig options got removed, that are now set by the
phy via the DT.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
make stm32 mdio driver more independent

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
unfortunatly HAL_ETH_SetMDIOClockRange() isn't available
in the V1 API, so I had to copy the parts from the hal.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
update migration guide for changes of the
stm32 ethernet driver.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Add the Ethernet MAC and MDIO nodes in the device tree.
Add Kconfig for Ethernet Support.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
 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.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Ethernet area: MDIO DNM This PR should not be merged (Do Not Merge) 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.

4 participants