Skip to contentSkip to conversation

arm64: dts: rockchip: Add ArmSoM CM5 and CM5-IO

PATCH Applied Jiaxing Hu 3 participants 5 messages Jul 19 – Jul 28

Subsystems (2)
lore
Share & tools
lore

Jiaxing Hu

author
#0 lore raw

v5 cover arm64: dts: rockchip: Add ArmSoM CM5 and CM5-IO

Add mainline support for the ArmSoM CM5, an RK3576 compute module, and its CM5-IO carrier board.

Patch 1 adds the binding, patch 2 the module dtsi and the carrier dts.

The on-module YT8531 PHY has no crystal and takes its 25 MHz reference from the SoC. Following review of v4, the reference is now handled the way Andrew Lunn and Maxime Chevallier asked for: the PHY is the consumer and enables the clock itself. That needs a small motorcomm change sent to netdev [1]; the clock is optional so this DTS still applies without it. The earlier dwmac-rk MAC-side patch is dropped.

Tested on a CM5-IO with [1] applied: the YT8531 links at 1000 Mbit/s; RK806, HYM8563, eMMC, microSD, the USB3 hub and PCIe all probe. dtbs_check is clean.

Changes in v5:
- The 25 MHz reference is now consumed by the PHY, not the MAC. The PHY node gets its clock back (clocks = <&cru REFCLKO25M_GMAC0_OUT>) and is named explicitly (ethernet-phy-id4f51.e91b) so it is instantiated from the DT without an MDIO ID probe, which it cannot answer before the clock runs. &gmac0 drops clk_mac_refout and inherits the SoC clocks. This reverses the v4 removal of the PHY-node clock, which was the wrong direction.
- Enable &sai6, the I2S CPU DAI the HDMI sound card needs (already in v4; re-tested here, HDMI audio card registers).

Changes in v4:
- phy-mode = "rgmii-id", drop the MAC tx_delay/rx_delay; the PHY adds both delays (Andrew Lunn). Re-tested at 1000 Mbit/s.
- Pick up Krzysztof's Acked-by on patch 1.

Changes in v3:
- Remove the ES8388 codec from the header and the i2c0 comment; use gpios in the vcc_3v3_pcie regulator.

Changes in v2:
- Fix the Type-C DP alt-mode node, move the FUSB302 role-switch endpoint into the connector, drop the ES8388 node and dead pinctrls, rename the wifi pinctrl node, and describe the PHY reset at the MDIO bus level.

[1] net: phy: motorcomm: enable the reference clock for YT8531

Jiaxing Hu (2):
dt-bindings: arm: rockchip: Add ArmSoM CM5 and CM5-IO
arm64: dts: rockchip: Add ArmSoM CM5 and CM5-IO

 .../devicetree/bindings/arm/rockchip.yaml     |   7 +
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../dts/rockchip/rk3576-armsom-cm5-io.dts     | 402 +++++++++++++
 .../boot/dts/rockchip/rk3576-armsom-cm5.dtsi  | 558 ++++++++++++++++++
 4 files changed, 968 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5-io.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH v5 1/2 dt-bindings: arm: rockchip: Add ArmSoM CM5 and CM5-IO

Add compatibles for the ArmSoM CM5, an RK3576 compute module, and its CM5-IO carrier board.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +7 -0
index 1a9dde186..5c7697f4d 100644
@@ -71,6 +71,13 @@ properties:
           - const: ariaboard,photonicat
           - const: rockchip,rk3568
 
+      - description: ArmSoM CM5 Module based boards
+        items:
+          - enum:
+              - armsom,cm5-io
+          - const: armsom,cm5
+          - const: rockchip,rk3576
+
       - description: ArmSoM Sige1 board
         items:
           - const: armsom,sige1
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH v5 2/2 arm64: dts: rockchip: Add ArmSoM CM5 and CM5-IO

In reply to Jiaxing Hu

Add the ArmSoM CM5, an RK3576 compute module (rk3576-armsom-cm5.dtsi), and its CM5-IO carrier (rk3576-armsom-cm5-io.dts). The module has the RK806 PMIC, HYM8563 RTC, eMMC, GMAC0 with an on-module MotorComm YT8531 PHY, and the SDIO bus for the on-module WiFi. The carrier adds HDMI, a GbE RJ45, two USB-A ports behind a USB3 hub, USB-C with FUSB302 and DP alt-mode, a PCIe 2.0 x1 M.2 slot, microSD, status LEDs and a 40-pin header.

The YT8531 has no crystal and takes the SoC 25 MHz reference (REFCLKO25M_GMAC0_OUT), described as a clock on the PHY node and enabled by the PHY driver. The PHY is named explicitly so it is instantiated from the device tree without an MDIO ID probe, which the PHY cannot answer until that clock is running. Its reset is described at the MDIO bus level so mdiobus releases it before the scan.

---
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../dts/rockchip/rk3576-armsom-cm5-io.dts     | 402 +++++++++++++
 .../boot/dts/rockchip/rk3576-armsom-cm5.dtsi  | 558 ++++++++++++++++++
 3 files changed, 961 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5-io.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index cb55c6b70..3ec0b6e20 100644
@@ -165,6 +165,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-display-vz.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-wolfvision-pf5-io-expander.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-100ask-dshanpi-a1.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-cm5-io.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-armsom-sige5-v1.2-wifibt.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-evb1-v10.dtb
arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5-io.dts new file +402 -0

402 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi new file +558 -0

558 lines not on this page · raw message

Signature · 1 line
2.43.0
#3 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Uninitialized hardware state (missing clock enablement & reset sequence violation) due to…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Uninitialized hardware state (missing clock enablement & reset sequence violation) due to motorcomm PHY driver not handling clocks. --

--- Patch [2]: [PATCH v5 2/2] arm64: dts: rockchip: Add ArmSoM CM5 and CM5-IO --- commit c0855ea5f59329ce1c87ee05212dc9c8bf0d2728
Author: Jiaxing Hu <[email protected]>

arm64: dts: rockchip: Add ArmSoM CM5 and CM5-IO

This patch adds device tree support for the Rockchip RK3576 based ArmSoM CM5 compute module and its CM5-IO carrier board. It configures the GMAC0 Ethernet with an on-module MotorComm YT8531 PHY.

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi new file +0 -0
new file mode 100644
index 0000000000000..b6977b973b340

[ ... ]

arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi line 498

Quoted 12 lines

+&mdio0 {

arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi new file +11 -0
+	reset-gpios = <&gpio2 RK_PB3 GPIO_ACTIVE_LOW>;
+	reset-delay-us = <20000>;
+	reset-post-delay-us = <100000>;
+
+	rgmii_phy0: phy@1 {
+		compatible = "ethernet-phy-id4f51.e91b",
+			     "ethernet-phy-ieee802.3-c22";
+		reg = <0x1>;
+		clocks = <&cru REFCLKO25M_GMAC0_OUT>;
+	};
+};

[Severity: High]
The commit message states that the REFCLKO25M_GMAC0_OUT clock is enabled by the PHY driver. Does the motorcomm PHY driver actually handle clocks?

Looking at drivers/net/phy/motorcomm.c, there don't appear to be any calls to clk_get() or devm_clk_get() to fetch and enable the clocks specified in the device tree.

Additionally, dwmac-rk.c only fetches a PHY clock if the phy-is-integrated property is present, which is missing here.

Because the MDIO bus deasserts the reset-gpios before the PHY device is probed, will the PHY be brought out of reset with a dead clock?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
maintainer Applied
#4 lore raw
In reply to Jiaxing Hu
Quoted 5 lines · Jiaxing Hu

Add mainline support for the ArmSoM CM5, an RK3576 compute module, and its CM5-IO carrier board.

Patch 1 adds the binding, patch 2 the module dtsi and the carrier dts.

Quoted 8 lines

The on-module YT8531 PHY has no crystal and takes its 25 MHz reference from the SoC. Following review of v4, the reference is now handled the way Andrew Lunn and Maxime Chevallier asked for: the PHY is the consumer and enables the clock itself. That needs a small motorcomm change sent to netdev [1]; the clock is optional so this DTS still applies without it. The earlier dwmac-rk MAC-side patch is dropped.

[...]

Applied, thanks!

[1/2] dt-bindings: arm: rockchip: Add ArmSoM CM5 and CM5-IO

      commit: f60f44c24b10fe7fd1fa76b360646def1bea193a
[2/2] arm64: dts: rockchip: Add ArmSoM CM5 and CM5-IO
      commit: 44a48a23974b86d2c551afbabee15ad70b249df5

Adapted the styling a bit, fixed some dt-checker warnings including the 2nd ethernet-phy compatible - I left the most specific one.

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>