Skip to content

Commit 045d050

Browse files
sean-anderson-secodavem330
authored andcommitted
dt-bindings: net: fman: Add additional interface properties
At the moment, mEMACs are configured almost completely based on the phy-connection-type. That is, if the phy interface is RGMII, it assumed that RGMII is supported. For some interfaces, it is assumed that the RCW/bootloader has set up the SerDes properly. This is generally OK, but restricts runtime reconfiguration. The actual link state is never reported. To address these shortcomings, the driver will need additional information. First, it needs to know how to access the PCS/PMAs (in order to configure them and get the link status). The SGMII PCS/PMA is the only currently-described PCS/PMA. Add the XFI and QSGMII PCS/PMAs as well. The XFI (and 10GBASE-KR) PCS/PMA is a c45 "phy" which sits on the same MDIO bus as SGMII PCS/PMA. By default they will have conflicting addresses, but they are also not enabled at the same time by default. Therefore, we can let the XFI PCS/PMA be the default when phy-connection-type is xgmii. This will allow for backwards-compatibility. QSGMII, however, cannot work with the current binding. This is because the QSGMII PCS/PMAs are only present on one MAC's MDIO bus. At the moment this is worked around by having every MAC write to the PCS/PMA addresses (without checking if they are present). This only works if each MAC has the same configuration, and only if we don't need to know the status. Because the QSGMII PCS/PMA will typically be located on a different MDIO bus than the MAC's SGMII PCS/PMA, there is no fallback for the QSGMII PCS/PMA. Signed-off-by: Sean Anderson <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 00af103 commit 045d050

File tree

2 files changed

+43
-15
lines changed

2 files changed

+43
-15
lines changed

Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,39 @@ properties:
8585
$ref: /schemas/types.yaml#/definitions/phandle
8686
description: A reference to the IEEE1588 timer
8787

88+
phys:
89+
description: A reference to the SerDes lane(s)
90+
maxItems: 1
91+
92+
phy-names:
93+
items:
94+
- const: serdes
95+
8896
pcsphy-handle:
89-
$ref: /schemas/types.yaml#/definitions/phandle
90-
description: A reference to the PCS (typically found on the SerDes)
97+
$ref: /schemas/types.yaml#/definitions/phandle-array
98+
minItems: 1
99+
maxItems: 3
100+
deprecated: true
101+
description: See pcs-handle.
102+
103+
pcs-handle:
104+
minItems: 1
105+
maxItems: 3
106+
description: |
107+
A reference to the various PCSs (typically found on the SerDes). If
108+
pcs-handle-names is absent, and phy-connection-type is "xgmii", then the first
109+
reference will be assumed to be for "xfi". Otherwise, if pcs-handle-names is
110+
absent, then the first reference will be assumed to be for "sgmii".
111+
112+
pcs-handle-names:
113+
minItems: 1
114+
maxItems: 3
115+
items:
116+
enum:
117+
- sgmii
118+
- qsgmii
119+
- xfi
120+
description: The type of each PCS in pcsphy-handle.
91121

92122
tbi-handle:
93123
$ref: /schemas/types.yaml#/definitions/phandle
@@ -100,6 +130,10 @@ required:
100130
- fsl,fman-ports
101131
- ptp-timer
102132

133+
dependencies:
134+
pcs-handle-names:
135+
- pcs-handle
136+
103137
allOf:
104138
- $ref: ethernet-controller.yaml#
105139
- if:
@@ -110,14 +144,6 @@ allOf:
110144
then:
111145
required:
112146
- tbi-handle
113-
- if:
114-
properties:
115-
compatible:
116-
contains:
117-
const: fsl,fman-memac
118-
then:
119-
required:
120-
- pcsphy-handle
121147

122148
unevaluatedProperties: false
123149

@@ -138,8 +164,9 @@ examples:
138164
reg = <0xe8000 0x1000>;
139165
fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>;
140166
ptp-timer = <&ptp_timer0>;
141-
pcsphy-handle = <&pcsphy4>;
142-
phy-handle = <&sgmii_phy1>;
143-
phy-connection-type = "sgmii";
167+
pcs-handle = <&pcsphy4>, <&qsgmiib_pcs1>;
168+
pcs-handle-names = "sgmii", "qsgmii";
169+
phys = <&serdes1 1>;
170+
phy-names = "serdes";
144171
};
145172
...

Documentation/devicetree/bindings/net/fsl-fman.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,9 @@ For internal PHY device on internal mdio bus, a PHY node should be created.
320320
See the definition of the PHY node in booting-without-of.txt for an
321321
example of how to define a PHY (Internal PHY has no interrupt line).
322322
- For "fsl,fman-mdio" compatible internal mdio bus, the PHY is TBI PHY.
323-
- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY,
324-
PCS PHY addr must be '0'.
323+
- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY.
324+
The PCS PHY address should correspond to the value of the appropriate
325+
MDEV_PORT.
325326

326327
EXAMPLE
327328

0 commit comments

Comments
 (0)