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 initial ksz9477 switch support #10503

Merged

Conversation

jlaitine
Copy link
Contributor

@jlaitine jlaitine commented Sep 7, 2023

Summary

This adds an initial management driver for ksz9477 ethernet switch, and takes it into use in mpfs platform.

Implemented so far:

  • I2C interface for switch management, basic register read and write functions and related HW errata
  • Basic initialization code with chip detection
  • Configure the switches' SGMII interface into PHY mode, if the host MAC is connected directly to the SGMII port of the switch
  • Taken the initialization into use in mpfs ethernet driver, added configuration flags for MPFS to use instead of a standard MDIO PHY

Impact

This allows using ksz9477 switch to be used instead of an ethernet phy, allowing to make a network device with multiple ports

Testing

Tested on a custom HW design where Microchip PolarFire SOC is connected via SGMII and I2C to the switch ASIC.

drivers/net/ksz9477_i2c.c Outdated Show resolved Hide resolved
drivers/net/ksz9477_i2c.c Outdated Show resolved Hide resolved
drivers/net/ksz9477_i2c.c Outdated Show resolved Hide resolved
drivers/net/ksz9477.c Outdated Show resolved Hide resolved
arch/risc-v/src/mpfs/mpfs_ethernet.c Outdated Show resolved Hide resolved
@jlaitine jlaitine force-pushed the Add_initial_ksz9477_switch_support branch from 89fba66 to a870033 Compare September 7, 2023 19:19
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
@jlaitine jlaitine force-pushed the Add_initial_ksz9477_switch_support branch from a870033 to c745e6d Compare September 7, 2023 19:24
@jlaitine
Copy link
Contributor Author

jlaitine commented Sep 8, 2023

Seems that I screwed up something with mpfs_ethernet, while merging accross branches. I'll check that again

This adds initialization of the ksz9477 switch when used instead of
a PHY, directly connected to SGMII

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
@jlaitine jlaitine force-pushed the Add_initial_ksz9477_switch_support branch from c745e6d to a470eed Compare September 8, 2023 06:17
@jlaitine
Copy link
Contributor Author

jlaitine commented Sep 8, 2023

Seems that I screwed up something with mpfs_ethernet, while merging accross branches. I'll check that again

Now it is good again.

@xiaoxiang781216 xiaoxiang781216 merged commit a6388b8 into apache:master Sep 8, 2023
23 of 26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.3.0 Sep 26, 2023
@jerpelea jerpelea moved this from To-Add to drivers in Release Notes - 12.3.0 Sep 27, 2023
@jerpelea jerpelea moved this from drivers to done in Release Notes - 12.3.0 Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants