Add devicetree for the Graperain G3568 v2
Subsystems (2)
v3 cover Add devicetree for the Graperain G3568 v2
Changes in v2:
- Fix trailing whitespaces and other formatting issues.
Changes in v3:
- Picked up Acked-by tag for patch 1.
- Fixed text wrapping in the commit message of patch 2.
- Replace the legacy 'gpio' label with 'gpios'.
- Add the Bluetooth UART child node.
Notes/Unchanged from v1:
- ADC keys have been verified with evtest and works fine; kept unchanged.
- The 'regulator-off-in-suspend' property for vqmmc-supply is retained. This is a known issue shared by most similar boards and should be addressed globally later.
---
Coia Prant (3):
dt-bindings: vendor-prefixes: Add graperain
dt-bindings: arm: rockchip: Add Graperain G3568 series
arm64: dts: rockchip: Add devicetree for the Graperain G3568 v2
.../devicetree/bindings/arm/rockchip.yaml | 6 + .../devicetree/bindings/vendor-prefixes.yaml | 2 + arch/arm64/boot/dts/rockchip/Makefile | 1 + .../rockchip/rk3568-graperain-g3568-v2.dts | 931 ++++++++++++++++++ 4 files changed, 940 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts
Signature · 1 line
2.47.3
PATCH v3 1/3 dt-bindings: vendor-prefixes: Add graperain
Add graperain to the vendor prefixes.
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -682,6 +682,8 @@ patternProperties: description: Goramo Gorecki "^gplus,.*": description: GPLUS + "^graperain,.*": + description: Shenzhen Graperain Technology Co., Ltd. "^grinn,.*": description: Grinn "^grmn,.*":
Signature · 1 line
2.47.3
PATCH v3 2/3 dt-bindings: arm: rockchip: Add Graperain G3568 series
In reply to Coia PrantDocument the Graperain G3568 v2, which is a development board based on the Rockchip RK3568 SoC.
Graperain G3568 series also have an SBC series with the suffix "box".
Graperain G3568 v2 belongs to development board series, not SBC series.
--- Documentation/devicetree/bindings/arm/rockchip.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +6 -0
@@ -684,6 +684,12 @@ properties: - const: google,veyron - const: rockchip,rk3288 + - description: Graperain G3568 series board + items: + - enum: + - graperain,g3568-v2 + - const: rockchip,rk3568 + - description: H96 Max V58 TV Box items: - const: haochuangyi,h96-max-v58
Signature · 1 line
2.47.3
PATCH v3 3/3 arm64: dts: rockchip: Add devicetree for the Graperain G3568 v2
In reply to Coia PrantThe Graperain G3568 v2 is an RK3568-based development board, just like the RK3568-EVB.
It always uses soldered connections between the GR3568CV2 core board and the RK3568BV2/GR3568BV2 I/O board.
The G3568 board has multiple hardware revisions, and we currently support v2 (I/O board).
Specification:
- SoC: RockChip RK3568 ARM64 (4 cores)
- eMMC: 16-128 GB
- RAM: 2-16 GB
- Power: DC 12V 2A
- Ethernet: 2x RTL8211F RGMII (10/100/1000 Mbps)
- Wireless radio: 802.11b/g/n/ac dual-band
- LED:
Power: AlwaysOn
User: GPIO
- Button:
ESC: SARADC/0 <1100k µV>
MENU: SARADC/0 <1400k µV>
VOL-: SARADC/0 <430k µV>
VOL+: SARADC/0 <50k µV>
Power/Reset: PMIC RK809
- CAN
CAN/1: 4-pin (PH 2.0)
- PWM
PWM/4: Backlight
PWM/5: Backlight
PWM/7: IR Receiver
- UART:
UART/2: Debug TTL - 1500000 8N1 (1.25mm)
UART/3: TTL (PH 2.0)
UART/4: TTL (PH 2.0)
UART/8: AP6356S Bluetooth
UART/9: TTL (PH 2.0)
- I2C:
I2C/0: PMIC RK809
I2C/1: Touchscreen
I2C/4: Camera
I2C/5: RTC@51 PCF8563
- I2S:
I2S/0: HDMI Sound
I2S/1: RK809 Audio Codec
I2S/3: AP6356S Bluetooth Sound
- SDMMC:
SDMMC/0: microSD (TF) slot
SDMMC/2: AP6356S SDIO WiFi card
- Camera: 1x CSI
- Video: HDMI / DSI0 (MIPI/LVDS) / DSI1 (MIPI/EDP)
- Audio: HDMI / MIC / Speaker / SPDIF / 3.5mm Headphones / AP6356S Bluetooth
- USB:
USB 2.0 HOST x2
USB 2.0 OTG x1 (shared with USB 3.0 OTG/HOST)
USB 3.0 HOST x1
USB 3.0 OTG/HOST x1
- SATA: 1x SATA 3.0 with Power/4-pin
- PCIe: 1x PCIe 3.0 x2 (x4 connector)
Link:
- https://image.chukouplus.com/upload/C_153/product_file/20211022/6daddec9e400458816dd4c57ba807fc3.pdf
- https://blog.gov.cooking/archives/research-graperain-g3568-v2-and-flash.html
--- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../rockchip/rk3568-graperain-g3568-v2.dts | 931 ++++++++++++++++++ 2 files changed, 932 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts
arch/arm64/boot/dts/rockchip/Makefile +1 -0
@@ -144,6 +144,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-easepi-r1.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r66s.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r68s.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-graperain-g3568-v2.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-hinlink-h66k.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-hinlink-h68k.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-lubancat-2.dtb
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +931 -0
931 lines not on this page · raw message
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH v3 3/3] arm64: dts: rockchip: Add devicetree for the Graperain G3568 v2
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [Medium] The Broadcom SDIO Wi-Fi node uses an undocumented compatible string without the required generic…
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [Medium] The Broadcom SDIO Wi-Fi node uses an undocumented compatible string without the required generic fallback, breaking driver OF parsing.
- [Medium] The adc-keys press-threshold-microvolt values are calculated as midpoints rather than target voltages, causing the MENU button to be incorrectly detected as the ESC button.
- [Medium] Incomplete Bluetooth I2S audio configuration: missing pinctrl and sound card binding.
- [Low] Copy-paste error in bluetooth pinctrl node names indicating the wrong GPIO bank and pin numbers.
--
commit 808ebde69e3acf8280f05f45c66fcb212e1918cd
Author: Coia Prant <[email protected]>
arm64: dts: rockchip: Add devicetree for the Graperain G3568 v2
The Graperain G3568 v2 is an RK3568-based development board. This patch introduces the device tree file to support its hardware features, including Ethernet, wireless connectivity, and physical buttons.
Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +1
-0@@ -0,0 +1,931 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
[ ... ]
Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +8
-0+ adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 0>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1800000>; + poll-interval = <100>; + + button-esc {
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts line 45
Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +10
-0+ label = "esc"; + linux,code = <KEY_ESC>; + press-threshold-microvolt = <1250000>; + }; + + button-menu { + label = "menu"; + linux,code = <KEY_MENU>; + press-threshold-microvolt = <1600000>; + };
[Severity: Medium]
Will this configuration correctly identify the MENU button? The commit message notes the hardware voltage for MENU is 1400000 microvolts.
Because the adc-keys driver matches based on the smallest absolute difference, a 1400000 microvolt reading is closer to the ESC threshold (1400000 - 1250000 = 150000) than the MENU threshold
(1600000 - 1400000 = 200000).
Could this cause pressing the MENU button to register as an ESC key press instead?
[ ... ]
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts line 600
Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +4
-0+/* used for AP6356S Bluetooth Sound */ +&i2s3_2ch { + status = "okay"; +};
[Severity: Medium]
Does this node require pinctrl and a simple-audio-card binding to function? It appears the I2S interface is enabled, but without routing the signals to the external AP6356S chip pins and linking the I2S CPU DAI to the Bluetooth codec DAI, ALSA might not register the sound card.
[ ... ]
Quoted 4 lines
+&pinctrl {
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +3
-0+ bluetooth { + bt_reg_on_h_gpio3_a0: bt-reg-on-h-gpio4-b2 { + rockchip,pins = <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts line 689
Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +10
-0+ }; + + bt_wake_host_h_gpio3_a1: bt-wake-host-h-gpio4-b4 { + rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + host_wake_bt_h_gpio3_a2: host-wake-bt-h-gpio4-b5 { + rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + };
[Severity: Low]
This isn't a functional bug, but do the node names here have a copy-paste error? They indicate gpio4-b2, gpio4-b4, and gpio4-b5, but the contents configure pins on GPIO bank 3 (RK_PA0, RK_PA1, RK_PA2).
[ ... ]
Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +10
-0+/* used for AP6356S WiFi */ +&sdmmc2 { + bus-width = <4>; + cap-sd-highspeed; + cap-sdio-irq; + keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc2m0_bus4 &sdmmc2m0_cmd &sdmmc2m0_clk>;
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts line 807
Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +10
-0+ sd-uhs-sdr104; + vmmc-supply = <&vcc3v3_sys>; + vqmmc-supply = <&vcc_1v8>; + status = "okay"; + + wifi@1 { + compatible = "brcm,bcm4356-fmac"; + reg = <1>; + }; +};
[Severity: Medium]
Is the generic fallback compatible string missing here? The brcmfmac driver explicitly checks for brcm,bcm4329-fmac during OF probing. Without this fallback, the driver's OF parser aborts and properties like a bootloader-injected local-mac-address might be ignored.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
Re: [PATCH v3 3/3] arm64: dts: rockchip: Add devicetree for the Graperain G3568 v2
Thanks for the review.
Quoted 23 lines
Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +8
-0+ adc-keys { + compatible = "adc-keys"; + io-channels = <&saradc 0>; + io-channel-names = "buttons"; + keyup-threshold-microvolt = <1800000>; + poll-interval = <100>; + + button-esc {arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts line 45
Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +10
-0+ label = "esc"; + linux,code = <KEY_ESC>; + press-threshold-microvolt = <1250000>; + }; + + button-menu { + label = "menu"; + linux,code = <KEY_MENU>; + press-threshold-microvolt = <1600000>; + };[Severity: Medium]
Will this configuration correctly identify the MENU button? The commit message notes the hardware voltage for MENU is 1400000 microvolts.
Quoted 7 lines
Because the adc-keys driver matches based on the smallest absolute difference, a 1400000 microvolt reading is closer to the ESC threshold (1400000 - 1250000 = 150000) than the MENU threshold
(1600000 - 1400000 = 200000).Could this cause pressing the MENU button to register as an ESC key press instead?
The ADC keys have been verified with evtest on actual hardware and they work perfectly fine.
Keep it.
Quoted 12 lines
[ ... ]
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts line 600
Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +4
-0+/* used for AP6356S Bluetooth Sound */ +&i2s3_2ch { + status = "okay"; +};[Severity: Medium]
Does this node require pinctrl and a simple-audio-card binding to function? It appears the I2S interface is enabled, but without routing the signals to the external AP6356S chip pins and linking the I2S CPU DAI to the Bluetooth codec DAI, ALSA might not register the sound card.
Yes, it requires rk3568-codec-digital for Bluetooth audio support. Since it's currently unavailable in the mainline, I will disable the i2s3_2ch node in v4 to avoid an incomplete configuration.
Quoted 13 lines
[ ... ]
Quoted 11 lines
+&pinctrl {
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +10
-0+ bluetooth { + bt_reg_on_h_gpio3_a0: bt-reg-on-h-gpio4-b2 { + rockchip,pins = <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + bt_wake_host_h_gpio3_a1: bt-wake-host-h-gpio4-b4 { + rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>; + }; + + host_wake_bt_h_gpio3_a2: host-wake-bt-h-gpio4-b5 {
Quoted 8 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts line 689
Quoted 3 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +3
-0+ rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + };[Severity: Low]
This isn't a functional bug, but do the node names here have a copy-paste error? They indicate gpio4-b2, gpio4-b4, and gpio4-b5, but the contents configure pins on GPIO bank 3 (RK_PA0,RK_PA1,RK_PA2).
Good catch, this is indeed a copy-paste error. I will fix the pinctrl node names to match the actual GPIO bank 3 pins in v4.
Quoted 20 lines
[ ... ]
Quoted 18 lines
arch/arm64/boot/dts/rockchip/rk3568-graperain-g3568-v2.dts new file +18
-0+/* used for AP6356S WiFi */ +&sdmmc2 { + bus-width = <4>; + cap-sd-highspeed; + cap-sdio-irq; + keep-power-in-suspend; + mmc-pwrseq = <&sdio_pwrseq>; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc2m0_bus4 &sdmmc2m0_cmd &sdmmc2m0_clk>; + sd-uhs-sdr104; + vmmc-supply = <&vcc3v3_sys>; + vqmmc-supply = <&vcc_1v8>; + status = "okay"; + + wifi@1 { + compatible = "brcm,bcm4356-fmac"; + reg = <1>;
Quoted 8 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ }; +};[Severity: Medium]
Is the generic fallback compatible string missing here? The brcmfmac driver explicitly checks for brcm,bcm4329-fmac during OF probing. Without this fallback, the driver's OF parser aborts and properties like a bootloader-injected local-mac-address might be ignored.
Understood. I will add the generic "brcm,bcm4329-fmac" fallback string to the Wi-Fi node in v4.
I'll wait a moment for further feedback from human maintainers before submitting v4.
Best,
Coia
Re: [PATCH v3 2/3] dt-bindings: arm: rockchip: Add Graperain G3568 series
In reply to Coia PrantQuoted 7 lines · Coia Prant
Document the Graperain G3568 v2, which is a development board based on the Rockchip RK3568 SoC.
Graperain G3568 series also have an SBC series with the suffix "box".
Graperain G3568 v2 belongs to development board series, not SBC series.
Quoted 8 lines
Link https://www.graperain.cn/RK3568/RK3568-Development/ (China)Signed-off-by Coia Prant <[email protected]>--- Documentation/devicetree/bindings/arm/rockchip.yaml | 6 ++++++ 1 file changed, 6 insertions(+)
Best regards,
Krzysztof