Skip to contentSkip to conversation

arm64: dts: rockchip: Add Firefly AIO-3588Q

PATCH New Saeed Nourian 2 participants 4 messages Nov 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover arm64: dts: rockchip: Add Firefly AIO-3588Q

Add a device tree for the Firefly AIO-3588Q, an AIO carrier board for the iCore-3588Q system-on-module.

The module itself is already described by rk3588-firefly-icore-3588q.dtsi, so the new file only describes the carrier: the two RGMII Ethernet ports with their RTL8211F PHYs, microSD, the USB hubs and ports, the PCIe 3.0 x4 slot, the M.2 PCIe slot, the PCA9555 GPIO expander, the HYM8563 RTC, the fan, the LEDs, the recovery key on SARADC channel 1 and the three Rocket NPU cores.

Besides the board bring-up itself, this series enables the RK3588 NPU on mainline. The three cores and their IOMMUs come from the SoC dtsi and are bound by the Rocket accel driver; all this board has to supply is npu-supply and sram-supply. Testing details are below.

The first patch only adds the compatible string to the existing "Firefly iCore-3588Q-based boards" enum.

Tested on hardware with Linux 7.4-rc1 (for-next, e19bd795e8, plus this series), booted from TFTP with a RAM-only initramfs, without touching the existing image on the eMMC:

- eMMC comes up in HS400 Enhanced strobe, all existing partitions intact
- both GMACs bind, RTL8211F is detected on both MDIO buses, and both ports link up at 1 Gbit/s and pass ICMP traffic cleanly
- the GL3523 hub enumerates on both its USB 2.0 and USB 3.0 side, the four type-A ports are its downstream ports and a USB 2.0 device works on each of them; the onboard FE1.1S hub enumerates on the EHCI port
- a microSD card enumerates as UHS-I SDR104; no card detect events were seen, so broken-cd is set and the slot is polled
- both PCIe host bridges come up (both slots were empty during the test)
- the PMIC regulators, PCA9555 and HYM8563 (rtc0) are present on I2C
- NPU: all three cores probe and report "Rockchip NPU core N version:
1179210309", the IOMMUs attach, /dev/accel/accel0 is created, and a runtime probe through it passes
- the devicetree has no deferred devices

The hub RESET# lines are wired to the PCA9555 and are released with gpio-hog nodes; describing the hubs themselves is left for later. The display outputs (HDMI0, DP0, VGA through DP1, eDP, DSI0), the Type-C port, the ES8388 audio codec, HDMI-in, the camera connectors and the 4G/5G modem are not described yet and are left for follow-up patches. PCA9555 line 3 is used both as the user LED and as an SD power enable; only the LED is modelled here, and the card slot is powered through line 13.

AI coding assistants were used to help prepare the DTS (cross-checking the board's hardware description and some of the edits, mainly the USB hub nodes). I reviewed all of it and tested the result on the board.

Saeed Nourian (2):
dt-bindings: arm: rockchip: Add Firefly AIO-3588Q
arm64: dts: rockchip: Add Firefly AIO-3588Q

 .../devicetree/bindings/arm/rockchip.yaml     |   1 +
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../dts/rockchip/rk3588-firefly-aio-3588q.dts | 434 ++++++++++++++++++
 3 files changed, 436 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 dt-bindings: arm: rockchip: Add Firefly AIO-3588Q

The AIO-3588Q is an RK3588 board from Firefly built from an iCore-3588Q SoM on a carrier board. Add its compatible next to the other boards based on the iCore-3588Q module.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +1 -0
index 744b364fb7..2fb93380dd 100644
@@ -260,6 +260,7 @@ properties:
       - description: Firefly iCore-3588Q-based boards
         items:
           - enum:
+              - firefly,aio-3588q
               - mntre,reform2-rcore
           - const: firefly,icore-3588q
           - const: rockchip,rk3588
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/2 arm64: dts: rockchip: Add Firefly AIO-3588Q

In reply to Saeed Nourian

The AIO-3588Q is an RK3588 board from Firefly built from an iCore-3588Q SoM on a carrier board. The SoM part (PMIC, CPU and NPU rails, eMMC and debug UART) is already described by rk3588-firefly-icore-3588q.dtsi, so this only describes the carrier:

- two RGMII Ethernet ports (RTL8211F PHYs)
- microSD slot
- USB 2.0 and 3.0 type-A ports behind a GL3523 hub, plus the onboard FE1.1S hub
- PCIe 3.0 x4 slot and an M.2 PCIe 2.1 slot
- PCA9555 GPIO expander, HYM8563 RTC, fan, LEDs and the recovery button
- the three NPU cores, powered through npu-supply and sram-supply

The hub RESET# lines are wired to the PCA9555 and are released with gpio-hog nodes. Describing the hubs themselves is left for later.

No card detect events were seen from the microSD slot on this board, so set broken-cd and let the core poll for the card.

---
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../dts/rockchip/rk3588-firefly-aio-3588q.dts | 434 ++++++++++++++++++
 2 files changed, 435 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index e4a0237e11..76c6cc6bc3 100644
@@ -200,6 +200,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-edgeble-neu6a-wifi.dtbo
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-edgeble-neu6b-io.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb2-v10.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-firefly-aio-3588q.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-firefly-itx-3588j.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-friendlyelec-cm3588-nas.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-h96-max-v58.dtb
arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +434 -0

434 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 5 potential issues to consider: - [High] arm64: dts: rockchip: missing domain-supply on pd_gpu and pd_npu - [Medium] arm64: dts: rockchip…

Thank you for your contribution! Sashiko AI review found 5 potential issues to consider:
- [High] arm64: dts: rockchip: missing domain-supply on pd_gpu and pd_npu
- [Medium] arm64: dts: rockchip: deprecated snps,reset-* properties on gmac0/1
- [Medium] arm64: dts: rockchip: tsadc left disabled and pwm-fan unmapped
- [Medium] arm64: dts: rockchip: sdmmc uses broken-cd instead of cd-gpios
- [Low] arm64: dts: rockchip: missing GPIO pinctrl for pcie3x4 and PHY resets
--

commit 941a7a1be6e86ac4e133cb78a5dcd1d5cdaff5f1
Author: Saeed Nourian <[email protected]>

arm64: dts: rockchip: Add Firefly AIO-3588Q

This commit adds a devicetree for the Firefly AIO-3588Q carrier board, which hosts the Firefly iCore-3588Q SoM.

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +0 -0
new file mode 100644
index 0000000000000..a37f16260beb9

[ ... ]

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts line 67

Quoted 7 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +7 -0
+	fan: pwm-fan {
+		compatible = "pwm-fan";
+		#cooling-cells = <2>;
+		cooling-levels = <0 50 100 150 200 255>;
+		fan-supply = <&vcc12v_dcin>;
+		pwms = <&pwm15 0 50000 0>;
+	};

[Severity: Medium]
Should this board also enable &tsadc and bind &fan to a thermal zone via cooling-maps?

rk3588-base.dtsi leaves &tsadc disabled, and rk3588-firefly-icore-3588q.dtsi does not enable it either. Without &tsadc enabled and cooling-maps referencing &fan, all seven SoC thermal zones, passive CPU/GPU thermal throttling, hardware over-temperature shutdown, and automatic fan control remain inactive.

[ ... ]

Quoted 35 lines

+&gmac0 {

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +34 -0
+	clock_in_out = "output";
+	phy-handle = <&rgmii_phy0>;
+	/*
+	 * The PHY supplies the RGMII RX delay (rgmii-rxid), so the one in
+	 * the SoC is disabled; the TX delay still comes from the SoC.
+	 */
+	phy-mode = "rgmii-rxid";
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac0_miim
+		     &gmac0_tx_bus2
+		     &gmac0_rx_bus2
+		     &gmac0_rgmii_clk
+		     &gmac0_rgmii_bus>;
+	snps,reset-gpio = <&gpio3 RK_PC7 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	/* Reset time is 20ms, 100ms for rtl8211f */
+	snps,reset-delays-us = <0 20000 100000>;
+	rx_delay = <0x00>;
+	tx_delay = <0x47>;
+	status = "okay";
+};
+
+&gmac1 {
+	clock_in_out = "output";
+	phy-handle = <&rgmii_phy1>;
+	/*
+	 * The PHY supplies the RGMII RX delay (rgmii-rxid), so the one in
+	 * the SoC is disabled; the TX delay still comes from the SoC.
+	 */
+	phy-mode = "rgmii-rxid";
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac1_miim
+		     &gmac1_tx_bus2
+		     &gmac1_rx_bus2

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts line 226

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +10 -0
+		     &gmac1_rgmii_clk
+		     &gmac1_rgmii_bus>;
+	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	/* Reset time is 20ms, 100ms for rtl8211f */
+	snps,reset-delays-us = <0 20000 100000>;
+	rx_delay = <0x00>;
+	tx_delay = <0x4f>;
+	status = "okay";
+};

[Severity: Medium]
Should the RTL8211F PHY reset properties be placed on the rgmii_phy0 and rgmii_phy1 child nodes instead of using snps,reset-* on &gmac0 and &gmac1?

snps,reset-gpio, snps,reset-active-low, and snps,reset-delays-us are deprecated in snps,dwmac.yaml. In stmmac_mdio_reset(), the driver requests snps,reset-gpio via devm_gpiod_get_optional() on each MDIO bus reset without releasing it, which fails with -EBUSY if the MDIO bus is reset more than once and bypasses phylib per-PHY reset handling. Moving these to reset-gpios, reset-assert-us = <20000>, and reset-deassert-us = <100000> on rgmii_phy0 and rgmii_phy1 lets phylib manage the resets.

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts line 232

Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +6 -0
+
+&gpu {
+	mali-supply = <&vdd_gpu_s0>;
+	sram-supply = <&vdd_gpu_mem_s0>;
+	status = "okay";
+};

[Severity: High]
Are &pd_gpu and &pd_npu missing domain-supply properties for <&vdd_gpu_s0> and <&vdd_npu_s0>?

In rk3588_pm_domains[], both RK3588_PD_GPU and RK3588_PD_NPU set need_regulator = true, and rk3588-firefly-icore-3588q.dtsi marks vdd_gpu_s0 as regulator-boot-on rather than regulator-always-on without wiring domain-supply on &pd_gpu or &pd_npu. If panthor probes after unused boot-on regulators are turned off (or across a driver unbind/rebind), genpd powers on RK3588_PD_GPU before panthor enables mali-supply, hanging the SoC as described in f94500eb7328 ("arm64: dts: rockchip: Add GPU power domain regulator dependency for RK3588").

[ ... ]

Quoted 15 lines

+&pcie3x4 {

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +14 -0
+	reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
+	vpcie3v3-supply = <&vcc3v3_pcie30>;
+	status = "okay";
+};
+
+&pinctrl {
+	hym8563 {
+		hym8563_int: hym8563-int {
+			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	leds {
+		led_pins: led-pins {

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts line 324

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +10 -0
+			rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	pcie3 {
+		pcie3_vcc3v3_en: pcie3-vcc3v3-en {
+			rockchip,pins = <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};

[Severity: Low]
Should &pinctrl also define RK_FUNC_GPIO pin configurations for the &pcie3x4 reset GPIO (gpio4 RK_PB6) and the two Ethernet PHY reset GPIOs (gpio3 RK_PC7 and gpio3 RK_PB7)?

Without pinctrl entries and pinctrl-0 references on those nodes, pin muxing and bias on the reset lines are left at hardware or bootloader defaults.

[ ... ]

Quoted 4 lines

+&sdmmc {

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +3 -0
+	/* card detect does not generate events on this board, poll instead */
+	broken-cd;
+	bus-width = <4>;

arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts line 380

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-aio-3588q.dts new file +10 -0
+	cap-sd-highspeed;
+	disable-wp;
+	max-frequency = <150000000>;
+	no-mmc;
+	no-sdio;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc3v3_sd>;
+	vqmmc-supply = <&vccio_sd_s0>;
+	status = "okay";
+};

[Severity: Medium]
Could the missing card detect events be caused by inheriting the default sdmmc_det pin mux from rk3588-base.dtsi instead of using cd-gpios?

In rk3588-base.dtsi, &sdmmc defaults to pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_det &sdmmc_bus4> inside RK3588_PD_SDMMC; once dw_mmc-rockchip runtime-suspends and powers off RK3588_PD_SDMMC, the controller's internal sdmmc_det logic can no longer detect card insertions, as noted in c7a9549ce46e ("arm64: dts: rockchip: Switch microSD card detect to gpio on Radxa ROCK 5 ITX/5C"). With broken-cd set instead, dw_mci_get_cd() always reports a card present and polls every second whenever the slot is empty, repeatedly powering on RK3588_PD_SDMMC and toggling vcc3v3_sd over I2C while gpio0 RK_PA4 remains muxed to sdmmc_det. Using cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW> and overriding pinctrl-0 to omit &sdmmc_det routes card detection through the always-on gpio0 controller.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2