Skip to contentSkip to conversation

Add Anbernic RG353P and RG503

PATCH Applied Chris Morgan 2 participants 5 messages Sep 6, 2022 – Sep 9, 2022

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

v3 cover Add Anbernic RG353P and RG503

From: Chris Morgan <[email protected]>

Add the devicetrees for the Anbernic RG353P and RG503. This enables all the hardware that is currently supported via mainline Linux. The remaining hardware (for both devices) includes the display panel and the battery. The RG353P also requires drivers to be written and mainlined for the touchscreen.

Changes since V2:
- Renamed buttons to be consistent with their externally labelled function. Internal labels (such as sw11) would not allow for reuse of as many buttons in the rgxx3.dtsi tree.
- Removed pinctrl for LCD related functions. These will be re-added when the panel drivers are ready.
- Changed name of cw2015@62 to power-monitor@62 to keep it generic.

Changes since V1:
- Corrected node names to always have only dashes (no underscores), except for ones that require hard-coded names (the rk817 PMIC).
- Corrected all node aliases to always have only underscores (no dashes).
- Appended "regulator" to all the regulator node names, except ones that require hard-coded names (the rk817 PMIC).
- Corrected name of RG353P. Previously was called RG353.
- Changed name of sound node from rk817-sound to just sound.
- Changed name of gpio-keys to gpio-keys-control and removed volume buttons.
- Added new node of gpio-keys-vol and added volume buttons. This is so we can do autorepeat on these two buttons. Note that buttons under gpio-keys-control remain labelled in ascending order for the GPIO in use.
- Added note to adc-keys node that we deviate from the BSP kernel to comply with Linux input guidelines regarding gamepad menu buttons.
- Added note to sound node that audio is reversed for both speakers and headphones.
- Added additional hardware details to commit message for devicetrees.

Chris Morgan (3):
dt-bindings: vendor-prefixes: add Anbernic
dt-bindings: arm: rockchip: Add Anbernic RG353P and RG503
arm64: dts: rockchip: add Anbernic RG353P and RG503

 .../devicetree/bindings/arm/rockchip.yaml     |  10 +
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 arch/arm64/boot/dts/rockchip/Makefile         |   2 +
 .../dts/rockchip/rk3566-anbernic-rg353p.dts   |  94 ++
 .../dts/rockchip/rk3566-anbernic-rg503.dts    |  87 ++
 .../dts/rockchip/rk3566-anbernic-rgxx3.dtsi   | 831 ++++++++++++++++++
 6 files changed, 1026 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi
Signature · 1 line
2.25.1
#1 lore raw

PATCH v3 1/3 dt-bindings: vendor-prefixes: add Anbernic

From: Chris Morgan <[email protected]>

Anbernic designs and manufactures portable gaming systems.
https://anbernic.com/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 2f0151e9f6be..2a5a98d6fdda 100644
@@ -105,6 +105,8 @@ patternProperties:
     description: AMS-Taos Inc.
   "^analogix,.*":
     description: Analogix Semiconductor, Inc.
+  "^anbernic,.*":
+    description: Anbernic
   "^andestech,.*":
     description: Andes Technology Corporation
   "^anvo,.*":
Signature · 1 line
2.25.1
#2 lore raw

PATCH v3 2/3 dt-bindings: arm: rockchip: Add Anbernic RG353P and RG503

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Add entry for the Anbernic RG353P and RG503 handheld devices.

---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +10 -0
index 7811ba64149c..5d947a2de739 100644
@@ -30,6 +30,16 @@ properties:
           - const: amarula,vyasa-rk3288
           - const: rockchip,rk3288
 
+      - description: Anbernic RG353P
+        items:
+          - const: anbernic,rg353p
+          - const: rockchip,rk3566
+
+      - description: Anbernic RG503
+        items:
+          - const: anbernic,rg503
+          - const: rockchip,rk3566
+
       - description: Asus Tinker board
         items:
           - const: asus,rk3288-tinker
Signature · 1 line
2.25.1
#3 lore raw

PATCH v3 3/3 arm64: dts: rockchip: add Anbernic RG353P and RG503

In reply to Chris Morgan

From: Chris Morgan <[email protected]>

Anbernic RG353P and RG503 are both RK3566 based handheld gaming devices from Anbernic.

Both devices have:
- 2 SDMMC slots.
- A Realtek rtl8821cs WiFi/Bluetooth adapter.
- A mini HDMI port.
- A USB C host port and a USB C otg port (currently only working as device).
- Multiple GPIO buttons and a single ADC button.
- Dual analog joysticks controlled via a GPIO mux.
- A headphone jack with amplified stereo speakers via a SGM4865 amp.
- A PWM based vibrator for force feedback.

The RG353P has:
- 2GB LPDDR4 RAM.
- A 32GB eMMC.
- A 3.5 inch 640x480 4-lane DSI panel of unknown origin with an i2c controlled touchscreen (touchscreen is a Hynitron CST340).

The RG503 has:
- 1GB LPDDR4 RAM.
- A 5 inch 960x544 AMOLED 2-lane DSI/DBI panel manufactured by Samsung with part number ams495qa04. Data for this panel is provided via the DSI interface, however commands are sent via a 9-bit 3-wire SPI interface. The MISO pin of SPI3 of the SOC is wired to the input of the panel, so it must be bitbanged.

This devicetree enables the following hardware:
- HDMI (plus audio).
- Analog audio, including speakers.
- All buttons.
- All SDMMC/eMMC/SDIO controllers.
- The ADC joysticks (note a pending patch is required to use them).
- WiFi/Bluetooth (note out of tree drivers are required).
- The PWM based vibrator motor.

The following hardware is not enabled:
- The display panels (drivers are being written and there are issues with the upstream DSI and VOP2 subsystems).
- Battery (driver pending).
- Touchscreen on the RG353P (note the i2c2 bus is enabled for it).

---
 arch/arm64/boot/dts/rockchip/Makefile         |   2 +
 .../dts/rockchip/rk3566-anbernic-rg353p.dts   |  94 ++
 .../dts/rockchip/rk3566-anbernic-rg503.dts    |  87 ++
 .../dts/rockchip/rk3566-anbernic-rgxx3.dtsi   | 831 ++++++++++++++++++
 4 files changed, 1014 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi
arch/arm64/boot/dts/rockchip/Makefile +2 -0
index ef79a672804a..1402274a78a0 100644
@@ -57,6 +57,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399pro-rock-pi-n10.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg353p.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-anbernic-rg503.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.1.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-pinenote-v1.2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-quartz64-a.dtb
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts new file +94 -0

94 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg503.dts new file +87 -0

87 lines not on this page · raw message

arch/arm64/boot/dts/rockchip/rk3566-anbernic-rgxx3.dtsi new file +831 -0

831 lines not on this page · raw message

Signature · 1 line
2.25.1
maintainer Applied
#4 lore raw
In reply to Chris Morgan
Quoted 14 lines · Chris Morgan

Add the devicetrees for the Anbernic RG353P and RG503. This enables all the hardware that is currently supported via mainline Linux. The remaining hardware (for both devices) includes the display panel and the battery. The RG353P also requires drivers to be written and mainlined for the touchscreen.

Changes since V2:
- Renamed buttons to be consistent with their externally labelled function. Internal labels (such as sw11) would not allow for reuse of as many buttons in the rgxx3.dtsi tree.
- Removed pinctrl for LCD related functions. These will be re-added when the panel drivers are ready.
- Changed name of cw2015@62 to power-monitor@62 to keep it generic.

Quoted 1 line

[...]

Applied, thanks!

[1/3] dt-bindings: vendor-prefixes: add Anbernic

      commit: fff05e5af2247205f2ae4f93d1943d0938d8b2c3
[2/3] dt-bindings: arm: rockchip: Add Anbernic RG353P and RG503
      commit: 22eed92492e4a390da87196d55b1da0af4154595
[3/3] arm64: dts: rockchip: add Anbernic RG353P and RG503
      commit: 523adb553573db46593724fd1cd617339f2e9009

Best regards,

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