Skip to contentSkip to conversation

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

PATCH Superseded Jiaxing Hu 2 participants 4 messages Jul 17

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Jiaxing Hu

author
#0 lore raw

v4 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 needs the SoC 25 MHz reference clock (clk_mac_refout). Ungating it for RGMII needs a small dwmac-rk change sent separately to netdev [1]; the clock is optional so this DTS applies without it.

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

Sorry about the v3 traffic: it went out twice because my mail provider accepted the first copy but then held it for hours before delivering, so a resend and the original both landed. That is fixed now.

Changes in v4:
- Use phy-mode = "rgmii-id" and let the YT8531 add both RGMII delays internally; drop the MAC tx_delay/rx_delay. The PCB does not use long clock lines, so rgmii-id is the correct description, and this matches the other rk3576 boards. Re-tested: link still comes up at 1000 Mbit/s (Andrew Lunn).
- Drop the redundant clocks/assigned-clocks on the PHY node; the 25 MHz reference is enabled and rated through clk_mac_refout on the gmac node, and clock properties on an MDIO child are not processed (sashiko-bot).
- Enable &sai6, the I2S CPU DAI the HDMI sound card needs to probe (sashiko-bot).
- Pick up Krzysztof's Acked-by on patch 1.

Changes in v3:
- Remove the ES8388 codec from the file header and the i2c0 block comment (the node was dropped in v2 but the comments still named it).
- Use gpios instead of gpio in the vcc_3v3_pcie fixed regulator.

Changes in v2:
- Type-C DP alt-mode: name the altmodes child "displayport" and make svid a /bits/ 16 value; drop the undocumented svid from &usbdp_phy and add the missing mode-switch.
- Move the FUSB302 role-switch endpoint into the connector's ports and rename the node to usb-typec@22.
- Drop the ES8388 node and the unreferenced gmac0_rst, bt_reg_on and wifi_host_wake_irq pinctrls.
- Rename the wifi-poweren-gpio pinctrl node (collided with gpio-consumer.yaml).
- Describe the PHY reset at the MDIO bus level rather than with the deprecated snps,reset-gpios.

[1] net: stmmac: dwmac-rk: enable the reference clock for output mode

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 v4 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 v4 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, so it uses the SoC 25 MHz reference output, described on the gmac node as clk_mac_refout. Its reset is described at the MDIO bus level: mdiobus releases a bus level reset before it scans for PHY IDs, whereas a per-PHY reset-gpios is only applied once the PHY has been found, which never happens while the PHY is still in reset.

---
 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 2 potential issue(s) to consider: - [High] The 25 MHz reference clock `clk_mac_refout` for the YT8531 Ethernet PHY is not enabled by the…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The 25 MHz reference clock clk_mac_refout for the YT8531 Ethernet PHY is not enabled by the driver in RGMII mode, leaving the PHY without a clock.
- [Medium] DisplayPort Alt Mode VDO advertises all capabilities and reserved bits as 1 (0xffffffff).
--

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

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

This commit adds support for the ArmSoM CM5 (an RK3576 compute module) and its CM5-IO carrier board. It includes configurations for the RK806 PMIC, Ethernet MAC, WiFi/Bluetooth, USB, HDMI, and various other peripherals.

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

[ ... ]

arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5-io.dts usbc0: usb-typec@22 { · line 204

Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5-io.dts new file +0 -0
@@ -198,22 +198,15 @@ usbc0: usb-typec@22 {
 			source-pdos =
 				<PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
 
 			altmodes {
 				displayport {
 					svid = /bits/ 16 <0xff01>;
 					vdo = <0xffffffff>;

[Severity: Medium]
Is this vdo value correct? Setting the DisplayPort Alt Mode VDO to all 1s (0xffffffff) asserts all possible DisplayPort capabilities and sets reserved bits to 1.

Could this cause connected hosts to mistakenly detect the board as a DisplayPort sink (phantom monitor) and fail alt mode negotiations?

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5-io.dts new file +0 -0
 				};
 			};

[ ... ]

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

[ ... ]

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi new file +0 -0
@@ -138,20 +138,15 @@ &cpu_l3 {
 /*
  * GMAC0 drives an on-module MotorComm YT8531. The PHY has no local crystal, so
  * it relies on the SoC 25 MHz reference: clk_mac_refout (REFCLKO25M_GMAC0_OUT)
  * has to be named on the gmac node for dwmac-rk to enable it, and

arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi &cpu_l3 { · line 151

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi new file +0 -0
  * ethm0_clk0_25m_out routes it to the pad.
  */
 &gmac0 {
 	phy-mode = "rgmii-id";
 	clock_in_out = "output";
 	clocks = <&cru CLK_GMAC0_125M_SRC>, <&cru CLK_GMAC0_RMII_CRU>,
 		 <&cru PCLK_GMAC0>, <&cru ACLK_GMAC0>,
 		 <&cru CLK_GMAC0_PTP_REF>, <&cru REFCLKO25M_GMAC0_OUT>;
 	clock-names = "stmmaceth", "clk_mac_ref", "pclk_mac", "aclk_mac",
 		      "ptp_ref", "clk_mac_refout";

[Severity: High]
Will the PHY receive its reference clock with this configuration?

The commit message notes that the YT8531 lacks a crystal and relies on the SoC 25 MHz reference output described here as clk_mac_refout. However, the device tree specifies phy-mode = "rgmii-id", and dwmac-rk only parses and enables clk_mac_refout if the PHY mode is RMII.

Since the clock is ignored in RGMII mode, does the PHY remain unclocked and break Ethernet initialization?

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3576-armsom-cm5.dtsi new file +0 -0
 	phy-handle = <&rgmii_phy0>;
 	phy-supply = <&vcc_3v3_s3>;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2