Fix SC59x Ethernet PHY descriptions#3444
Conversation
|
I will test it on the hardware and mark it as ready for review afterwards, changes themselves are fairly straightforward. |
|
I tested the changes on the U-Boot side first since it was easier to validate for me 😛. I also found that the U-Boot ADIN PHY driver was outdated or old bit and did not register ADIN1200 support. I updated the driver to support things we need and align Linux driver. The U-Boot pull request is available here: |
LLM reviewThis series migrates the SC594 and SC598 Ethernet device-tree nodes from stale TI DP83867/DP83848 descriptions to the correct ADI ADIN1300/ADIN1200 PHYs, moves reset management from GPIO hogs to run: 29704096847
|
| adin1200: ethernet-phy@1 { | ||
| compatible = "ethernet-phy-ieee802.3-c22"; | ||
| reg = <1>; | ||
| adi,fifo-depth-bits = <8>; |
There was a problem hiding this comment.
I get that the default is 8, but what's the point of adding this explicitly? just curious.
There was a problem hiding this comment.
I added it only to make the RMII configuration explicit, just to make it seen when someone just check the devicetree.
There was a problem hiding this comment.
I think RMII is clear from the &emac1 :: phy-mode = "rmii" property.
I would advise not to explicitly fill this property in unless you can explain why a FIFO of 8 as opposed to, say, 16, is somehow preferable.
If omitted, it's clear to me as a reader that no particular thought went into the FIFO config.
If I see FIFO size = 8, I imagine there must be a specific reason.
Filling in what is already default is not a specific reason IMO, and potentially misleading as it suggests somebody thought "it really must be this value and not another".
There was a problem hiding this comment.
Yes, for the same reason I also removed the internal delays since they were also the default value for "rgmii-id" mode.
| reset-assert-us = <10000>; | ||
| reset-deassert-us = <5000>; | ||
| adi,rx-internal-delay-ps = <2000>; | ||
| adi,tx-internal-delay-ps = <2000>; |
There was a problem hiding this comment.
when you say "documented" 2 ns delay applied by the PHY, where is this documented?
There was a problem hiding this comment.
Will refer to the documents in commit messages.
There was a problem hiding this comment.
I also removed these delays since they are also default in rgmii-id mode, as fifo-depth-bits for rmii.
The SC598 EZKIT connects emac0 to an ADIN1300, not a DP83867. Replace the stale PHY description and remove the DP83867-specific properties. Move the reset GPIO out of its GPIO hog so the PHY driver controls reset. The ADIN1300 data sheet, Table 3, requires RESET_N to be asserted for at least 10 us. It also specifies a 5 ms delay before MDIO registers are accessible after reset deassertion. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Move the ADIN1300 reset GPIO out of its GPIO hog so the PHY driver controls reset. The ADIN1300 data sheet, Table 3, requires RESET_N to be asserted for at least 10 us. It also specifies a 5 ms delay before MDIO registers are accessible after reset deassertion. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Describe the ADIN1200 RMII PHY and MDIO bus connected to emac1. Keep the interface disabled because its board routing is shared with USB0. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Move the EZKIT and EZLITE ADIN1300 reset GPIOs out of GPIO hogs so the PHY driver controls reset. The ADIN1300 data sheet, Table 3, requires RESET_N to be asserted for at least 10 us. It also specifies a 5 ms delay before MDIO registers are accessible after reset deassertion. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
The SC594 EZKIT connects emac0 to an ADIN1300 and emac1 to an ADIN1200. Replace the stale DP83867 and DP83848 descriptions with the corresponding ADIN PHY nodes and remove the unused DP83867 binding. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
Enable the ADIN PHY driver for the SC594 and SC598 board defconfigs. The board device trees use ADIN1300 and ADIN1200 PHYs; remove the obsolete TI PHY selections from the SC594 defconfigs. Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
| dp83867: ethernet-phy@0 { | ||
| adin1300: ethernet-phy@0 { |
There was a problem hiding this comment.
newline above node names (previous comment was a general one to be applied everywhere)
| @@ -175,6 +168,9 @@ | |||
| #size-cells = <0>; | |||
| adin1300: ethernet-phy@0 { | |||
There was a problem hiding this comment.
since it's not part of your PR diff, no need to fix the missing newline here IMO
| pinctrl-0 = <ð1_default>; | ||
|
|
||
| /* USB0 and ETH1 share board wiring; keep ETH1 disabled by default. */ | ||
|
|
There was a problem hiding this comment.
I would drop the intermediate newline between comment and status, but you can ignore this comment if you're too lazy
| #size-cells = <0>; | ||
|
|
||
| adin1200: ethernet-phy@1 { | ||
| compatible = "ethernet-phy-ieee802.3-c22"; |
There was a problem hiding this comment.
the generic compatible isn't needed for c22, and the maintainer actually prefers it be omitted, cf. https://lore.kernel.org/all/c7fe0371-76bc-4cb4-ade8-e22112c1475d@lunn.ch/
| dp83848: ethernet-phy@1 { | ||
|
|
||
| adin1200: ethernet-phy@1 { | ||
| compatible = "ethernet-phy-ieee802.3-c22"; |
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
| dp83867: ethernet-phy@0 { | ||
| adin1300: ethernet-phy@0 { |
| snps,reset-active-low; | ||
| snps,reset-delays-us = <0 200 500>; | ||
| phy-handle = <&dp83867>; | ||
| phy-handle = <&adin1300>; |
There was a problem hiding this comment.
would be nice to keep order of properties consistent across device trees
|
|
||
| &emac1 { | ||
| phy-handle = <&dp83848>; | ||
| phy-handle = <&adin1200>; |
There was a problem hiding this comment.
just my 2c here, but the commits are a bit confusingly structured IMO. in one commit you rename the label from dp83848 to adin1200, but you only update this phandle in the following commit. I don't really see the point. I would suggest to just have commits like:
- "describe the EMAC1 PHY" (where you're adding new PHY)
- "describe the EMAC0 PHY properly" (where you're changing from TI to ADI PHYs)
(on a per-board basis)
and in both cases, put the phy-handles and reset-gpios/timings in the relevant commit.
Resolves #2883