Skip to contentSkip to conversation

TQ-Systems TQMa62xx SoM and MBa62xx board

PATCH Superseded Matthias Schiffer 5 participants 20 messages Dec 9, 2024 – Mar 19, 2025

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover TQ-Systems TQMa62xx SoM and MBa62xx board

This adds Device Trees for out AM62x-based SoM TQMa62xx and its reference carrier board MBa62xx.

Two of the patches are adapted from the TI vendor repo ti-linux-kernel to add RemoteProc/RPMsg support for the R5F core. A similar patch has been submitted for mainline by TI themselves for the closely related AM62A SoC.

Not yet included are overlays to enable LVDS display output and MIPI-CSI camera input.

Changes in v2:
- Collected acks and reviews
- Rebased onto v6.13-rc1

Devarsh Thakkar (1):
arm64: dts: ti: k3-am62: Add DM R5 ranges in cbass

Hari Nagalla (1):
arm64: dts: ti: k3-am62-wakeup: Add R5F device node

Matthias Schiffer (3):
dt-bindings: usb: dwc3: Allow connector in USB controller node
dt-bindings: arm: ti: Add compatible for AM625-based TQMa62xx SOM
family and carrier board
arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board
Device Trees

 .../devicetree/bindings/arm/ti/k3.yaml        |   7 +
 .../devicetree/bindings/usb/snps,dwc3.yaml    |   6 +
 arch/arm64/boot/dts/ti/Makefile               |   1 +
 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi    |  24 +
 arch/arm64/boot/dts/ti/k3-am62.dtsi           |   8 +-
 .../boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts | 917 ++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am625-tqma62xx.dtsi | 346 +++++++
 7 files changed, 1307 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625-tqma62xx.dtsi
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#1 lore raw

PATCH v2 1/5 dt-bindings: usb: dwc3: Allow connector in USB controller node

Allow specifying the connector directly in the USB controller node, as supported by other USB controller bindings.

---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/usb/snps,dwc3.yaml +6 -0
index 1cd0ca90127d9..2976fb1a58061 100644
@@ -68,6 +68,12 @@ properties:
         - enum: [bus_early, ref, suspend]
         - true
 
+  connector:
+    $ref: /schemas/connector/usb-connector.yaml#
+    description: Connector for dual role switch
+    type: object
+    unevaluatedProperties: false
+
   dma-coherent: true
 
   extcon:
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
maintainer
#2 lore raw

Re: [PATCH v2 1/5] dt-bindings: usb: dwc3: Allow connector in USB controller node

Quoted 16 lines · Matthias Schiffer

Allow specifying the connector directly in the USB controller node, as supported by other USB controller bindings.

---
 Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/usb/snps,dwc3.yaml +0 -0
index 1cd0ca90127d9..2976fb1a58061 100644
@@ -68,6 +68,12 @@ properties:
         - enum: [bus_early, ref, suspend]
         - true

Documentation/devicetree/bindings/usb/snps,dwc3.yaml properties: · line 79

Quoted 10 lines
Documentation/devicetree/bindings/usb/snps,dwc3.yaml +6 -0
 
+  connector:
+    $ref: /schemas/connector/usb-connector.yaml#
+    description: Connector for dual role switch
+    type: object
+    unevaluatedProperties: false
+
   dma-coherent: true
 
   extcon:

This needs to go via the USB subsystem team. The device tree changes can go once this is merged.

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#3 lore raw

PATCH v2 2/5 dt-bindings: arm: ti: Add compatible for AM625-based TQMa62xx SOM family and carrier board

In reply to Matthias Schiffer

The TQMa62xx is a SoM family with a pluggable connector. The MBa62xx is the matching reference/starterkit carrier board.

---
 Documentation/devicetree/bindings/arm/ti/k3.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/ti/k3.yaml +7 -0
index 18f155cd06c84..07d98a67d967f 100644
@@ -75,6 +75,13 @@ properties:
           - const: toradex,verdin-am62          # Verdin AM62 Module
           - const: ti,am625
 
+      - description: K3 AM625 SoC on TQ-Systems TQMa62xx SoM
+        items:
+          - enum:
+              - tq,am625-tqma6254-mba62xx # MBa62xx base board
+          - const: tq,am625-tqma6254
+          - const: ti,am625
+
       - description: K3 AM642 SoC
         items:
           - enum:
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#4 lore raw

PATCH v2 3/5 arm64: dts: ti: k3-am62: Add DM R5 ranges in cbass

In reply to Matthias Schiffer

From: Devarsh Thakkar <[email protected]>

Add DM R5F ATCM and BTCM ranges in cbass_wakeup and cbass_main.

---
 arch/arm64/boot/dts/ti/k3-am62.dtsi | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62.dtsi +6 -2
index bfb55ca113239..f01a594ba7f89 100644
@@ -86,7 +86,9 @@ cbass_main: bus@f0000 {
 			 /* Wakeup Domain Range */
 			 <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */
 			 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>,
-			 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
+			 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>,
+			 <0x00 0x78000000 0x00 0x78000000 0x00 0x00008000>, /* DM R5 ATCM */
+			 <0x00 0x78100000 0x00 0x78100000 0x00 0x00008000>; /* DM R5 BTCM */
 
 		cbass_mcu: bus@4000000 {
 			bootph-all;
@@ -103,7 +105,9 @@ cbass_wakeup: bus@b00000 {
 			#size-cells = <2>;
 			ranges = <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */
 				 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
-				 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
+				 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>,
+				 <0x00 0x78000000 0x00 0x78000000 0x00 0x00008000>, /* DM R5 ATCM */
+				 <0x00 0x78100000 0x00 0x78100000 0x00 0x00008000>; /* DM R5 BTCM */
 		};
 	};
 
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#5 lore raw

PATCH v2 4/5 arm64: dts: ti: k3-am62-wakeup: Add R5F device node

In reply to Matthias Schiffer

From: Hari Nagalla <[email protected]>

AM62 SoCs have a single core R5F core in wakeup domain. This core is also used as a device manager for the SoC.

[Matthias Schiffer: Updated to match latest submitted version v5 of "arm64:
dts: k3-am62a-wakeup: Add R5F device node"]

---
 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi +24 -0
index 9b8a1f85aa15c..619848e889cf9 100644
@@ -106,6 +106,30 @@ wkup_rti0: watchdog@2b000000 {
 		status = "reserved";
 	};
 
+	wkup_r5fss0: r5fss@78000000 {
+		compatible = "ti,am62-r5fss";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x78000000 0x00 0x78000000 0x8000>,
+			 <0x78100000 0x00 0x78100000 0x8000>;
+		power-domains = <&k3_pds 119 TI_SCI_PD_EXCLUSIVE>;
+
+		wkup_r5fss0_core0: r5f@78000000 {
+			compatible = "ti,am62-r5f";
+			reg = <0x78000000 0x00008000>,
+			      <0x78100000 0x00008000>;
+			reg-names = "atcm", "btcm";
+			resets = <&k3_reset 121 1>;
+			firmware-name = "am62-wkup-r5f0_0-fw";
+			ti,sci = <&dmsc>;
+			ti,sci-dev-id = <121>;
+			ti,sci-proc-ids = <0x01 0xff>;
+			ti,atcm-enable = <1>;
+			ti,btcm-enable = <1>;
+			ti,loczrama = <1>;
+		};
+	};
+
 	wkup_vtm0: temperature-sensor@b00000 {
 		compatible = "ti,j7200-vtm";
 		reg = <0x00 0xb00000 0x00 0x400>,
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#6 lore raw

PATCH v2 5/5 arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

In reply to Matthias Schiffer

The TQMa62xx is a SoM family with a pluggable board connector based on the TI AM62x SoCs. Add DTS(I) for the AM625 (2x Cortex-A53) variant and its combination with our MBa62xx carrier board.

---
 arch/arm64/boot/dts/ti/Makefile               |   1 +
 .../boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts | 917 ++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am625-tqma62xx.dtsi | 346 +++++++
 3 files changed, 1264 insertions(+)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625-tqma62xx.dtsi
arch/arm64/boot/dts/ti/Makefile +1 -0
index f71360f14f233..4d96c086e2daf 100644
@@ -14,6 +14,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am625-beagleplay-csi2-ov5640.dtbo
 dtb-$(CONFIG_ARCH_K3) += k3-am625-beagleplay-csi2-tevi-ov5640.dtbo
 dtb-$(CONFIG_ARCH_K3) += k3-am625-phyboard-lyra-rdk.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-sk.dtb
+dtb-$(CONFIG_ARCH_K3) += k3-am625-tqma62xx-mba62xx.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-nonwifi-dahlia.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-nonwifi-dev.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-nonwifi-ivy.dtb
arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +917 -0

917 lines not on this page · raw message

arch/arm64/boot/dts/ti/k3-am625-tqma62xx.dtsi new file +346 -0

346 lines not on this page · raw message

Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#7 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 203

Quoted 9 lines

+&cpsw_port1 {

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +8 -0
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy0>;
+};
+
+&cpsw_port2 {
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy3>;
+};

rgmii-rxid is very odd.

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 216

Quoted 13 lines
arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +13 -0
+
+&cpsw3g_mdio {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mdio1_pins>;
+
+	cpsw3g_phy0: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x0>;
+		reset-gpios = <&main_gpio1 11 GPIO_ACTIVE_LOW>;
+		reset-assert-us = <1000>;
+		reset-deassert-us = <1000>;
+		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;

I guess this is the explanation.

What happens when you use rgmii-id, and don't have this delay here? That would be normal.

Andrew

#8 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 29 lines · Andrew Lunn

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 203

Quoted 10 lines

+&cpsw_port1 {

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +8 -0
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy0>;
+};
+
+&cpsw_port2 {
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy3>;
+};

rgmii-rxid is very odd.

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 216

Quoted 13 lines
arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +13 -0
+
+&cpsw3g_mdio {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mdio1_pins>;
+
+	cpsw3g_phy0: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x0>;
+		reset-gpios = <&main_gpio1 11 GPIO_ACTIVE_LOW>;
+		reset-assert-us = <1000>;
+		reset-deassert-us = <1000>;
+		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;

I guess this is the explanation.

Quoted 4 lines

What happens when you use rgmii-id, and don't have this delay here? That would be normal.

Andrew

This is normal for AM62-based boards, see the DTSI of the TI reference starterkit for example:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi#n451

With rgmii-id, both ti,rx-internal-delay and ti,tx-internal-delay should be set. As ti,*-internal-delay sets the delay on the PHY side, phy-mode "rgmii" is the one that would not use either:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ti,dp83867.yaml#n78

At the end of the day, does it really matter as long as MAC and PHY agree on the used mode? We copied this part of the hardware design from the TI reference board, and did our hardware qualification with these settings, so I think it makes sense to use the same phy-mode configuration.

Best regards,
Matthias

Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#9 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 45 lines · Matthias Schiffer
Quoted 29 lines · Andrew Lunn

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 203

Quoted 10 lines

+&cpsw_port1 {

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +8 -0
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy0>;
+};
+
+&cpsw_port2 {
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy3>;
+};

rgmii-rxid is very odd.

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 216

Quoted 13 lines
arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +13 -0
+
+&cpsw3g_mdio {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mdio1_pins>;
+
+	cpsw3g_phy0: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x0>;
+		reset-gpios = <&main_gpio1 11 GPIO_ACTIVE_LOW>;
+		reset-assert-us = <1000>;
+		reset-deassert-us = <1000>;
+		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;

I guess this is the explanation.

Quoted 4 lines

What happens when you use rgmii-id, and don't have this delay here? That would be normal.

Andrew

This is normal for AM62-based boards, see the DTSI of the TI reference starterkit for example:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi#n451

With rgmii-id, both ti,rx-internal-delay and ti,tx-internal-delay should be set. As ti,*-internal-delay sets the delay on the PHY side, phy-mode "rgmii" is the one that would not use either:

Quoted 6 lines

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ti,dp83867.yaml#n78

At the end of the day, does it really matter as long as MAC and PHY agree on the used mode? We copied this part of the hardware design from the TI reference board, and did our hardware qualification with these settings, so I think it makes sense to use the same phy-mode configuration.

What i try to achieve is every board uses the same configuration. The PHY adds the delays, not the MAC. There are a few exceptions, because a few cheap PHYs don't support delays, and so the MAC needs to add them. But in general, any board i review, i always ask that the PHY does the delay.

Also, don't put too much value in vendor code. Vendors don't care about Linux has a whole, being uniform across all systems. Many vendors do the minimum to get their stuff working, sometimes Monkeys typing Shakespeare, and not a lot more.

I also find a lot of developers don't really understand what phy-mode and PHY_INTERFACE_MODE_RGMII_* actually mean. phy-mode = 'rgmii' means the board has extra long clock lines, so the MAC/PHY does not need to add delays. rgmii-rxid means the board has an extra long rx clock line, but a normal length tx clock line. Now, i doubt your board is actually like this?

You want to correctly describe your hardware in DT, which i guess is "rgmii-id". That means something, either the MAC or the PHY needs to add delays. PHY_INTERFACE_MODE_RGMII_* is what is passed to the PHY. To get it to add the 2ns delays, you pass PHY_INTERFACE_MODE_RGMII_ID, and you should not need any additional properties in DT, it should default to 2ns. If you need to tune the delay, 2ns does not work, but you actually need 1.8ns etc, then you can add additional parameters. But given you have DP83867_RGMIIDCTL_2_00_NS, i doubt you need this.

Andrew

#10 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 65 lines · Andrew Lunn
Quoted 45 lines · Matthias Schiffer
Quoted 29 lines · Andrew Lunn

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 203

Quoted 10 lines

+&cpsw_port1 {

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +8 -0
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy0>;
+};
+
+&cpsw_port2 {
+	phy-mode = "rgmii-rxid";
+	phy-handle = <&cpsw3g_phy3>;
+};

rgmii-rxid is very odd.

arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts line 216

Quoted 13 lines
arch/arm64/boot/dts/ti/k3-am625-tqma62xx-mba62xx.dts new file +13 -0
+
+&cpsw3g_mdio {
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_mdio1_pins>;
+
+	cpsw3g_phy0: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x0>;
+		reset-gpios = <&main_gpio1 11 GPIO_ACTIVE_LOW>;
+		reset-assert-us = <1000>;
+		reset-deassert-us = <1000>;
+		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;

I guess this is the explanation.

Quoted 4 lines

What happens when you use rgmii-id, and don't have this delay here? That would be normal.

Andrew

This is normal for AM62-based boards, see the DTSI of the TI reference starterkit for example:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi#n451

With rgmii-id, both ti,rx-internal-delay and ti,tx-internal-delay should be set. As ti,*-internal-delay sets the delay on the PHY side, phy-mode "rgmii" is the one that would not use either:

Quoted 6 lines

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ti,dp83867.yaml#n78

At the end of the day, does it really matter as long as MAC and PHY agree on the used mode? We copied this part of the hardware design from the TI reference board, and did our hardware qualification with these settings, so I think it makes sense to use the same phy-mode configuration.

What i try to achieve is every board uses the same configuration. The PHY adds the delays, not the MAC. There are a few exceptions, because a few cheap PHYs don't support delays, and so the MAC needs to add them. But in general, any board i review, i always ask that the PHY does the delay.

Also, don't put too much value in vendor code. Vendors don't care about Linux has a whole, being uniform across all systems. Many vendors do the minimum to get their stuff working, sometimes Monkeys typing Shakespeare, and not a lot more.

Quoted 6 lines

I also find a lot of developers don't really understand what phy-mode and PHY_INTERFACE_MODE_RGMII_* actually mean. phy-mode = 'rgmii' means the board has extra long clock lines, so the MAC/PHY does not need to add delays. rgmii-rxid means the board has an extra long rx clock line, but a normal length tx clock line. Now, i doubt your board is actually like this?

Not our board, but the AM62 SoC. From the datasheet:

"TXC is delayed internally before being driven to the RGMII[x]_TXC pin. This internal delay is always enabled." So enabling the TX delay on the PHY side would result in a double delay.

Quoted 10 lines

You want to correctly describe your hardware in DT, which i guess is "rgmii-id". That means something, either the MAC or the PHY needs to add delays. PHY_INTERFACE_MODE_RGMII_* is what is passed to the PHY. To get it to add the 2ns delays, you pass PHY_INTERFACE_MODE_RGMII_ID, and you should not need any additional properties in DT, it should default to 2ns. If you need to tune the delay, 2ns does not work, but you actually need 1.8ns etc, then you can add additional parameters. But given you have DP83867_RGMIIDCTL_2_00_NS, i doubt you need this.

No such defaults exist in the DP83867 driver. If any rgmii-*id mode is used, the corresponding delays *must* be specified in the DTB:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/dp83867.c#n532

Best regards,
Matthias

Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#11 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 5 lines

Not our board, but the AM62 SoC. From the datasheet:

"TXC is delayed internally before being driven to the RGMII[x]_TXC pin. This internal delay is always enabled." So enabling the TX delay on the PHY side would result in a double delay.

phy-mode describes the board. If the board does not have extra long clock lines, phy-mode should be rgmii-id.

The fact the MAC is doing something which no other MAC does should be hidden away in the MAC driver, as much as possible.

The MAC driver should return -EINVAL with phy-mode rgmii, or rmgii-rxid, because the MAC driver is physically incapable of being used on a board which has extra long TX clock lines, which 'rmgii' or rgmii-rxid would indicate.

Since the MAC driver is forcing the TX delay, it needs to take the value returned from of_get_phy_mode() and mask out the TX bit before passing it to the PHY.

Now, it could be that history has got in the way. There are boards out there which have broken DT but work. Fixing the MAC driver to do the correct thing will break those boards. Vendors with low quality code which works, but not really.

~/linux/arch/arm64/boot/dts/ti$ grep rgmii k3-am625-*
k3-am625-beagleplay.dts: phy-mode = "rgmii-rxid";
k3-am625-sk.dts: phy-mode = "rgmii-rxid";

Yep, these two have broken DT, they don't describe the board correctly.

O.K. Can we fix this for you board? Yes, i think we can. If you take rmgii-rxid, aka PHY_INTERFACE_MODE_RGMII_RXID, and mask out the TX, you still get PHY_INTERFACE_MODE_RGMII_RXID. If you take rgmii-id, a.k.a. PHY_INTERFACE_MODE_RGMII_ID and mask out the TX, you get PHY_INTERFACE_MODE_RGMII_RXID, which is what you want.

Please produce a patch to the MAC driver, explaining the horrible mess the vendor made, and how this fixes it, but should also not break other boards.

Quoted 4 lines

No such defaults exist in the DP83867 driver. If any rgmii-*id mode is used, the corresponding delays *must* be specified in the DTB:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/dp83867.c#n532

That is bad, different to pretty every other PHY driver :-(

If you want, you could patch this driver as well, make it default to 2ns if delays are asked for.

Andrew

---
pw-bot: cr

#12 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 7 lines · Andrew Lunn
Quoted 6 lines

Not our board, but the AM62 SoC. From the datasheet:

"TXC is delayed internally before being driven to the RGMII[x]_TXC pin. This internal delay is always enabled." So enabling the TX delay on the PHY side would result in a double delay.

Quoted 5 lines

phy-mode describes the board. If the board does not have extra long clock lines, phy-mode should be rgmii-id.

The fact the MAC is doing something which no other MAC does should be hidden away in the MAC driver, as much as possible.

Isn't it kind of a philosophical question whether a delay added by the SoC integration is part of the MAC or not? One could also argue that the MAC IP core is always the same, with some SoCs adding the delay and others not. (I don't know if there are actually SoCs with the same IP core that don't add a delay; I'm just not a big fan of hiding details in the driver that could easily be described by the Device Tree, thus making the driver more generic)

Quoted 9 lines

The MAC driver should return -EINVAL with phy-mode rgmii, or rmgii-rxid, because the MAC driver is physically incapable of being used on a board which has extra long TX clock lines, which 'rmgii' or rgmii-rxid would indicate.

Since the MAC driver is forcing the TX delay, it needs to take the value returned from of_get_phy_mode() and mask out the TX bit before passing it to the PHY.

Hmm okay, this is what the similar ICSSG/PRUETH driver does. I've always found that solution to be particularly confusing, but if that's how it's supposed to work, I'll have to accept that.

In my opinion the documentation Documentation/networking/phy.rst is not very clear on this matter - the whole section "(RG)MII/electrical interface considerations" talks about whether the PHY inserts the delay or not, so my assumption was that phy-mode describes the PHY side of things and only that.

It gets even more confusing when taking into account Documentation/devicetree/bindings/net/ethernet-controller.yaml, which contains comments like "RGMII with internal RX delay provided by the PHY, the MAC should not add an RX delay in this case", which sounds like there are only the cases "delay is added by the PHY" and "delay is added by the MAC" - the case "delay is part of the board design, neither MAC nor PHY add it" doesn't even appear.

Quoted 19 lines

Now, it could be that history has got in the way. There are boards out there which have broken DT but work. Fixing the MAC driver to do the correct thing will break those boards. Vendors with low quality code which works, but not really.

~/linux/arch/arm64/boot/dts/ti$ grep rgmii k3-am625-*
k3-am625-beagleplay.dts: phy-mode = "rgmii-rxid";
k3-am625-sk.dts: phy-mode = "rgmii-rxid";

Yep, these two have broken DT, they don't describe the board correctly.

O.K. Can we fix this for you board? Yes, i think we can. If you take rmgii-rxid, aka PHY_INTERFACE_MODE_RGMII_RXID, and mask out the TX, you still get PHY_INTERFACE_MODE_RGMII_RXID. If you take rgmii-id, a.k.a. PHY_INTERFACE_MODE_RGMII_ID and mask out the TX, you get PHY_INTERFACE_MODE_RGMII_RXID, which is what you want.

Quoted 3 lines

Please produce a patch to the MAC driver, explaining the horrible mess the vendor made, and how this fixes it, but should also not break other boards.

I can make this change, but "am65-cpsw-nuss" currently supports 6 different compatible strings, many of which are used for multiple SoC families.

Maybe someone from TI could chime in and say whether all of these have the fixed TXC delay, or at least the current compatible strings are already specific enough to tell whether the SoC adds a delay?

Quoted 10 lines
Quoted 5 lines

No such defaults exist in the DP83867 driver. If any rgmii-*id mode is used, the corresponding delays *must* be specified in the DTB:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/phy/dp83867.c#n532

That is bad, different to pretty every other PHY driver :-(

If you want, you could patch this driver as well, make it default to 2ns if delays are asked for.

Makes sense, I'll write a patch for that as well.

Best regards,
Matthias

Quoted 5 lines

Andrew

---
pw-bot: cr

Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#13 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 14 lines · Matthias Schiffer
Quoted 7 lines · Andrew Lunn
Quoted 6 lines

Not our board, but the AM62 SoC. From the datasheet:

"TXC is delayed internally before being driven to the RGMII[x]_TXC pin. This internal delay is always enabled." So enabling the TX delay on the PHY side would result in a double delay.

Quoted 5 lines

phy-mode describes the board. If the board does not have extra long clock lines, phy-mode should be rgmii-id.

The fact the MAC is doing something which no other MAC does should be hidden away in the MAC driver, as much as possible.

Quoted 6 lines

Isn't it kind of a philosophical question whether a delay added by the SoC integration is part of the MAC or not? One could also argue that the MAC IP core is always the same, with some SoCs adding the delay and others not. (I don't know if there are actually SoCs with the same IP core that don't add a delay; I'm just not a big fan of hiding details in the driver that could easily be described by the Device Tree, thus making the driver more generic)

It is more about, what does phy-mode = "rgmii"; mean? It means the board provides the delay via extra long clock lines. Except for when some random MAC driver has a completely different meaning, it is not documented it means something else, you have to read the sources and the mailing lists, to find out what this particularly MAC driver is doing for phy-mode = "rgmii".

Do we really want that. Or should we define that phy-mode = "rgmii" means the PCB provides the delay. End of story, no exceptions. And that "rgmii-id" means the MAC/PHY pair need to provide the delay? End of story, no exceptions.

Quoted 7 lines
Quoted 3 lines

Since the MAC driver is forcing the TX delay, it needs to take the value returned from of_get_phy_mode() and mask out the TX bit before passing it to the PHY.

Hmm okay, this is what the similar ICSSG/PRUETH driver does. I've always found that solution to be particularly confusing, but if that's how it's supposed to work, I'll have to accept that.

It has to be that why. If the MAC does the delay, the MAC needs to ensure the PHY does not do the delays and well, and it achieves that by setting PHY_INTERFACE_MODE to indicate the PHY should not add delays. Do you have a better idea how this can be done?

Quoted 11 lines

In my opinion the documentation Documentation/networking/phy.rst is not very clear on this matter - the whole section "(RG)MII/electrical interface considerations" talks about whether the PHY inserts the delay or not, so my assumption was that phy-mode describes the PHY side of things and only that.

It gets even more confusing when taking into account Documentation/devicetree/bindings/net/ethernet-controller.yaml, which contains comments like "RGMII with internal RX delay provided by the PHY, the MAC should not add an RX delay in this case", which sounds like there are only the cases "delay is added by the PHY" and "delay is added by the MAC" - the case "delay is part of the board design, neither MAC nor PHY add it" doesn't even appear.

We have tried to improve the documentation. We have also been very rigid in reviewing DT bindings, and what these things mean. But it seems like many developers don't read reviews other developers get. Go search the email archive. How many times have i had this very same conversation?

Everybody gets pause wrong. Everybody gets EEE wrong. Everybody gets RGMII delays wrong, not matter how many times we tell developers they are getting it wrong.... phylink is helping with this, it takes it out of developers hands so they cannot get pause or soon EEE wrong.

Andrew

#14 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 30 lines · Andrew Lunn
Quoted 14 lines · Matthias Schiffer
Quoted 7 lines · Andrew Lunn
Quoted 6 lines

Not our board, but the AM62 SoC. From the datasheet:

"TXC is delayed internally before being driven to the RGMII[x]_TXC pin. This internal delay is always enabled." So enabling the TX delay on the PHY side would result in a double delay.

Quoted 5 lines

phy-mode describes the board. If the board does not have extra long clock lines, phy-mode should be rgmii-id.

The fact the MAC is doing something which no other MAC does should be hidden away in the MAC driver, as much as possible.

Quoted 6 lines

Isn't it kind of a philosophical question whether a delay added by the SoC integration is part of the MAC or not? One could also argue that the MAC IP core is always the same, with some SoCs adding the delay and others not. (I don't know if there are actually SoCs with the same IP core that don't add a delay; I'm just not a big fan of hiding details in the driver that could easily be described by the Device Tree, thus making the driver more generic)

It is more about, what does phy-mode = "rgmii"; mean? It means the board provides the delay via extra long clock lines. Except for when some random MAC driver has a completely different meaning, it is not documented it means something else, you have to read the sources and the mailing lists, to find out what this particularly MAC driver is doing for phy-mode = "rgmii".

Quoted 4 lines

Do we really want that. Or should we define that phy-mode = "rgmii" means the PCB provides the delay. End of story, no exceptions. And that "rgmii-id" means the MAC/PHY pair need to provide the delay? End of story, no exceptions.

Hi Andrew,

I've just thought about this issue again. As mentioned, a number of MAC drivers(*) implement what is described here:

https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-controller.yaml?h=v6.13#n77

That is, the delay is either added by the PHY or the MAC; having a delay on the PCB is simply not supported. Fixing MAC drivers to interpret the values without "id" to mean that there is a delay on the PCB will break existing Device Trees, so that's no good.

As a first step, I'd update the docs to describe the intended behavior, but mention that some drivers implement it wrong. The question is how to deal with the wrong behavior going forward. I see the following options, but none spark joy for me...

- Keep current driver behavior forever where fixing it would break existing Device Trees
- Deprecate all existing "rgmii*" values because of their inconsistent implementation, come up with new ones. Seems like a huge pain to add support for in all MAC drivers and other code that deals with PHY modes...
- Introduce an additional DTS flag next to phy-mode to express that the phy-mode is supposed to be interpreted correctly

Do you have any suggestions?

Best,
Matthias

(*) At a glance, at least the following MAC drivers appear to configure a delay, making it impossible to support delays on the PCB with the current implementation:
- renesas/ravb_main.c
- stmicro/stmmac/dwmac-* (some variants)
- ti/cpsw-phy-sel.c (incomplete; does not distinguish between RX and TX delays)
- Some other MAC drivers check for specific PHY_INTERFACE_MODE_RGMII* values, which also doesn't seem completely correct

Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#15 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 10 lines

Hi Andrew,

I've just thought about this issue again. As mentioned, a number of MAC drivers(*) implement what is described here:

https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-controller.yaml?h=v6.13#n77

That is, the delay is either added by the PHY or the MAC; having a delay on the PCB is simply not supported.

Yes it is, you are reading it wrong. First off, as said a number of times in the last couple of months, this description is from the perspective of the PHY. It is not the board perspective. So:

# RX and TX delays are added by the MAC when required
- rgmii

From the perspective of the PHY, "when required" the MAC adds the delay. It might not be required, because the PCB adds the delay.

# RGMII with internal RX and TX delays provided by the PHY, # the MAC should not add the RX or TX delays in this case
- rgmii-id

The MAC should not add delays because the PHY does. But this implies the PCB cannot also be adding delays because you would end up with two sets of delays.

Quoted 3 lines

Fixing MAC drivers to interpret the values without
"id" to mean that there is a delay on the PCB will break existing Device Trees, so that's no good.

You need to look at it broken driver by broken driver. I _think_ the Aspeed case can be fixed. Others we need to look at the details. Maybe in some cases we do need to add a warning to the device tree binding the driver is FUBAR and has special, broken meaning for 'rgmii'.

Quoted 2 lines

As a first step, I'd update the docs to describe the intended behavior, but mention that some drivers implement it wrong.

Feel free to submit patches. However, please think about it. DT is OS agnostic. DT describes the hardware, not configuration. Other OSes might decide on a different policy about which of the MAC/PHY pair implements the delay, since that is configuration, not a hardware description.

Quoted 9 lines

The question is how to deal with
the wrong behavior going forward. I see the following options, but none spark joy for me...

- Keep current driver behavior forever where fixing it would break existing Device Trees
- Deprecate all existing "rgmii*" values because of their inconsistent implementation, come up with new ones. Seems like a huge pain to add support for in all MAC drivers and other code that deals with PHY modes...

Won't help anyway. If developers are getting it wrong now, why should they suddenly start getting it right when all you are changing is the name.

The real issue is that you can combine two bugs to get a working system. It seems like few developers actually understand RGMII delays. They don't spend time to understand it, they just try random things until it works. As a result, they get systems where the MAC is unknowingly adding delays, and 'rgmii' works, so job done. They don't know or care it is wrong.

Quoted 2 lines

- Introduce an additional DTS flag next to phy-mode to express that the phy-mode is supposed to be interpreted correctly

If you are going to do add any sort of property, it should be a bool indicating the opposite, 'phy-mode-is-fubar'. Something which developers will think about before copying into their DT.

Quoted 1 line

Do you have any suggestions?

Add a checkpatch.pl check. Any patch which adds a phy-mode != 'rgmii-id' needs to have a comment on the previous line containing the word PCB. That should at least help stop more broken DT being added.

Andrew

#16 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 15 lines · Andrew Lunn
Quoted 10 lines

Hi Andrew,

I've just thought about this issue again. As mentioned, a number of MAC drivers(*) implement what is described here:

https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-controller.yaml?h=v6.13#n77

That is, the delay is either added by the PHY or the MAC; having a delay on the PCB is simply not supported.

Yes it is, you are reading it wrong. First off, as said a number of times in the last couple of months, this description is from the perspective of the PHY. It is not the board perspective. So:

Quoted 5 lines

# RX and TX delays are added by the MAC when required
- rgmii

From the perspective of the PHY, "when required" the MAC adds the delay. It might not be required, because the PCB adds the delay.

I fail to see how the documentation could be interpreted that way. As you explained, "rgmii" actually means that the delay is added by the PCB, so there simply is no "when required" here - it can't be required if it's already in the PCB. I stand by my opinion that this doc is plain wrong and not just worded poorly, and needs to be fixed to express the intended meaning.

(I believe we agree on the point that this should be improved, I just don't think it is appropriate to make statements like "few developers actually understand RGMII delays" when the inaccuracy of the binding docs - supposedly an authoritative resource on the meaning of DT properties - is the cause of the misunderstanding)

Quoted 9 lines

# RGMII with internal RX and TX delays provided by the PHY, # the MAC should not add the RX or TX delays in this case
- rgmii-id

The MAC should not add delays because the PHY does. But this implies the PCB cannot also be adding delays because you would end up with two sets of delays.

Quoted 8 lines
Quoted 3 lines

Fixing MAC drivers to interpret the values without
"id" to mean that there is a delay on the PCB will break existing Device Trees, so that's no good.

You need to look at it broken driver by broken driver. I _think_ the Aspeed case can be fixed. Others we need to look at the details. Maybe in some cases we do need to add a warning to the device tree binding the driver is FUBAR and has special, broken meaning for 'rgmii'.

I don't know about Aspeed (maybe you're mixing something up, or I'm not aware of something?) - in the case of the TI driver I'm dealing with, this is indeed possible to fix up because the MAC always adds a delay, it is not configurable.

Quoted 31 lines
Quoted 3 lines

As a first step, I'd update the docs to describe the intended behavior, but mention that some drivers implement it wrong.

Feel free to submit patches. However, please think about it. DT is OS agnostic. DT describes the hardware, not configuration. Other OSes might decide on a different policy about which of the MAC/PHY pair implements the delay, since that is configuration, not a hardware description.

Quoted 9 lines

The question is how to deal with
the wrong behavior going forward. I see the following options, but none spark joy for me...

- Keep current driver behavior forever where fixing it would break existing Device Trees
- Deprecate all existing "rgmii*" values because of their inconsistent implementation, come up with new ones. Seems like a huge pain to add support for in all MAC drivers and other code that deals with PHY modes...

Won't help anyway. If developers are getting it wrong now, why should they suddenly start getting it right when all you are changing is the name.

The real issue is that you can combine two bugs to get a working system. It seems like few developers actually understand RGMII delays. They don't spend time to understand it, they just try random things until it works. As a result, they get systems where the MAC is unknowingly adding delays, and 'rgmii' works, so job done. They don't know or care it is wrong.

Quoted 6 lines
Quoted 2 lines

- Introduce an additional DTS flag next to phy-mode to express that the phy-mode is supposed to be interpreted correctly

If you are going to do add any sort of property, it should be a bool indicating the opposite, 'phy-mode-is-fubar'. Something which developers will think about before copying into their DT.

The whole point of my suggestions is to allow fixing the drivers while staying compatible with old, broken Device Trees. If we could add a property 'phy-mode- is-fubar' to old Device Trees, we could just fix them instead - but we can only fix in-tree DTS, and it will only have an effect on systems that update their DTBs with their kernel, so I believe this simply isn't an option because of backwards compat guarantees for Device Trees.

Quoted 6 lines
Quoted 2 lines

Do you have any suggestions?

Add a checkpatch.pl check. Any patch which adds a phy-mode != 'rgmii-id' needs to have a comment on the previous line containing the word PCB. That should at least help stop more broken DT being added.

Ah, I like that idea - I'll see if I can find time to look into it.

Best,
Matthias

Quoted 2 lines

Andrew

Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
#17 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

Fixing MAC drivers to interpret the values without
"id" to mean that there is a delay on the PCB will break existing Device Trees, so that's no good.

Quoted 8 lines
Quoted 4 lines

You need to look at it broken driver by broken driver. I _think_ the Aspeed case can be fixed. Others we need to look at the details. Maybe in some cases we do need to add a warning to the device tree binding the driver is FUBAR and has special, broken meaning for 'rgmii'.

I don't know about Aspeed (maybe you're mixing something up, or I'm not aware of something?) - in the case of the TI driver I'm dealing with, this is indeed possible to fix up because the MAC always adds a delay, it is not configurable.

The Aspeed driver also gets RGMII delays wrong. And there is an ongoing discussion about how to fix it. The discussions there probably apply to most drivers which get RGMII delays wrong. Following the discussions on how RGMII is broken in other places might help you fix the TI driver.

Quoted 6 lines

The whole point of my suggestions is to allow fixing the drivers while staying compatible with old, broken Device Trees. If we could add a property 'phy-mode- is-fubar' to old Device Trees, we could just fix them instead - but we can only fix in-tree DTS, and it will only have an effect on systems that update their DTBs with their kernel, so I believe this simply isn't an option because of backwards compat guarantees for Device Trees.

So you need the TI driver to accept the broken 'rgmii', and the correct 'rgmii-id'. You say the MAC hardware always adds the delay. So

1) Patch the driver to test for 'rgmii', and issues a warning that the DT is wrong and needs updating.

2) Add the missing masking of the value passed to the PHY. Since the MAC driver is adding the delays, it needs to modify the phy_interface_t passed to phy_connect(), masking out the delays the MAC is adding. This is an established procedure for MACs which implement the delays, rather than ask the PHY to do it. It then becomes possible to use the correct 'rgmii-id' value.

3) Patch the TI .dts files to use the correct rgmii-id. That makes the warnings added in 1) go away.

This is a lot simpler than the Aspeed case, but the basic discussion taking place with the Aspeed driver would give you useful background.

Andrew

#18 lore raw

Re: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

In reply to Andrew Lunn
Quoted 2 lines · Andrew Lunn

I also find a lot of developers don't really understand what phy-mode and PHY_INTERFACE_MODE_RGMII_* actually mean.

... which is why we documented it in Documentation/networking/phy.rst, but it seems folk who run into RGMII stuff don't read that document.

I'm wondering if we can come up with some kernel-doc compatible way to document them in linux/phy.h instead, which may stand an improved chance of being read?

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
#19 lore raw

RE: [PATCH v2 5/5] arm64: dts: ti: Add TQ-Systems TQMa62xx SoM and MBa62xx carrier board Device Trees

Quoted 6 lines

... which is why we documented it in Documentation/networking/phy.rst, but it seems folk who run into RGMII stuff don't read that document.

I'm wondering if we can come up with some kernel-doc compatible way to document them in linux/phy.h instead, which may stand an improved chance of being read?

Move the relevant text from Documentation/networking/phy.rst into linux/phy.h as a linux doc format comment.

"include" that header file into Documentation/networking/phy.rst with

.. kernel-doc:: include/linux/phy.h

-Tony