Add Anbernic RG35XX-SP
Subsystems (2)
v3 cover Add Anbernic RG35XX-SP
From: Chris Morgan <[email protected]>
Add support for the Anbernic RG35XX-SP handheld gaming device. The Anbernic RG35XX-SP is a clamshell device, but hardware wise is very similar to the RG35XX-Plus. The RG35XX-SP has a lid-switch and an external RTC that necessitate a distinct device tree.
Please note that this series may have a soft pre-requisite on the patch series here [1].
[1] https://lore.kernel.org/linux-sunxi/[email protected]/
Changes from V2:
- Corrected commit message for device tree bindings.
- Added a fixes tag to i2c pinmux additions in sun50i-h616.dtsi file based on recommendation from Andre Przywara.
Changes from V1:
- Switched all RG35XX devices from the r_rsb bus to the r_i2c bus for the PMIC to keep it consistent.
- Added missing pinctrl nodes in sun50i-h616.dtsi file for the r_i2c bus.
- Modified devicetree documentation to keep definition of the RG35XX series consistent with other Allwinner devices.
Chris Morgan (4):
dt-bindings: arm: sunxi: Add Anbernic RG35XXSP
arm64: dts: allwinner: h616: Add r_i2c pinctrl nodes
arm64: dts: allwinner: h616: Change RG35XX Series from r_rsb to r_i2c
arm64: dts: allwinner: h700: Add Anbernic RG35XX-SP
.../devicetree/bindings/arm/sunxi.yaml | 9 +++-- arch/arm64/boot/dts/allwinner/Makefile | 3 +- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 2 ++ .../sun50i-h700-anbernic-rg35xx-2024.dts | 6 ++-- .../sun50i-h700-anbernic-rg35xx-sp.dts | 34 +++++++++++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dts
Signature · 1 line
2.34.1
PATCH v3 1/4 dt-bindings: arm: sunxi: Add Anbernic RG35XXSP
From: Chris Morgan <[email protected]>
Add the Anbernic RG35XXSP variant device.
The Anbernic RG35XXSP is almost identical to the RG35XX-Plus, but in a clamshell form-factor with an external RTC and a lid switch.
--- Documentation/devicetree/bindings/arm/sunxi.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/sunxi.yaml +7 -2
@@ -61,14 +61,19 @@ properties: - const: anbernic,rg35xx-2024 - const: allwinner,sun50i-h700 + - description: Anbernic RG35XX H + items: + - const: anbernic,rg35xx-h + - const: allwinner,sun50i-h700 + - description: Anbernic RG35XX Plus items: - const: anbernic,rg35xx-plus - const: allwinner,sun50i-h700 - - description: Anbernic RG35XX H + - description: Anbernic RG35XX SP items: - - const: anbernic,rg35xx-h + - const: anbernic,rg35xx-sp - const: allwinner,sun50i-h700 - description: Amarula A64 Relic
Signature · 1 line
2.34.1
Re: [PATCH V3 1/4] dt-bindings: arm: sunxi: Add Anbernic RG35XXSP
Quoted 8 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Add the Anbernic RG35XXSP variant device.
The Anbernic RG35XXSP is almost identical to the RG35XX-Plus, but in a clamshell form-factor with an external RTC and a lid switch.
Signed-off-by Chris Morgan <[email protected]>
Best regards,
Krzysztof
PATCH v3 2/4 arm64: dts: allwinner: h616: Add r_i2c pinctrl nodes
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
Add pinctrl nodes for the r_i2c node. Without the pinmux defined the r_i2c bus may fail to work, possibly if the bootloader uses rsb mode for the PMIC.
--- arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +2 -0
@@ -837,6 +837,8 @@ r_i2c: i2c@7081400 { dmas = <&dma 48>, <&dma 48>; dma-names = "rx", "tx"; resets = <&r_ccu RST_R_APB2_I2C>; + pinctrl-names = "default"; + pinctrl-0 = <&r_i2c_pins>; status = "disabled"; #address-cells = <1>; #size-cells = <0>;
Signature · 1 line
2.34.1
PATCH v3 3/4 arm64: dts: allwinner: h616: Change RG35XX Series from r_rsb to r_i2c
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
Change the Anbernic RG35XX series to use the r_i2c bus for the PMIC instead of the r_rsb bus. This is to keep the device tree consistent as there are at least 3 devices (the RG35XX-SP, RG28XX, and RG40XX-H) that have an external RTC on the r_i2c bus.
--- .../boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts +3 -3
@@ -201,12 +201,12 @@ &pio { vcc-pi-supply = <®_cldo3>; }; -&r_rsb { +&r_i2c { status = "okay"; - axp717: pmic@3a3 { + axp717: pmic@34 { compatible = "x-powers,axp717"; - reg = <0x3a3>; + reg = <0x34>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&nmi_intc>;
Signature · 1 line
2.34.1
Re: [PATCH V3 3/4] arm64: dts: allwinner: h616: Change RG35XX Series from r_rsb to r_i2c
On Wed, 10 Jul 2024 18:17:17 -0500
Chris Morgan <[email protected]> wrote:
Hi,
Quoted 6 lines
From: Chris Morgan <[email protected]>
Change the Anbernic RG35XX series to use the
r_i2cbus for the PMIC instead of ther_rsbbus. This is to keep the device tree consistent as there are at least 3 devices (the RG35XX-SP, RG28XX, and RG40XX-H) that have an external RTC on ther_i2cbus.
The change itself looks alright, but I would like to see some Tested-by:s from people with those Allwinner Anbernic devices, since the change affects all of them.
Quoted 1 line
Signed-off-by Chris Morgan <[email protected]>
Cheers,
Andre
Quoted 24 lines
--- .../boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts +3
-3@@ -201,12 +201,12 @@ &pio { vcc-pi-supply = <®_cldo3>; }; -&r_rsb { +&r_i2c { status = "okay"; - axp717: pmic@3a3 { + axp717: pmic@34 { compatible = "x-powers,axp717"; - reg = <0x3a3>; + reg = <0x34>; interrupt-controller; #interrupt-cells = <1>; interrupt-parent = <&nmi_intc>;
Ryan Walklin
Tested-byRe: [PATCH V3 3/4] arm64: dts: allwinner: h616: Change RG35XX Series from r_rsb to r_i2c
Quoted 12 lines · Andre Przywara
On Wed, 10 Jul 2024 18:17:17 -0500
Chris Morgan <[email protected]> wrote:Hi,
Quoted 6 lines
From: Chris Morgan <[email protected]>
Change the Anbernic RG35XX series to use the
r_i2cbus for the PMIC instead of ther_rsbbus. This is to keep the device tree consistent as there are at least 3 devices (the RG35XX-SP, RG28XX, and RG40XX-H) that have an external RTC on ther_i2cbus.
Quoted 8 lines
The change itself looks alright, but I would like to see some Tested-by:s from people with those Allwinner Anbernic devices, since the change affects all of them.
Quoted 1 line
Signed-off-by Chris Morgan <[email protected]>Reviewed-by Andre Przywara <[email protected]>
Tested on RG35XX-H and RG35XX-Plus devices, confirmed AXP717 detected and configured using I2C bus by both kernel and u-boot.
Also note this change corrects reboot behaviour on battery-based devices, where the AXP717 is not reset (and so remains in RSB mode) and is unable to be addressed by the u-boot SPL driver (which is I2C-only) on restart. Using I2C for all accesses prevents this behaviour.
Regards,
Ryan
PATCH v3 4/4 arm64: dts: allwinner: h700: Add Anbernic RG35XX-SP
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
The Anbernic RG35XXSP is almost identical to the RG35XX-Plus, but in a clamshell form-factor. The key differences between the SP and the Plus is a lid switch and an RTC on the same i2c bus as the PMIC.
--- arch/arm64/boot/dts/allwinner/Makefile | 3 +- .../sun50i-h700-anbernic-rg35xx-sp.dts | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dts
arch/arm64/boot/dts/allwinner/Makefile +2 -1
@@ -49,5 +49,6 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero3.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-transpeed-8k618-t.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-2024.dtb -dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-h.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-plus.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-sp.dtb
arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dts new file +34 -0
@@ -0,0 +1,34 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +/* + * Copyright (C) 2024 Ryan Walklin <[email protected]>. + * Copyright (C) 2024 Chris Morgan <[email protected]>. + */ + +#include <dt-bindings/input/gpio-keys.h> +#include "sun50i-h700-anbernic-rg35xx-plus.dts" + +/ { + model = "Anbernic RG35XX SP"; + compatible = "anbernic,rg35xx-sp", "allwinner,sun50i-h700"; + + gpio-keys-lid { + compatible = "gpio-keys"; + + lid-switch { + label = "Lid Switch"; + gpios = <&pio 4 7 GPIO_ACTIVE_LOW>; /* PE7 */ + linux,can-disable; + linux,code = <SW_LID>; + linux,input-type = <EV_SW>; + wakeup-event-action = <EV_ACT_DEASSERTED>; + wakeup-source; + }; + }; +}; + +&r_i2c { + rtc_ext: rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; +};
Signature · 1 line
2.34.1
Re: [PATCH V3 4/4] arm64: dts: allwinner: h700: Add Anbernic RG35XX-SP
On Wed, 10 Jul 2024 18:17:18 -0500
Chris Morgan <[email protected]> wrote:
Hi,
Quoted 7 lines
From: Chris Morgan <[email protected]>
The Anbernic RG35XXSP is almost identical to the RG35XX-Plus, but in a clamshell form-factor. The key differences between the SP and the Plus is a lid switch and an RTC on the same i2c bus as the PMIC.
Signed-off-by Chris Morgan <[email protected]>
Cheers,
Andre
Quoted 58 lines
--- arch/arm64/boot/dts/allwinner/Makefile | 3 +- .../sun50i-h700-anbernic-rg35xx-sp.dts | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dtsarch/arm64/boot/dts/allwinner/Makefile +2
-1@@ -49,5 +49,6 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero3.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-transpeed-8k618-t.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-2024.dtb -dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-plus.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-h.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-plus.dtb +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h700-anbernic-rg35xx-sp.dtbarch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dts new file +34
-0@@ -0,0 +1,34 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +/* + * Copyright (C) 2024 Ryan Walklin <[email protected]>. + * Copyright (C) 2024 Chris Morgan <[email protected]>. + */ + +#include <dt-bindings/input/gpio-keys.h> +#include "sun50i-h700-anbernic-rg35xx-plus.dts" + +/ { + model = "Anbernic RG35XX SP"; + compatible = "anbernic,rg35xx-sp", "allwinner,sun50i-h700"; + + gpio-keys-lid { + compatible = "gpio-keys"; + + lid-switch { + label = "Lid Switch"; + gpios = <&pio 4 7 GPIO_ACTIVE_LOW>; /* PE7 */ + linux,can-disable; + linux,code = <SW_LID>; + linux,input-type = <EV_SW>; + wakeup-event-action = <EV_ACT_DEASSERTED>; + wakeup-source; + }; + }; +}; + +&r_i2c { + rtc_ext: rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; +};
Rob Herring (Arm)
maintainerQuoted 39 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Add support for the Anbernic RG35XX-SP handheld gaming device. The Anbernic RG35XX-SP is a clamshell device, but hardware wise is very similar to the RG35XX-Plus. The RG35XX-SP has a lid-switch and an external RTC that necessitate a distinct device tree.
Please note that this series may have a soft pre-requisite on the patch series here [1].
[1] https://lore.kernel.org/linux-sunxi/[email protected]/
Changes from V2:
- Corrected commit message for device tree bindings.
- Added a fixes tag to i2c pinmux additions insun50i-h616.dtsifile based on recommendation from Andre Przywara.Changes from V1:
- Switched all RG35XX devices from ther_rsbbus to ther_i2cbus for the PMIC to keep it consistent.
- Added missing pinctrl nodes insun50i-h616.dtsifile for ther_i2cbus.
- Modified devicetree documentation to keep definition of the RG35XX series consistent with other Allwinner devices.Chris Morgan (4):
dt-bindings: arm: sunxi: Add Anbernic RG35XXSP
arm64: dts: allwinner: h616: Addr_i2cpinctrl nodes
arm64: dts: allwinner: h616: Change RG35XX Series fromr_rsbtor_i2c
arm64: dts: allwinner: h700: Add Anbernic RG35XX-SP.../devicetree/bindings/arm/sunxi.yaml | 9 +++-- arch/arm64/boot/dts/allwinner/Makefile | 3 +- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 2 ++ .../sun50i-h700-anbernic-rg35xx-2024.dts | 6 ++-- .../sun50i-h700-anbernic-rg35xx-sp.dts | 34 +++++++++++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dts
Quoted 5 lines
--
2.34.1
My bot found new DTB warnings on the .dts files added or changed in this series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:
pip3 install dtschema --upgrade
New warnings running 'make CHECK_DTBS=y allwinner/sun50i-h700-anbernic-rg35xx-2024.dtb allwinner/sun50i-h700-anbernic-rg35xx-sp.dtb' for [email protected]:
arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dtb: pmic@34: regulators: 'boost' does not match any of the regexes: '^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo)$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/mfd/x-powers,axp152.yaml#arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dtb: pmic@34: regulators: 'boost' does not match any of the regexes: '^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo)$', 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/mfd/x-powers,axp152.yaml#
On Thu, 11 Jul 2024 08:20:24 -0600
"Rob Herring (Arm)" <[email protected]> wrote:
Hi,
Quoted 47 lines · Chris Morgan
Quoted 39 lines
From: Chris Morgan <[email protected]>
Add support for the Anbernic RG35XX-SP handheld gaming device. The Anbernic RG35XX-SP is a clamshell device, but hardware wise is very similar to the RG35XX-Plus. The RG35XX-SP has a lid-switch and an external RTC that necessitate a distinct device tree.
Please note that this series may have a soft pre-requisite on the patch series here [1].
[1] https://lore.kernel.org/linux-sunxi/[email protected]/
Changes from V2:
- Corrected commit message for device tree bindings.
- Added a fixes tag to i2c pinmux additions insun50i-h616.dtsifile based on recommendation from Andre Przywara.Changes from V1:
- Switched all RG35XX devices from ther_rsbbus to ther_i2cbus for the PMIC to keep it consistent.
- Added missing pinctrl nodes insun50i-h616.dtsifile for ther_i2cbus.
- Modified devicetree documentation to keep definition of the RG35XX series consistent with other Allwinner devices.Chris Morgan (4):
dt-bindings: arm: sunxi: Add Anbernic RG35XXSP
arm64: dts: allwinner: h616: Addr_i2cpinctrl nodes
arm64: dts: allwinner: h616: Change RG35XX Series fromr_rsbtor_i2c
arm64: dts: allwinner: h700: Add Anbernic RG35XX-SP.../devicetree/bindings/arm/sunxi.yaml | 9 +++-- arch/arm64/boot/dts/allwinner/Makefile | 3 +- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 2 ++ .../sun50i-h700-anbernic-rg35xx-2024.dts | 6 ++-- .../sun50i-h700-anbernic-rg35xx-sp.dts | 34 +++++++++++++++++++ 5 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dtsQuoted 5 lines
--
2.34.1
Quoted 2 lines
My bot found new DTB warnings on the .dts files added or changed in this series.
That is a problem of an existing .dts files in the tree, namely sun50i-h700-anbernic-rg35xx-2024.dts. It describes the "boost" regulator, but the three patches adding that didn't make it in this time. So how do we deal with that?
This small binding patch would solve this particular problem:
https://lore.kernel.org/linux-sunxi/[email protected]/
It has an ACK from Lee and Krzysztof, but I guess it's too late now for 6.10? Do we just ignore it for now and push it as a fix after -rc1?
Cheers,
Andre
Quoted 31 lines
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:
pip3 install dtschema --upgradeNew warnings running 'make CHECK_DTBS=y
allwinner/sun50i-h700-anbernic-rg35xx-2024.dtb
allwinner/sun50i-h700-anbernic-rg35xx-sp.dtb' for
[email protected]:
arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dtb:
pmic@34: regulators: 'boost' does not match any of the regexes:
'^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo)$', 'pinctrl-[0-9]+' from schema $id:
http://devicetree.org/schemas/mfd/x-powers,axp152.yaml#arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-sp.dtb:
pmic@34: regulators: 'boost' does not match any of the regexes:
'^(([a-f])?ldo[0-9]|dcdc[0-7a-e]|ldo(_|-)io(0|1)|(dc1)?sw|rtc(_|-)ldo|cpusldo|drivevbus|dc5ldo)$', 'pinctrl-[0-9]+' from schema $id:
http://devicetree.org/schemas/mfd/x-powers,axp152.yaml#
Chen-Yu Tsai
AppliedQuoted 8 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Add support for the Anbernic RG35XX-SP handheld gaming device. The Anbernic RG35XX-SP is a clamshell device, but hardware wise is very similar to the RG35XX-Plus. The RG35XX-SP has a lid-switch and an external RTC that necessitate a distinct device tree.
[...]
Applied to sunxi/for-next in sunxi/linux.git, thanks!
[1/4] dt-bindings: arm: sunxi: Add Anbernic RG35XXSP
https://git.kernel.org/sunxi/linux/c/dbd52a3a0669 [2/4] arm64: dts: allwinner: h616: Add r_i2c pinctrl nodes https://git.kernel.org/sunxi/linux/c/7c9ea4ab7617 [3/4] arm64: dts: allwinner: h616: Change RG35XX Series from r_rsb to r_i2c https://git.kernel.org/sunxi/linux/c/c712e5d09856 [4/4] arm64: dts: allwinner: h700: Add Anbernic RG35XX-SP https://git.kernel.org/sunxi/linux/c/2873085a8cd5
Best regards,
Signature · 1 line
Chen-Yu Tsai <[email protected]>