-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
driver: ethernet: add adin2111 #57848
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5ad982c
to
bee76c1
Compare
Adds initial ADIN2111 2-Port 10BASE-T1L (SPE) switch support. Works over SPI. The driver creates 2 interfaces, 1 per port (PHY). Configures multicast and broadcast filters. The same unicast is applied to both ports. Supports: - Link state detection - CRC enable/disable - Ports config set - Ports ETH stats Provides functions for MDIO driver. Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
Adds MDIO driver. Works via exposed ADIN2111 functions. It is possible to access Clause 45 and 22 registers. Due to MDIO API limitation Clause 45 access is done using driver specific MDIO functions. Provides API and functions for PHY driver. Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
Adds supprot of ADIN2111 MDIO. The shell allows to access Clause 22 registers. Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
Adds PHY driver. Works via MDIO API and exposed ADIN2111 MDIO Clause 45 functions. Link status detection is triggered by ADIN2111 driver within offloaded IRQ handler. Supports: - LED0, LED1 enable/disable - Fatal HW error detection - AN 2.4V tx mode enable/disable The initialization order is important. PHY 2 must be initialized after PHY1. Therefore, it shall be defined after the 1st one in the devicetree. Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
rlubos
approved these changes
May 26, 2023
nashif
approved these changes
May 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds initial ADIN2111 2-Port 10BASE-T1L (Single Pair Ethernet [SPE]) switch support (implementation wise not really a switch). It works over SPI using ADI Generic SPI protocol instead of OPEN Alliance.
SPE:
ADIN2111 overview:
The driver creates 2 eth interfaces, one for each port (PHY). Didn't use DSA as I am not sure if it fits.
It configures multicast and broadcast reception and forwarding.
Supports:
Where MDIO uses exposed functions of the main driver. PHY utilizes MDIO API and exposed MDIO
functions to access Clause 45 registers.*
This PR doesn't modify existing APIs to not be intrusive. At the same time, the goal was to make use
of existing MDIO and PHY APIs.
Tested on custom hardware.
The existing MDIO API is very restrictive. Currently, MDIO API doesn't support Clause 45 and Clause 22 at the same time. It exposes
read
andwrite
calls that are either Clause 45 or Clause 22. However, for C45 it misses the device address from the function definition. Not sure how Clause 45 works for others there.The PHY driver shall access registers over MDIO via Clause 45 and Clause 22.
That can be solved by the introduction of specific Clause 22 and Clause 45 functions into MDIO. This would allow us not to touch the existing API but still support other cases. The alternative is to modify read and write register API functions and change reg. address type to
uint32_t
to integrate the device and register address in it. However, the Linux kernel went away from that approach.Another point relates to MDIO locking. I would like to lock the whole device while MDIO is in use by the public (i.e. shell). That allows it to prevent access while it processes frame transfer, IRQ offload, or something else where sequential access to MDIO is required.
The current API doesn't provide a way to lock/unlock the MDIO bus. However, there are the
enable
anddisable
calls.I avoided API modification proposals at this stage and implemented
enable
anddisable
as device lock/unlock. That works. However, I assume the meaning behindenable
anddisable
won't be correct.Should MDIO API be revised/revisited?
@gmarull, @henrikbrixandersen I hope
select
anddepends on
are not messed up.Open for review, suggestions, comments.