Skip to contentSkip to conversation

RK3588: FriendlyElec CM3588 NAS board support

PATCH Applied Sebastian Kropatsch 2 participants 5 messages Jun 16, 2024 – Jun 20, 2024

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

cover RK3588: FriendlyElec CM3588 NAS board support

Hello!

This adds support for the FriendlyElec CM3588 NAS board.
The board's device tree makes use of the latest upstream advances on the RK3588 like USB3 DRD and GPU support as well as the latest Rockchip PCIe driver bifurcation fixes, but some features such as thermal management and HDMI will have to be added later when SoC support for these features is merged.

Issues:
1) pcie3x4 BAR 1 fails to assign, see dmesg:
pci 0000:00:00.0: BAR 0 [mem 0x900000000-0x93fffffff]: assigned pci 0000:00:00.0: BAR 1 [mem size 0x40000000]: can't assign; no space pci 0000:00:00.0: BAR 1 [mem size 0x40000000]: failed to assign

2) The device enumeration of NVMe SSDs plugged into the four PCIe M.2 slots does not follow the order of the slots on the board: The slots are physically named from 1 to 4, top to bottom. However, they do not show up in this same order in Linux when all slots are polulated:
- SSD in physical slot 1 shows up as nvme0
- SSD in physical slot 2 shows up as nvme2
- SSD in physical slot 3 shows up as nvme1
- SSD in physical slot 4 shows up as nvme3
This is the same order in which the data lanes are mapped for PCIe bifurcation (dts property: data-lanes = <1 3 2 4>).
I could not solve this by using aliases for the PCIe nodes in the device tree. Perhaps this is something that can only be solved at driver level? I am not sure if this behaviour is even considered a bug or if this is intended behaviour by design.

Devicetree validation:
make CHECK_DTBS=y rockchip/rk3588-cm3588-nas.dtb does not give any warnings or errors, tested on Linux next-20240613.

Cheers,
Sebastian

---

Changes v3 -> v4:
- add pwm-beeper node
- add ir-receiver node
- leds: remove deprecated label props
- usbdp_phy0: add mode-switch prop
- minor fixes/comments
- collect r-b tag for patch 2
- v3: https://lore.kernel.org/linux-rockchip/[email protected]/

Changes v2 -> v3:
- add vmmc-supply and vqmmc-supply to &sdhci
- remove duplicate combphys
- add 4 times the same regulator for PCIe to reflect the schematics
- fix USB vcc_5v0_host_30_p2 to use 5V as per schematics
- usb-c-connector: disable sink power delivery, enable only source mode
- &u2phy0_otg: add phy-supply
- rename some nodes
- minor fixes and some additional helpful comments (some sugg. by Space Mayer)
- collect a-b tag for patch 1
- v2: https://lore.kernel.org/linux-rockchip/[email protected]/

Changes v1 -> v2:
- split dts into two files (CM and carrier board)
- rename fixed regulators with preferred 'regulator-' prefix
- use preferred 'gpios' property instead of 'gpio'
- add 'pinctrl-names' property for every pinctrl
- add several pwm nodes
- drop HMDI PHY and VOP support
- drop unneeded &wdt node
- remove i2c4 since it's not availabe according to the schematics
- &sdhci: drop 'full-pwr-cycle-in-suspend' flag
- &sdmmc: drop 'cap-mmc-highspeed' flag because of no-mmc
- &sdmmc: drop 'cd-gpios' property, unneeded w/ using sdmmc_det pinctrl
- &usb_host0_xhci, &usb_host2_xhci: remove default 'dr_mode' property

---

Sebastian Kropatsch (2):
dt-bindings: arm: rockchip: Add FriendlyElec CM3588 NAS
arm64: dts: rockchip: Add FriendlyElec CM3588 NAS board

 .../devicetree/bindings/arm/rockchip.yaml     |   7 +
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../rk3588-friendlyelec-cm3588-nas.dts        | 778 ++++++++++++++++++
 .../rockchip/rk3588-friendlyelec-cm3588.dtsi  | 653 +++++++++++++++
 4 files changed, 1439 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 dt-bindings: arm: rockchip: Add FriendlyElec CM3588 NAS

Add devicetree bindings for the FriendlyElec CM3588 NAS board.

The CM3588 NAS by FriendlyElec pairs the CM3588 compute module, based on the Rockchip RK3588 SoC, with the CM3588 NAS Kit carrier board.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +7 -0
index 77469270b271..eca0a42eb384 100644
@@ -248,6 +248,13 @@ properties:
           - const: friendlyarm,nanopc-t6
           - const: rockchip,rk3588
 
+      - description: FriendlyElec CM3588-based boards
+        items:
+          - enum:
+              - friendlyarm,cm3588-nas
+          - const: friendlyarm,cm3588
+          - const: rockchip,rk3588
+
       - description: GameForce Chi
         items:
           - const: gameforce,chi
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/2 arm64: dts: rockchip: Add FriendlyElec CM3588 NAS board

In reply to Sebastian Kropatsch

The CM3588 NAS by FriendlyElec pairs the CM3588 compute module, based on the Rockchip RK3588 SoC, with the CM3588 NAS Kit carrier board. To reflect the hardware setup, add device tree sources for the SoM and the NAS daughter board as separate files.

Hardware features:
- Rockchip RK3588 SoC
- 4GB/8GB/16GB LPDDR4x RAM
- 64GB eMMC
- MicroSD card slot
- 1x RTL8125B 2.5G Ethernet
- 4x M.2 M-Key with PCIe 3.0 x1 (via bifurcation) for NVMe SSDs
- 2x USB 3.0 (USB 3.1 Gen1) Type-A, 1x USB 2.0 Type-A
- 1x USB 3.0 Type-C with DP AltMode support
- 2x HDMI 2.1 out, 1x HDMI in
- MIPI-CSI Connector, MIPI-DSI Connector
- 40-pin GPIO header
- 4 buttons: power, reset, recovery, MASK, user button
- 3.5mm Headphone out, 2.0mm PH-2A Mic in
- 5V Fan connector, PWM beeper, IR receiver, RTC battery connector

PCIe bifurcation is used to handle all four M.2 sockets at PCIe 3.0 x1 speed. Data lane mapping in the DT is done like described in commit f8020dfb311d ("phy: rockchip-snps-pcie3: fix bifurcation on rk3588").

This device tree includes support for eMMC, SD card, ethernet, all USB2 and USB3 ports, all four M.2 slots, GPU, beeper, IR, RTC, UART debugging as well as the buttons and LEDs.
The GPIOs are labeled according to the schematics.

---
 arch/arm64/boot/dts/rockchip/Makefile         |   1 +
 .../rk3588-friendlyelec-cm3588-nas.dts        | 778 ++++++++++++++++++
 .../rockchip/rk3588-friendlyelec-cm3588.dtsi  | 653 +++++++++++++++
 3 files changed, 1432 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index 22f7ba98175b..85d949f2c909 100644
@@ -122,6 +122,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-edgeble-neu6a-io.dtb
 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-friendlyelec-cm3588-nas.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb
arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts new file +778 -0

778 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi new file +653 -0

653 lines not on this page · raw message

Signature · 1 line
2.43.0
#3 lore raw
In reply to Sebastian Kropatsch

Apologies for any confusions, this patch series is v4. The correct subject line is:
[PATCH v4 0/2] RK3588: FriendlyElec CM3588 NAS board support Apparently "git send-email -v4" doesn't add the version tag if you haven't already added it with "git format-patch" :)

Cheers,
Sebastian

Am 16.06.2024 um 23:48 schrieb Sebastian Kropatsch:

Quoted 88 lines

Hello!

This adds support for the FriendlyElec CM3588 NAS board.
The board's device tree makes use of the latest upstream advances on the RK3588 like USB3 DRD and GPU support as well as the latest Rockchip PCIe driver bifurcation fixes, but some features such as thermal management and HDMI will have to be added later when SoC support for these features is merged.

Issues:
1) pcie3x4 BAR 1 fails to assign, see dmesg:

    pci 0000:00:00.0: BAR 0 [mem 0x900000000-0x93fffffff]: assigned
    pci 0000:00:00.0: BAR 1 [mem size 0x40000000]: can't assign; no space
    pci 0000:00:00.0: BAR 1 [mem size 0x40000000]: failed to assign

2) The device enumeration of NVMe SSDs plugged into the four PCIe M.2 slots does not follow the order of the slots on the board: The slots are physically named from 1 to 4, top to bottom. However, they do not show up in this same order in Linux when all slots are polulated:
- SSD in physical slot 1 shows up as nvme0
- SSD in physical slot 2 shows up as nvme2
- SSD in physical slot 3 shows up as nvme1
- SSD in physical slot 4 shows up as nvme3
This is the same order in which the data lanes are mapped for PCIe bifurcation (dts property: data-lanes = <1 3 2 4>).
I could not solve this by using aliases for the PCIe nodes in the device tree. Perhaps this is something that can only be solved at driver level? I am not sure if this behaviour is even considered a bug or if this is intended behaviour by design.

Devicetree validation:
make CHECK_DTBS=y rockchip/rk3588-cm3588-nas.dtb does not give any warnings or errors, tested on Linux next-20240613.

Cheers,
Sebastian

---

Changes v3 -> v4:
- add pwm-beeper node
- add ir-receiver node
- leds: remove deprecated label props
- usbdp_phy0: add mode-switch prop
- minor fixes/comments
- collect r-b tag for patch 2
- v3: https://lore.kernel.org/linux-rockchip/[email protected]/

Changes v2 -> v3:
- add vmmc-supply and vqmmc-supply to &sdhci
- remove duplicate combphys
- add 4 times the same regulator for PCIe to reflect the schematics
- fix USB vcc_5v0_host_30_p2 to use 5V as per schematics
- usb-c-connector: disable sink power delivery, enable only source mode
- &u2phy0_otg: add phy-supply
- rename some nodes
- minor fixes and some additional helpful comments (some sugg. by Space Mayer)
- collect a-b tag for patch 1
- v2: https://lore.kernel.org/linux-rockchip/[email protected]/

Changes v1 -> v2:
- split dts into two files (CM and carrier board)
- rename fixed regulators with preferred 'regulator-' prefix
- use preferred 'gpios' property instead of 'gpio'
- add 'pinctrl-names' property for every pinctrl
- add several pwm nodes
- drop HMDI PHY and VOP support
- drop unneeded &wdt node
- remove i2c4 since it's not availabe according to the schematics
- &sdhci: drop 'full-pwr-cycle-in-suspend' flag
- &sdmmc: drop 'cap-mmc-highspeed' flag because of no-mmc
- &sdmmc: drop 'cd-gpios' property, unneeded w/ using sdmmc_det pinctrl
- &usb_host0_xhci, &usb_host2_xhci: remove default 'dr_mode' property

---

Sebastian Kropatsch (2):
dt-bindings: arm: rockchip: Add FriendlyElec CM3588 NAS
arm64: dts: rockchip: Add FriendlyElec CM3588 NAS board

  .../devicetree/bindings/arm/rockchip.yaml     |   7 +
  arch/arm64/boot/dts/rockchip/Makefile         |   1 +
  .../rk3588-friendlyelec-cm3588-nas.dts        | 778 ++++++++++++++++++
  .../rockchip/rk3588-friendlyelec-cm3588.dtsi  | 653 +++++++++++++++
  4 files changed, 1439 insertions(+)

create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588-nas.dts create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-friendlyelec-cm3588.dtsi

maintainer Applied
#4 lore raw
In reply to Sebastian Kropatsch
Quoted 8 lines · Sebastian Kropatsch

This adds support for the FriendlyElec CM3588 NAS board.
The board's device tree makes use of the latest upstream advances on the RK3588 like USB3 DRD and GPU support as well as the latest Rockchip PCIe driver bifurcation fixes, but some features such as thermal management and HDMI will have to be added later when SoC support for these features is merged.

[...]

Applied, thanks!

[1/2] dt-bindings: arm: rockchip: Add FriendlyElec CM3588 NAS

      commit: 85d8475ccff75bfff3fce0d4f027f22f75823fb1
[2/2] arm64: dts: rockchip: Add FriendlyElec CM3588 NAS board
      commit: 053799ea21fac16555484661c2690dd5139773b8

Best regards,

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