Skip to contentSkip to conversation

arm64: dts: rockchip: Add Firefly ITX-3588J Board

PATCH Applied Shimrra Shai 2 participants 5 messages Dec 13, 2024

Subsystems (2)

v2 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover arm64: dts: rockchip: Add Firefly ITX-3588J Board

NOTE: This is a resubmit of a previous submission with corrected recipients list and some small changes to make it more suited for the general kernel (e.g. eMMC is enabled now).

---

I am proposing a Device Tree Blob for the Firefly ITX-3588J board. This is another Mini-ITX form-factor board for the Rockchip RK3588 SoC, along with the ROCK 5 ITX. This version still has some outstanding issues, however, so I am unsure if it is ready for incorporation in this state and I have not yet found a fix for them as of now. I invite any comments.

Issues outstanding:
* Suspend does not work.
* The USB-C port does not work.
* Unsure how to get control over the main LED; the commented part seems to cause a failure.
* Audio output on the back green port does not seem to work; but I found this may be due to slight inadequacy of the still-new ES8323 driver - can suggest a patch for that too separately.
* Not sure if there are other board features that could still be enabled with the present kernel drivers.

Thanks,
Shimrra

Shimrra Shai (2):
arm64: dts: rockchip: add DTs for Firefly ITX-3588J
dt-bindings: arm: rockchip: Add Firefly ITX-3588J board

 .../devicetree/bindings/arm/rockchip.yaml     |    5 +
 arch/arm64/boot/dts/rockchip/Makefile         |    1 +
 .../dts/rockchip/rk3588-firefly-itx-3588j.dts | 1133 +++++++++++++++++
 .../boot/dts/rockchip/rockchip-pca9555.h      |   31 +
 4 files changed, 1170 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rockchip-pca9555.h
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/2 arm64: dts: rockchip: add DTs for Firefly ITX-3588J

Main DTS for the board and Makefile addition.

---
 arch/arm64/boot/dts/rockchip/Makefile         |    1 +
 .../dts/rockchip/rk3588-firefly-itx-3588j.dts | 1133 +++++++++++++++++
 .../boot/dts/rockchip/rockchip-pca9555.h      |   31 +
 3 files changed, 1165 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rockchip-pca9555.h
arch/arm64/boot/dts/rockchip/Makefile +1 -0
index 86cc418a2..3f2eebd1f 100644
@@ -137,6 +137,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-firefly-itx-3588j.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
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +1133 -0

1,133 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rockchip-pca9555.h new file +31 -0
new file mode 100644
index 000000000..c4c9a2471
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+/*
+ * Bindings for the PCA9555 GPIO extender used on some Rockchip devices, e.g.
+ * Firefly.
+ *
+ * Copyright (c) 2013 MundoReader S.L.
+ * Authors: Heiko Stuebner <[email protected]>
+ *          Shimrra Shai <[email protected]>
+ */
+
+#ifndef __RK_PCA9555_H__
+#define __RK_PCA9555_H__
+
+#define PCA_IO0_0          0
+#define PCA_IO0_1          1
+#define PCA_IO0_2          2
+#define PCA_IO0_3          3
+#define PCA_IO0_4          4
+#define PCA_IO0_5          5
+#define PCA_IO0_6          6
+#define PCA_IO0_7          7
+#define PCA_IO1_0          8
+#define PCA_IO1_1          9
+#define PCA_IO1_2          10
+#define PCA_IO1_3          11
+#define PCA_IO1_4          12
+#define PCA_IO1_5          13
+#define PCA_IO1_6          14
+#define PCA_IO1_7          15
+
+#endif
Signature · 1 line
2.45.2
maintainer Applied
#2 lore raw

Re: [PATCH v2 1/2] arm64: dts: rockchip: add DTs for Firefly ITX-3588J

Am Freitag, 13. Dezember 2024, 19:08:54 CET schrieb Shimrra Shai:

Quoted 13 lines

Main DTS for the board and Makefile addition.

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +3 -0
new file mode 100644
index 000000000..a99c007c7
@@ -0,0 +1,1133 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 13

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +10 -0
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/pwm/pwm.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
+#include "dt-bindings/usb/pd.h"
+#include "rockchip-pca9555.h"
+#include "rk3588.dtsi"

in line with my comment in the binding, please split the system-on-module parts into a rk3588-firefly-core-3588j.dtsi and then include that file here.

Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +8 -0
+
+/ {
+	model = "Firefly ITX-3588J";
+	compatible = "firefly,itx-3588j", "rockchip,rk3588";
+
+	aliases {
+		ethernet0 = &gmac0;
+		ethernet1 = &gmac1;

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 31

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +10 -0
+		mmc0 = &sdhci;
+	};
+
+	chosen {
+		stdout-path = "serial2:1500000n8";
+	};
+
+	/* NB: There are also a "Reset" and "Mask ROM" button but I don't
+	 * know the right settings for these. - Shimrra Shai
+	 */

same comment-style as below, plus

/*
* There are additional Reset and Maskrom keys connected, but their
* settings are still unknown right now.
*/

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 32

Quoted 1 line
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +1 -0
+	adc-keys-1 {

why is it adc-keys-1 ? (where is -0 ?)

Quoted 43 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +43 -0
+		compatible = "adc-keys";
+		io-channels = <&saradc 1>;
+		io-channel-names = "buttons";
+		keyup-threshold-microvolt = <1800000>;
+		poll-interval = <100>;
+
+		button-recovery {
+			label = "Recovery";
+			linux,code = <KEY_VENDOR>;
+			press-threshold-microvolt = <2000>;
+		};
+	};
+
+	analog-sound {
+		compatible = "simple-audio-card";
+		pinctrl-0 = <&hp_detect>;
+		pinctrl-names = "default";
+		simple-audio-card,aux-devs = <&amp_headphones>, <&amp_speaker>;
+		simple-audio-card,format = "i2s";
+		simple-audio-card,hp-det-gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_LOW>;
+		simple-audio-card,mclk-fs = <384>;
+		simple-audio-card,name = "rockchip_es8323";
+		simple-audio-card,pin-switches = "Headphones", "Speaker";
+		simple-audio-card,routing =
+			"Speaker Amplifier INL", "LOUT2",
+			"Speaker Amplifier INR", "ROUT2",
+			"Speaker", "Speaker Amplifier OUTL",
+			"Speaker", "Speaker Amplifier OUTR",
+			"Headphones Amplifier INL", "LOUT1",
+			"Headphones Amplifier INR", "ROUT1",
+			"Headphones", "Headphones Amplifier OUTL",
+			"Headphones", "Headphones Amplifier OUTR",
+			"LINPUT1", "Microphone Jack",
+			"RINPUT1", "Microphone Jack",
+			"LINPUT2", "Onboard Microphone",
+			"RINPUT2", "Onboard Microphone";
+		simple-audio-card,widgets =
+			"Microphone", "Microphone Jack",
+			"Microphone", "Onboard Microphone",
+			"Headphone", "Headphones",
+			"Speaker", "Speaker";
+
+		simple-audio-card,cpu {

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 85

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +10 -0
+			sound-dai = <&i2s0_8ch>;
+		};
+
+		simple-audio-card,codec {
+			sound-dai = <&es8323>;
+			system-clock-frequency = <12288000>;
+		};
+	};
+
+	/* note: this does not seem to be a proper "amplifier" but is just
	/*
	 * note: this does not seem to be a proper "amplifier" but is just

comment formatting please

Quoted 13 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +12 -0
+	 * a way to control the GPIO pins to switch on or off the given
+	 * sound output device
+	 */
+	amp_headphones: headphones-audio-amplifier {
+		compatible = "simple-audio-amplifier";
+		enable-gpios = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&headphone_amplifier_en>;
+		sound-name-prefix = "Headphones Amplifier";
+	};
 
+	leds {
+		compatible = "gpio-leds";

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 135

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +10 -0
+
+		/* NB: This Power LED control does not seem to work for
+		 * some reason. - Shimrra Shai
+		 */
+#if 0
+		power_led: led-0 {
+			gpios = <&gpio1 RK_PB3 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "default-on";
+		};
+#endif

please don't add dead code

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts

Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +8 -0
+
+		user_led: led-1 {
+			gpios = <&pca9555 PCA_IO0_3 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "disk-activity";
+		};
+	};
+
+	vcc_sata_pwr_en: vcc-sata-pwr-en-regulator {

vcc_sata_pwr_en: regulator-vcc-sata-pwr-en

Applied to all regulator nodes

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 272

Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +6 -0
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_sata_pwr_en";
+		regulator-boot-on;
+		regulator-always-on;
+		enable-active-high;
+		gpio = <&pca9555 PCA_IO1_2 GPIO_ACTIVE_HIGH>;  //PCA_IO 12

please sort properties (compatible, regs, [alphabetically], status) and please drop those comments at the end.

Applied to all regulator nodes

Quoted 1 line
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +1 -0
+	};

[...]

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 308

Quoted 3 lines

+&cpu_l0 {

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +2 -0
+	cpu-supply = <&vdd_cpu_lit_s0>;
+	mem-supply = <&vdd_cpu_lit_mem_s0>;

that mem-supply property is not specified and also is not necessary here. Same for the other cases above.

Quoted 1 line

+};

[...]

arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts line 485

Quoted 9 lines
arch/arm64/boot/dts/rockchip/rk3588-firefly-itx-3588j.dts new file +9 -0
+	usbc0: usb-typec@22 {
+		compatible = "fcs,fusb302";
+		reg = <0x22>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usbc0_int>;
+		vbus-supply = <&vbus5v0_typec_pwr_en>;
+		status = "okay";

default status is always "okay", so no need to add it for new nodes. Same for possible other places in this file.

arch/arm64/boot/dts/rockchip/rockchip-pca9555.h

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rockchip-pca9555.h new file +0 -0
new file mode 100644
index 000000000..c4c9a2471

if anything, that include needs to live in include/dt-bindings/something and needs to be a separate patch, if you really need that

arch/arm64/boot/dts/rockchip/rockchip-pca9555.h line 7

Quoted 8 lines
arch/arm64/boot/dts/rockchip/rockchip-pca9555.h new file +7 -0
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
+/*
+ * Bindings for the PCA9555 GPIO extender used on some Rockchip devices, e.g.
+ * Firefly.
+ *
+ * Copyright (c) 2013 MundoReader S.L.
+ * Authors: Heiko Stuebner <[email protected]>

where does this copyright come from? I don't remember being involved in a binding header for that expander?

Quoted 15 lines
arch/arm64/boot/dts/rockchip/rockchip-pca9555.h new file +14 -0
+ *          Shimrra Shai <[email protected]>
+ */
+
+#ifndef __RK_PCA9555_H__
+#define __RK_PCA9555_H__
+
+#define PCA_IO0_0          0
+#define PCA_IO0_1          1
+#define PCA_IO0_2          2
+#define PCA_IO0_3          3
+#define PCA_IO0_4          4
+#define PCA_IO0_5          5
+#define PCA_IO0_6          6
+#define PCA_IO0_7          7

arch/arm64/boot/dts/rockchip/rockchip-pca9555.h line 31

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rockchip-pca9555.h new file +10 -0
+#define PCA_IO1_0          8
+#define PCA_IO1_1          9
+#define PCA_IO1_2          10
+#define PCA_IO1_3          11
+#define PCA_IO1_4          12
+#define PCA_IO1_5          13
+#define PCA_IO1_6          14
+#define PCA_IO1_7          15
+
+#endif

Heiko

#3 lore raw

PATCH v2 2/2 dt-bindings: arm: rockchip: Add Firefly ITX-3588J board

In reply to Shimrra Shai

Document the compatibles for the new board.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
index 753199a12..9ee96acdc 100644
@@ -190,6 +190,11 @@ properties:
           - const: firefly,firefly-rk3399
           - const: rockchip,rk3399
 
+      - description: Firefly ITX-3588J
+        items:
+          - const: firefly,itx-3588j
+          - const: rockchip,rk3588
+
       - description: Firefly ROC-RK3308-CC
         items:
           - const: firefly,roc-rk3308-cc
Signature · 1 line
2.45.2
maintainer
#4 lore raw

Re: [PATCH v2 2/2] dt-bindings: arm: rockchip: Add Firefly ITX-3588J board

Hi,

Am Freitag, 13. Dezember 2024, 19:08:55 CET schrieb Shimrra Shai:

Quoted 12 lines

Document the compatibles for the new board.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +0 -0
index 753199a12..9ee96acdc 100644

Documentation/devicetree/bindings/arm/rockchip.yaml properties: · line 197

Quoted 8 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
@@ -190,6 +190,11 @@ properties:
           - const: firefly,firefly-rk3399
           - const: rockchip,rk3399
 
+      - description: Firefly ITX-3588J
+        items:
+          - const: firefly,itx-3588j
+          - const: rockchip,rk3588
+

looking at the product-page, this is not _one_ complete board. Instead it seems to be a system-on-module + baseboard design.

It looks like it uses the Core-3588J system-on-module [0].

We already have a number of those in the binding file to take as example on how to structure that. For example FriendlyElec CM3588-based boards .

So you could do

- description: Firefly Core-3588J-based boards items:
- enum:
- firefly,itx-3588j
- const: firefly,core-rk3588j
- const: rockchip,rk3588

Thanks
Heiko

[0] https://en.t-firefly.com/product/core/core3588j