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

Add clause 45 MDIO read/write #202

Closed

Conversation

spectrum70
Copy link

Hi,

working on adding some stm32 PHY chip drivers into Zephyr, i.e. adin1100, (patch in progress) and MDIO Clause 45 is a "nice to have" feature.

From some checks, h7 family (and h5, or likely f7 too) supports HW Clause 45 implementation (inside ETH IP module). Not clear why it has never been added to stm32cube HAL. This patch adds the c45 support.

Add clause 45 support for h7.

Signed-off-by: Angelo Dureghello <[email protected]>
@spectrum70 spectrum70 changed the title Add clause 45 MDIO read Add clause 45 MDIO read/write Mar 28, 2024
@spectrum70
Copy link
Author

I can eventually add the same for h5 and f, but i can't test on those mcus since i only have a h723 nucleo board actually.

@spectrum70
Copy link
Author

spectrum70 commented Mar 28, 2024

Below a brief unit test i did

[00:00:00.001,000] <inf> phy_mii: PHY (0) ID 283BC81

[00:00:00.002,000] <inf> phy_mii: PHY (0) 2.4V mode supported
[00:00:00.002,000] <inf> phy_mii: PHY (0) 2.4V mode disabled
[00:00:00.002,000] <inf> phy_mii: PHY (0) Link is up
[00:00:00.002,000] <inf> phy_mii: PHY (0) Link speed 10 Mb, full duplex

*** Booting Zephyr OS build v3.6.0-1839-gfe345be83640 ***
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 MDIO read ...
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 MDIO read -ok-
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 MDIO write ...
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 MDIO write -ok-
[00:00:00.003,000] <dbg> net_stats_sample: main: C45 MDIO read ...
[00:00:00.003,000] <dbg> net_stats_sample: main: C45 MDIO read -ok-
[00:00:00.003,000] <dbg> net_stats_sample: main: C45 MDIO write ...
[00:00:00.003,000] <dbg> net_stats_sample: main: C45 MDIO write -ok-
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 PHY read ...
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 PHY read -ok-
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 PHY write ...
[00:00:00.003,000] <dbg> net_stats_sample: main: C22 PHY write -ok-
[00:00:01.003,000] <dbg> net_stats_sample: main: Getting link state, should be up now ...
[00:00:01.003,000] <dbg> net_stats_sample: main: Link state ... UP
[00:00:01.003,000] <dbg> net_stats_sample: main: Test completed \o/

@erwango
Copy link
Member

erwango commented Apr 2, 2024

@spectrum70 Thanks for this change but we don't merge new features in this fork. However, you can submit them in https://github.com/STMicroelectronics/STM32CubeH7. If approved, we can merge them here.

@spectrum70
Copy link
Author

@erwango
thanks, i will try.
AFAYK, if i cannot have ST to accept such change, can i implement the feature by direct register access in our driver ?

@erwango
Copy link
Member

erwango commented Apr 2, 2024

AFAYK, if i cannot have ST to accept such change, can i implement the feature by direct register access in our driver ?

Well, indeed, if HAL support is not possible, we'll need to find a way to integrate it in Zephyr driver.

@erwango
Copy link
Member

erwango commented Jul 30, 2024

@spectrum70 Is this PR still active ?

@erwango
Copy link
Member

erwango commented Sep 2, 2024

@spectrum70 Is this PR still relevant ?
(I'm setting DNM until I hear back from you to avoid any mistake)

@erwango erwango added the DNM label Sep 2, 2024
@erwango
Copy link
Member

erwango commented Oct 10, 2024

@spectrum70 Closing. Please re-open if required

@erwango erwango closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants