* [PATCH V4 1/8] dt-bindings: vendor-prefixes: document Saef Technology
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-08-28 21:33 ` Rob Herring
2023-08-28 18:19 ` [PATCH V4 2/8] dt-bindings: display: panel: mipi-dbi-spi: add Saef SF-TC154B Chris Morgan
` (6 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan, Conor Dooley
From: Chris Morgan <macromorgan@hotmail.com>
Document Saef Technology (https://www.saefdisplay.com/).
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index af60bf1a6664..dda90f9d264b 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1151,6 +1151,8 @@ patternProperties:
description: Shenzhen Roofull Technology Co, Ltd
"^roseapplepi,.*":
description: RoseapplePi.org
+ "^saef,.*":
+ description: Saef Technology Limited
"^samsung,.*":
description: Samsung Semiconductor
"^samtec,.*":
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V4 1/8] dt-bindings: vendor-prefixes: document Saef Technology
2023-08-28 18:19 ` [PATCH V4 1/8] dt-bindings: vendor-prefixes: document Saef Technology Chris Morgan
@ 2023-08-28 21:33 ` Rob Herring
0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2023-08-28 21:33 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-sunxi, noralf, sam, airlied, mripard, jernej.skrabec,
robh+dt, devicetree, daniel, uwu, andre.przywara, neil.armstrong,
krzysztof.kozlowski+dt, wens, Conor Dooley, Chris Morgan, samuel,
heiko, jagan, conor+dt
On Mon, 28 Aug 2023 13:19:34 -0500, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Document Saef Technology (https://www.saefdisplay.com/).
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V4 2/8] dt-bindings: display: panel: mipi-dbi-spi: add Saef SF-TC154B
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
2023-08-28 18:19 ` [PATCH V4 1/8] dt-bindings: vendor-prefixes: document Saef Technology Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-08-28 21:33 ` Rob Herring
2023-08-28 18:19 ` [PATCH V4 3/8] arm: dts: sun8i: V3s: Add pinctrl for pwm Chris Morgan
` (5 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan, Conor Dooley
From: Chris Morgan <macromorgan@hotmail.com>
The Saef SF-TC154B is a 1.54 inch 240x240 square panel with a MIPI DBI
compatible interface. The panel is used on the Anbernic RG-Nano
handheld gaming device.
The initialization of the panel requires a firmware binary which can
be made with the mipi-dbi-cmd[1] tool. The command sequence needed
can be found in both source[2] and binary form[3].
[1]: https://github.com/notro/panel-mipi-dbi
[2]: https://github.com/macromorgan/panel-mipi-dbi-firmware/raw/main/saef%2Csftc154b.txt
[3]: https://github.com/macromorgan/panel-mipi-dbi-firmware/raw/main/saef%2Csftc154b.bin
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
---
.../devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml
index 2f0238b770eb..04cc5bfce051 100644
--- a/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml
+++ b/Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml
@@ -66,6 +66,7 @@ properties:
compatible:
items:
- enum:
+ - saef,sftc154b
- sainsmart18
- shineworld,lh133k
- const: panel-mipi-dbi-spi
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V4 2/8] dt-bindings: display: panel: mipi-dbi-spi: add Saef SF-TC154B
2023-08-28 18:19 ` [PATCH V4 2/8] dt-bindings: display: panel: mipi-dbi-spi: add Saef SF-TC154B Chris Morgan
@ 2023-08-28 21:33 ` Rob Herring
0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2023-08-28 21:33 UTC (permalink / raw)
To: Chris Morgan
Cc: robh+dt, conor+dt, krzysztof.kozlowski+dt, wens, Chris Morgan,
mripard, Conor Dooley, linux-sunxi, neil.armstrong, noralf,
jernej.skrabec, jagan, uwu, airlied, andre.przywara, samuel,
devicetree, sam, daniel, heiko
On Mon, 28 Aug 2023 13:19:35 -0500, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Saef SF-TC154B is a 1.54 inch 240x240 square panel with a MIPI DBI
> compatible interface. The panel is used on the Anbernic RG-Nano
> handheld gaming device.
>
> The initialization of the panel requires a firmware binary which can
> be made with the mipi-dbi-cmd[1] tool. The command sequence needed
> can be found in both source[2] and binary form[3].
>
> [1]: https://github.com/notro/panel-mipi-dbi
> [2]: https://github.com/macromorgan/panel-mipi-dbi-firmware/raw/main/saef%2Csftc154b.txt
> [3]: https://github.com/macromorgan/panel-mipi-dbi-firmware/raw/main/saef%2Csftc154b.bin
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Acked-by: Noralf Trønnes <noralf@tronnes.org>
> ---
> .../devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V4 3/8] arm: dts: sun8i: V3s: Add pinctrl for pwm
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
2023-08-28 18:19 ` [PATCH V4 1/8] dt-bindings: vendor-prefixes: document Saef Technology Chris Morgan
2023-08-28 18:19 ` [PATCH V4 2/8] dt-bindings: display: panel: mipi-dbi-spi: add Saef SF-TC154B Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-09-04 20:46 ` Andre Przywara
2023-08-28 18:19 ` [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI Chris Morgan
` (4 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan
From: Chris Morgan <macromorgan@hotmail.com>
Add pinctrl nodes for pwm0 and pwm1.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
index 3b9a282c2746..c87476ea31e2 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
@@ -414,6 +414,18 @@ mmc1_pins: mmc1-pins {
bias-pull-up;
};
+ /omit-if-no-ref/
+ pwm0_pin: pwm0-pin {
+ pins = "PB4";
+ function = "pwm0";
+ };
+
+ /omit-if-no-ref/
+ pwm1_pin: pwm1-pin {
+ pins = "PB5";
+ function = "pwm1";
+ };
+
spi0_pins: spi0-pins {
pins = "PC0", "PC1", "PC2", "PC3";
function = "spi0";
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V4 3/8] arm: dts: sun8i: V3s: Add pinctrl for pwm
2023-08-28 18:19 ` [PATCH V4 3/8] arm: dts: sun8i: V3s: Add pinctrl for pwm Chris Morgan
@ 2023-09-04 20:46 ` Andre Przywara
0 siblings, 0 replies; 24+ messages in thread
From: Andre Przywara @ 2023-09-04 20:46 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-sunxi, devicetree, airlied, conor+dt, daniel, heiko, jagan,
jernej.skrabec, krzysztof.kozlowski+dt, mripard, neil.armstrong,
noralf, robh+dt, sam, samuel, uwu, wens, Chris Morgan
On Mon, 28 Aug 2023 13:19:36 -0500
Chris Morgan <macroalpha82@gmail.com> wrote:
Hi,
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Add pinctrl nodes for pwm0 and pwm1.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Thanks for the changes, looks good now:
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
> index 3b9a282c2746..c87476ea31e2 100644
> --- a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
> +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
> @@ -414,6 +414,18 @@ mmc1_pins: mmc1-pins {
> bias-pull-up;
> };
>
> + /omit-if-no-ref/
> + pwm0_pin: pwm0-pin {
> + pins = "PB4";
> + function = "pwm0";
> + };
> +
> + /omit-if-no-ref/
> + pwm1_pin: pwm1-pin {
> + pins = "PB5";
> + function = "pwm1";
> + };
> +
> spi0_pins: spi0-pins {
> pins = "PC0", "PC1", "PC2", "PC3";
> function = "spi0";
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
` (2 preceding siblings ...)
2023-08-28 18:19 ` [PATCH V4 3/8] arm: dts: sun8i: V3s: Add pinctrl for pwm Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-08-28 21:33 ` Rob Herring
` (2 more replies)
2023-08-28 18:19 ` [PATCH V4 5/8] dt-bindings: usb: Add V3s compatible string for OHCI Chris Morgan
` (3 subsequent siblings)
7 siblings, 3 replies; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan, Conor Dooley
From: Chris Morgan <macromorgan@hotmail.com>
The Allwinner V3s uses a generic EHCI and OHCI for USB host
communication and the MUSB controller for OTG mode. Add compatible
strings for the EHCI node.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
Documentation/devicetree/bindings/usb/generic-ehci.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/usb/generic-ehci.yaml b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
index b956bb5fada7..f37191f21501 100644
--- a/Documentation/devicetree/bindings/usb/generic-ehci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
@@ -38,6 +38,7 @@ properties:
- allwinner,sun8i-a83t-ehci
- allwinner,sun8i-h3-ehci
- allwinner,sun8i-r40-ehci
+ - allwinner,sun8i-v3s-ehci
- allwinner,sun9i-a80-ehci
- allwinner,sun20i-d1-ehci
- aspeed,ast2400-ehci
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI
2023-08-28 18:19 ` [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI Chris Morgan
@ 2023-08-28 21:33 ` Rob Herring
2023-08-28 21:34 ` Rob Herring
2023-09-08 9:32 ` Andre Przywara
2 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2023-08-28 21:33 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-sunxi, devicetree, airlied, andre.przywara, conor+dt,
daniel, heiko, jagan, jernej.skrabec, krzysztof.kozlowski+dt,
mripard, neil.armstrong, noralf, sam, samuel, uwu, wens,
Chris Morgan, Conor Dooley
On Mon, Aug 28, 2023 at 01:19:37PM -0500, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Allwinner V3s uses a generic EHCI and OHCI for USB host
> communication and the MUSB controller for OTG mode. Add compatible
> strings for the EHCI node.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> Documentation/devicetree/bindings/usb/generic-ehci.yaml | 1 +
> 1 file changed, 1 insertion(+)
Normally, Greg would take this, but neither he nor linux-usb were Cc'ed.
Please use get_maintainer.pl.
Rob
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI
2023-08-28 18:19 ` [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI Chris Morgan
2023-08-28 21:33 ` Rob Herring
@ 2023-08-28 21:34 ` Rob Herring
2023-09-08 9:32 ` Andre Przywara
2 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2023-08-28 21:34 UTC (permalink / raw)
To: Chris Morgan
Cc: samuel, devicetree, neil.armstrong, mripard, wens, sam, airlied,
conor+dt, jagan, linux-sunxi, krzysztof.kozlowski+dt, uwu, daniel,
Conor Dooley, heiko, Chris Morgan, jernej.skrabec, andre.przywara,
robh+dt, noralf
On Mon, 28 Aug 2023 13:19:37 -0500, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Allwinner V3s uses a generic EHCI and OHCI for USB host
> communication and the MUSB controller for OTG mode. Add compatible
> strings for the EHCI node.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> Documentation/devicetree/bindings/usb/generic-ehci.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI
2023-08-28 18:19 ` [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI Chris Morgan
2023-08-28 21:33 ` Rob Herring
2023-08-28 21:34 ` Rob Herring
@ 2023-09-08 9:32 ` Andre Przywara
2 siblings, 0 replies; 24+ messages in thread
From: Andre Przywara @ 2023-09-08 9:32 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-sunxi, devicetree, airlied, conor+dt, daniel, heiko, jagan,
jernej.skrabec, krzysztof.kozlowski+dt, mripard, neil.armstrong,
noralf, robh+dt, sam, samuel, uwu, wens, Chris Morgan,
Conor Dooley
On Mon, 28 Aug 2023 13:19:37 -0500
Chris Morgan <macroalpha82@gmail.com> wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Allwinner V3s uses a generic EHCI and OHCI for USB host
> communication and the MUSB controller for OTG mode. Add compatible
> strings for the EHCI node.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
That looks alright, but you can squash this and the next patch into one -
but only in case you need to re-send anyway.
Cheers,
Andre
> ---
> Documentation/devicetree/bindings/usb/generic-ehci.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/usb/generic-ehci.yaml b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
> index b956bb5fada7..f37191f21501 100644
> --- a/Documentation/devicetree/bindings/usb/generic-ehci.yaml
> +++ b/Documentation/devicetree/bindings/usb/generic-ehci.yaml
> @@ -38,6 +38,7 @@ properties:
> - allwinner,sun8i-a83t-ehci
> - allwinner,sun8i-h3-ehci
> - allwinner,sun8i-r40-ehci
> + - allwinner,sun8i-v3s-ehci
> - allwinner,sun9i-a80-ehci
> - allwinner,sun20i-d1-ehci
> - aspeed,ast2400-ehci
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V4 5/8] dt-bindings: usb: Add V3s compatible string for OHCI
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
` (3 preceding siblings ...)
2023-08-28 18:19 ` [PATCH V4 4/8] dt-bindings: usb: Add V3s compatible string for EHCI Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-08-28 21:34 ` Rob Herring
2023-08-28 18:19 ` [PATCH V4 6/8] ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts Chris Morgan
` (2 subsequent siblings)
7 siblings, 1 reply; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan, Conor Dooley
From: Chris Morgan <macromorgan@hotmail.com>
The Allwinner V3s uses a generic EHCI and OHCI for USB host
communication and the MUSB controller for OTG mode. Add compatible
strings for the EHCI node.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
Documentation/devicetree/bindings/usb/generic-ohci.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/usb/generic-ohci.yaml b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
index be268e23ca79..b9576015736b 100644
--- a/Documentation/devicetree/bindings/usb/generic-ohci.yaml
+++ b/Documentation/devicetree/bindings/usb/generic-ohci.yaml
@@ -25,6 +25,7 @@ properties:
- allwinner,sun8i-a83t-ohci
- allwinner,sun8i-h3-ohci
- allwinner,sun8i-r40-ohci
+ - allwinner,sun8i-v3s-ohci
- allwinner,sun9i-a80-ohci
- allwinner,sun20i-d1-ohci
- brcm,bcm3384-ohci
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V4 5/8] dt-bindings: usb: Add V3s compatible string for OHCI
2023-08-28 18:19 ` [PATCH V4 5/8] dt-bindings: usb: Add V3s compatible string for OHCI Chris Morgan
@ 2023-08-28 21:34 ` Rob Herring
0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2023-08-28 21:34 UTC (permalink / raw)
To: Chris Morgan
Cc: Conor Dooley, heiko, uwu, andre.przywara, robh+dt, noralf, daniel,
conor+dt, neil.armstrong, Chris Morgan, samuel, airlied, sam,
mripard, linux-sunxi, jagan, krzysztof.kozlowski+dt,
jernej.skrabec, wens, devicetree
On Mon, 28 Aug 2023 13:19:38 -0500, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Allwinner V3s uses a generic EHCI and OHCI for USB host
> communication and the MUSB controller for OTG mode. Add compatible
> strings for the EHCI node.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> ---
> Documentation/devicetree/bindings/usb/generic-ohci.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V4 6/8] ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
` (4 preceding siblings ...)
2023-08-28 18:19 ` [PATCH V4 5/8] dt-bindings: usb: Add V3s compatible string for OHCI Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-09-04 20:59 ` Andre Przywara
2023-08-28 18:19 ` [PATCH V4 7/8] dt-bindings: arm: sunxi: add Anbernic RG-Nano Chris Morgan
2023-08-28 18:19 ` [PATCH V4 8/8] ARM: dts: sunxi: add support for " Chris Morgan
7 siblings, 1 reply; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan
From: Chris Morgan <macromorgan@hotmail.com>
Add the EHCI and OHCI controller to the Allwinner v3s to support using
USB in host mode.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
index c87476ea31e2..e8a04476b776 100644
--- a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
@@ -319,6 +319,29 @@ usbphy: phy@1c19400 {
#phy-cells = <1>;
};
+ ehci: usb@1c1a000 {
+ compatible = "allwinner,sun8i-v3s-ehci", "generic-ehci";
+ reg = <0x01c1a000 0x100>;
+ interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;
+ resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
+ phys = <&usbphy 0>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
+ ohci: usb@1c1a400 {
+ compatible = "allwinner,sun8i-v3s-ohci", "generic-ohci";
+ reg = <0x01c1a400 0x100>;
+ interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,
+ <&ccu CLK_USB_OHCI0>;
+ resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
+ phys = <&usbphy 0>;
+ phy-names = "usb";
+ status = "disabled";
+ };
+
ccu: clock@1c20000 {
compatible = "allwinner,sun8i-v3s-ccu";
reg = <0x01c20000 0x400>;
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V4 6/8] ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts
2023-08-28 18:19 ` [PATCH V4 6/8] ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts Chris Morgan
@ 2023-09-04 20:59 ` Andre Przywara
0 siblings, 0 replies; 24+ messages in thread
From: Andre Przywara @ 2023-09-04 20:59 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-sunxi, devicetree, airlied, conor+dt, daniel, heiko, jagan,
jernej.skrabec, krzysztof.kozlowski+dt, mripard, neil.armstrong,
noralf, robh+dt, sam, samuel, uwu, wens, Chris Morgan
On Mon, 28 Aug 2023 13:19:39 -0500
Chris Morgan <macroalpha82@gmail.com> wrote:
Hi,
> From: Chris Morgan <macromorgan@hotmail.com>
>
> Add the EHCI and OHCI controller to the Allwinner v3s to support using
> USB in host mode.
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Looks good now, and the PHY connection is correct, even though the
current code is ... interesting in this regard. It looks like the
problem is more with the sunxi MUSB glue driver, though. Anyway:
Addresses, IRQs, clocks and resets checked against the manual:
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Cheers,
Andre
> ---
> arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi | 23 ++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
> index c87476ea31e2..e8a04476b776 100644
> --- a/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
> +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s.dtsi
> @@ -319,6 +319,29 @@ usbphy: phy@1c19400 {
> #phy-cells = <1>;
> };
>
> + ehci: usb@1c1a000 {
> + compatible = "allwinner,sun8i-v3s-ehci", "generic-ehci";
> + reg = <0x01c1a000 0x100>;
> + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;
> + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
> + phys = <&usbphy 0>;
> + phy-names = "usb";
> + status = "disabled";
> + };
> +
> + ohci: usb@1c1a400 {
> + compatible = "allwinner,sun8i-v3s-ohci", "generic-ohci";
> + reg = <0x01c1a400 0x100>;
> + interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,
> + <&ccu CLK_USB_OHCI0>;
> + resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
> + phys = <&usbphy 0>;
> + phy-names = "usb";
> + status = "disabled";
> + };
> +
> ccu: clock@1c20000 {
> compatible = "allwinner,sun8i-v3s-ccu";
> reg = <0x01c20000 0x400>;
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH V4 7/8] dt-bindings: arm: sunxi: add Anbernic RG-Nano
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
` (5 preceding siblings ...)
2023-08-28 18:19 ` [PATCH V4 6/8] ARM: dts: sun8i: v3s: add EHCI and OHCI to v3s dts Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-08-28 18:19 ` [PATCH V4 8/8] ARM: dts: sunxi: add support for " Chris Morgan
7 siblings, 0 replies; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan, Krzysztof Kozlowski
From: Chris Morgan <macromorgan@hotmail.com>
The Anbernic RG-Nano is a portable handheld console from Anbernic which
uses the Allwinner V3s SoC.
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
index ee8fdd2da869..806f25b561d9 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -56,6 +56,11 @@ properties:
- const: amarula,a64-relic
- const: allwinner,sun50i-a64
+ - description: Anbernic RG-Nano
+ items:
+ - const: anbernic,rg-nano
+ - const: allwinner,sun8i-v3s
+
- description: Auxtek T003 A10s HDMI TV Stick
items:
- const: allwinner,auxtek-t003
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-08-28 18:19 [PATCH V4 0/8] Add Anbernic RG-Nano Chris Morgan
` (6 preceding siblings ...)
2023-08-28 18:19 ` [PATCH V4 7/8] dt-bindings: arm: sunxi: add Anbernic RG-Nano Chris Morgan
@ 2023-08-28 18:19 ` Chris Morgan
2023-09-05 20:32 ` Jernej Škrabec
` (2 more replies)
7 siblings, 3 replies; 24+ messages in thread
From: Chris Morgan @ 2023-08-28 18:19 UTC (permalink / raw)
To: linux-sunxi
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan
From: Chris Morgan <macromorgan@hotmail.com>
The Anbernic RG-Nano is a small portable game device based on the
Allwinner V3s SoC. It has GPIO buttons on the face and side for
input, a single mono speaker, a 240x240 SPI controlled display, a USB-C
OTG port, an SD card slot for booting, and 64MB of RAM included in the
SoC.
Working/Tested:
- SDMMC
- UART (for debugging)
- Buttons
- Charging/battery/PMIC
- Speaker
- RTC
- USB Host and Gadget*
- Display (at 60hz)
*There is an issue with the usb_phy where it forces the device to host
mode. Until the phy driver is fixed this can be bypassed by either
removing the phy references from the ohci and ehci nodes or by setting
the usbphy on the ohci and ehci nodes to 1 (which is incorrect).
Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
arch/arm/boot/dts/allwinner/Makefile | 1 +
.../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++
2 files changed, 285 insertions(+)
create mode 100644 arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile
index 589a1ce1120a..2be83a1edcbb 100644
--- a/arch/arm/boot/dts/allwinner/Makefile
+++ b/arch/arm/boot/dts/allwinner/Makefile
@@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
sun8i-t113s-mangopi-mq-r-t113.dtb \
sun8i-t3-cqa3t-bv3.dtb \
sun8i-v3-sl631-imx179.dtb \
+ sun8i-v3s-anbernic-rg-nano.dtb \
sun8i-v3s-licheepi-zero.dtb \
sun8i-v3s-licheepi-zero-dock.dtb \
sun8i-v40-bananapi-m2-berry.dtb
diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
new file mode 100644
index 000000000000..bcccb0d3f9ce
--- /dev/null
+++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
@@ -0,0 +1,284 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+#include <dt-bindings/input/linux-event-codes.h>
+#include "sun8i-v3s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+/ {
+ model = "Anbernic RG Nano";
+ compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s";
+
+ aliases {
+ serial0 = &uart0;
+ };
+
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>;
+ default-brightness-level = <11>;
+ power-supply = <®_vcc5v0>;
+ pwms = <&pwm 0 40000 1>;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ gpio_keys: gpio-keys {
+ compatible = "gpio-keys";
+
+ button-a {
+ gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-A";
+ linux,code = <BTN_EAST>;
+ };
+
+ button-b {
+ gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-B";
+ linux,code = <BTN_SOUTH>;
+ };
+
+ button-down {
+ gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "DPAD-DOWN";
+ linux,code = <BTN_DPAD_DOWN>;
+ };
+
+ button-left {
+ gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "DPAD-LEFT";
+ linux,code = <BTN_DPAD_LEFT>;
+ };
+
+ button-right {
+ gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "DPAD-RIGHT";
+ linux,code = <BTN_DPAD_RIGHT>;
+ };
+
+ button-se {
+ gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-SELECT";
+ linux,code = <BTN_SELECT>;
+ };
+
+ button-st {
+ gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-START";
+ linux,code = <BTN_START>;
+ };
+
+ button-tl {
+ gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-L";
+ linux,code = <BTN_TL>;
+ };
+
+ button-tr {
+ gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-R";
+ linux,code = <BTN_TR>;
+ };
+
+ button-up {
+ gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "DPAD-UP";
+ linux,code = <BTN_DPAD_UP>;
+ };
+
+ button-x {
+ gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-X";
+ linux,code = <BTN_NORTH>;
+ };
+
+ button-y {
+ gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
+ label = "BTN-Y";
+ linux,code = <BTN_WEST>;
+ };
+ };
+};
+
+&ccu {
+ clocks = <&osc24M>, <&osc32k>;
+};
+
+&codec {
+ allwinner,audio-routing = "Speaker", "HP",
+ "MIC1", "Mic",
+ "Mic", "HBIAS";
+ allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PF6 */
+ status = "okay";
+};
+
+&ehci {
+ status = "okay";
+};
+
+&i2c0 {
+ status = "okay";
+
+ gpio_expander: gpio@20 {
+ compatible = "nxp,pcal6416";
+ reg = <0x20>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ #interrupt-cells = <2>;
+ interrupt-controller;
+ interrupt-parent = <&pio>;
+ interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */
+ vcc-supply = <®_vcc3v3>;
+ };
+
+ axp209: pmic@34 {
+ reg = <0x34>;
+ interrupt-parent = <&pio>;
+ interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5 */
+ };
+
+ pcf8563: rtc@51 {
+ compatible = "nxp,pcf8563";
+ reg = <0x51>;
+ };
+};
+
+#include "axp209.dtsi"
+
+&battery_power_supply {
+ status = "okay";
+};
+
+&mmc0 {
+ broken-cd;
+ bus-width = <4>;
+ disable-wp;
+ vmmc-supply = <®_vcc3v3>;
+ vqmmc-supply = <®_vcc3v3>;
+ status = "okay";
+};
+
+&ohci {
+ status = "okay";
+};
+
+&pio {
+ clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
+ vcc-pb-supply = <®_vcc3v3>;
+ vcc-pc-supply = <®_vcc3v3>;
+ vcc-pf-supply = <®_vcc3v3>;
+ vcc-pg-supply = <®_vcc3v3>;
+
+ spi0_no_miso_pins: spi0-no-miso-pins {
+ pins = "PC1", "PC2", "PC3";
+ function = "spi0";
+ };
+};
+
+&pwm {
+ pinctrl-0 = <&pwm0_pin>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
+/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */
+®_dcdc2 {
+ regulator-always-on;
+ regulator-max-microvolt = <1250000>;
+ regulator-min-microvolt = <1250000>;
+ regulator-name = "vdd-cpu";
+};
+
+/* DCDC3 wired into every 3.3v input that isn't the RTC. */
+®_dcdc3 {
+ regulator-always-on;
+ regulator-max-microvolt = <3300000>;
+ regulator-min-microvolt = <3300000>;
+ regulator-name = "vcc-io";
+};
+
+/*
+ * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be
+ * software modified. Note that setting voltage here to 3.3v for accuracy
+ * sake causes an issue with the driver that causes it to fail to probe
+ * because of a voltage constraint in the driver.
+ */
+®_ldo1 {
+ regulator-always-on;
+ regulator-name = "vcc-rtc";
+};
+
+/* LDO2 wired into VCC-PLL and audio codec. */
+®_ldo2 {
+ regulator-always-on;
+ regulator-max-microvolt = <3000000>;
+ regulator-min-microvolt = <3000000>;
+ regulator-name = "vcc-pll";
+};
+
+/* LDO3, LDO4, and LDO5 unused. */
+®_ldo3 {
+ status = "disabled";
+};
+
+®_ldo4 {
+ status = "disabled";
+};
+
+/* External RTC used instead, internal RTC runs fast. */
+&rtc {
+ status = "disabled";
+};
+
+&spi0 {
+ pinctrl-0 = <&spi0_no_miso_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+
+ display@0 {
+ compatible = "saef,sftc154b", "panel-mipi-dbi-spi";
+ reg = <0>;
+ backlight = <&backlight>;
+ dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
+ reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
+ spi-max-frequency = <100000000>;
+
+ height-mm = <39>;
+ width-mm = <39>;
+
+ /* Set hb-porch to compensate for non-visible area */
+ panel-timing {
+ hactive = <240>;
+ vactive = <240>;
+ hback-porch = <80>;
+ vback-porch = <0>;
+ clock-frequency = <0>;
+ hfront-porch = <0>;
+ hsync-len = <0>;
+ vfront-porch = <0>;
+ vsync-len = <0>;
+ };
+ };
+};
+
+&uart0 {
+ pinctrl-0 = <&uart0_pb_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
+&usb_otg {
+ dr_mode = "otg";
+ status = "okay";
+};
+
+&usb_power_supply {
+ status = "okay";
+};
+
+&usbphy {
+ usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG5 */
+ status = "okay";
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 24+ messages in thread
* Re: [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-08-28 18:19 ` [PATCH V4 8/8] ARM: dts: sunxi: add support for " Chris Morgan
@ 2023-09-05 20:32 ` Jernej Škrabec
2023-09-07 15:39 ` Chris Morgan
2023-09-09 20:42 ` Samuel Holland
2023-09-11 0:05 ` Andre Przywara
2 siblings, 1 reply; 24+ messages in thread
From: Jernej Škrabec @ 2023-09-05 20:32 UTC (permalink / raw)
To: linux-sunxi, Chris Morgan
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, krzysztof.kozlowski+dt, mripard, neil.armstrong, noralf,
robh+dt, sam, samuel, uwu, wens, Chris Morgan
On Monday, August 28, 2023 8:19:41 PM CEST Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Anbernic RG-Nano is a small portable game device based on the
> Allwinner V3s SoC. It has GPIO buttons on the face and side for
> input, a single mono speaker, a 240x240 SPI controlled display, a USB-C
> OTG port, an SD card slot for booting, and 64MB of RAM included in the
> SoC.
>
> Working/Tested:
> - SDMMC
> - UART (for debugging)
> - Buttons
> - Charging/battery/PMIC
> - Speaker
> - RTC
> - USB Host and Gadget*
> - Display (at 60hz)
>
> *There is an issue with the usb_phy where it forces the device to host
> mode. Until the phy driver is fixed this can be bypassed by either
> removing the phy references from the ohci and ehci nodes or by setting
> the usbphy on the ohci and ehci nodes to 1 (which is incorrect).
DT is HW description, so driver independent and above comment should be
removed from commit message.
Otherwise:
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
> arch/arm/boot/dts/allwinner/Makefile | 1 +
> .../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++
> 2 files changed, 285 insertions(+)
> create mode 100644
> arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
>
> diff --git a/arch/arm/boot/dts/allwinner/Makefile
> b/arch/arm/boot/dts/allwinner/Makefile index 589a1ce1120a..2be83a1edcbb
> 100644
> --- a/arch/arm/boot/dts/allwinner/Makefile
> +++ b/arch/arm/boot/dts/allwinner/Makefile
> @@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
> sun8i-t113s-mangopi-mq-r-t113.dtb \
> sun8i-t3-cqa3t-bv3.dtb \
> sun8i-v3-sl631-imx179.dtb \
> + sun8i-v3s-anbernic-rg-nano.dtb \
> sun8i-v3s-licheepi-zero.dtb \
> sun8i-v3s-licheepi-zero-dock.dtb \
> sun8i-v40-bananapi-m2-berry.dtb
> diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts new file mode
> 100644
> index 000000000000..bcccb0d3f9ce
> --- /dev/null
> +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> @@ -0,0 +1,284 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +
> +/dts-v1/;
> +#include <dt-bindings/input/linux-event-codes.h>
> +#include "sun8i-v3s.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +/ {
> + model = "Anbernic RG Nano";
> + compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s";
> +
> + aliases {
> + serial0 = &uart0;
> + };
> +
> + backlight: backlight {
> + compatible = "pwm-backlight";
> + brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>;
> + default-brightness-level = <11>;
> + power-supply = <®_vcc5v0>;
> + pwms = <&pwm 0 40000 1>;
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + gpio_keys: gpio-keys {
> + compatible = "gpio-keys";
> +
> + button-a {
> + gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-A";
> + linux,code = <BTN_EAST>;
> + };
> +
> + button-b {
> + gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-B";
> + linux,code = <BTN_SOUTH>;
> + };
> +
> + button-down {
> + gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "DPAD-DOWN";
> + linux,code = <BTN_DPAD_DOWN>;
> + };
> +
> + button-left {
> + gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "DPAD-LEFT";
> + linux,code = <BTN_DPAD_LEFT>;
> + };
> +
> + button-right {
> + gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "DPAD-RIGHT";
> + linux,code = <BTN_DPAD_RIGHT>;
> + };
> +
> + button-se {
> + gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-SELECT";
> + linux,code = <BTN_SELECT>;
> + };
> +
> + button-st {
> + gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-START";
> + linux,code = <BTN_START>;
> + };
> +
> + button-tl {
> + gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-L";
> + linux,code = <BTN_TL>;
> + };
> +
> + button-tr {
> + gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-R";
> + linux,code = <BTN_TR>;
> + };
> +
> + button-up {
> + gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "DPAD-UP";
> + linux,code = <BTN_DPAD_UP>;
> + };
> +
> + button-x {
> + gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-X";
> + linux,code = <BTN_NORTH>;
> + };
> +
> + button-y {
> + gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW |
GPIO_PULL_UP)>;
> + label = "BTN-Y";
> + linux,code = <BTN_WEST>;
> + };
> + };
> +};
> +
> +&ccu {
> + clocks = <&osc24M>, <&osc32k>;
> +};
> +
> +&codec {
> + allwinner,audio-routing = "Speaker", "HP",
> + "MIC1", "Mic",
> + "Mic", "HBIAS";
> + allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
/* PF6
> */ + status = "okay";
> +};
> +
> +&ehci {
> + status = "okay";
> +};
> +
> +&i2c0 {
> + status = "okay";
> +
> + gpio_expander: gpio@20 {
> + compatible = "nxp,pcal6416";
> + reg = <0x20>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + #interrupt-cells = <2>;
> + interrupt-controller;
> + interrupt-parent = <&pio>;
> + interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */
> + vcc-supply = <®_vcc3v3>;
> + };
> +
> + axp209: pmic@34 {
> + reg = <0x34>;
> + interrupt-parent = <&pio>;
> + interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5
*/
> + };
> +
> + pcf8563: rtc@51 {
> + compatible = "nxp,pcf8563";
> + reg = <0x51>;
> + };
> +};
> +
> +#include "axp209.dtsi"
> +
> +&battery_power_supply {
> + status = "okay";
> +};
> +
> +&mmc0 {
> + broken-cd;
> + bus-width = <4>;
> + disable-wp;
> + vmmc-supply = <®_vcc3v3>;
> + vqmmc-supply = <®_vcc3v3>;
> + status = "okay";
> +};
> +
> +&ohci {
> + status = "okay";
> +};
> +
> +&pio {
> + clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
> + vcc-pb-supply = <®_vcc3v3>;
> + vcc-pc-supply = <®_vcc3v3>;
> + vcc-pf-supply = <®_vcc3v3>;
> + vcc-pg-supply = <®_vcc3v3>;
> +
> + spi0_no_miso_pins: spi0-no-miso-pins {
> + pins = "PC1", "PC2", "PC3";
> + function = "spi0";
> + };
> +};
> +
> +&pwm {
> + pinctrl-0 = <&pwm0_pin>;
> + pinctrl-names = "default";
> + status = "okay";
> +};
> +
> +/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */
> +®_dcdc2 {
> + regulator-always-on;
> + regulator-max-microvolt = <1250000>;
> + regulator-min-microvolt = <1250000>;
> + regulator-name = "vdd-cpu";
> +};
> +
> +/* DCDC3 wired into every 3.3v input that isn't the RTC. */
> +®_dcdc3 {
> + regulator-always-on;
> + regulator-max-microvolt = <3300000>;
> + regulator-min-microvolt = <3300000>;
> + regulator-name = "vcc-io";
> +};
> +
> +/*
> + * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be
> + * software modified. Note that setting voltage here to 3.3v for accuracy
> + * sake causes an issue with the driver that causes it to fail to probe
> + * because of a voltage constraint in the driver.
> + */
> +®_ldo1 {
> + regulator-always-on;
> + regulator-name = "vcc-rtc";
> +};
> +
> +/* LDO2 wired into VCC-PLL and audio codec. */
> +®_ldo2 {
> + regulator-always-on;
> + regulator-max-microvolt = <3000000>;
> + regulator-min-microvolt = <3000000>;
> + regulator-name = "vcc-pll";
> +};
> +
> +/* LDO3, LDO4, and LDO5 unused. */
> +®_ldo3 {
> + status = "disabled";
> +};
> +
> +®_ldo4 {
> + status = "disabled";
> +};
> +
> +/* External RTC used instead, internal RTC runs fast. */
> +&rtc {
> + status = "disabled";
> +};
> +
> +&spi0 {
> + pinctrl-0 = <&spi0_no_miso_pins>;
> + pinctrl-names = "default";
> + status = "okay";
> +
> + display@0 {
> + compatible = "saef,sftc154b", "panel-mipi-dbi-spi";
> + reg = <0>;
> + backlight = <&backlight>;
> + dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
> + reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
> + spi-max-frequency = <100000000>;
> +
> + height-mm = <39>;
> + width-mm = <39>;
> +
> + /* Set hb-porch to compensate for non-visible area */
> + panel-timing {
> + hactive = <240>;
> + vactive = <240>;
> + hback-porch = <80>;
> + vback-porch = <0>;
> + clock-frequency = <0>;
> + hfront-porch = <0>;
> + hsync-len = <0>;
> + vfront-porch = <0>;
> + vsync-len = <0>;
> + };
> + };
> +};
> +
> +&uart0 {
> + pinctrl-0 = <&uart0_pb_pins>;
> + pinctrl-names = "default";
> + status = "okay";
> +};
> +
> +&usb_otg {
> + dr_mode = "otg";
> + status = "okay";
> +};
> +
> +&usb_power_supply {
> + status = "okay";
> +};
> +
> +&usbphy {
> + usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /*
PG5 */
> + status = "okay";
> +};
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-09-05 20:32 ` Jernej Škrabec
@ 2023-09-07 15:39 ` Chris Morgan
2023-09-07 15:48 ` Jernej Škrabec
0 siblings, 1 reply; 24+ messages in thread
From: Chris Morgan @ 2023-09-07 15:39 UTC (permalink / raw)
To: Jernej Škrabec
Cc: linux-sunxi, devicetree, airlied, andre.przywara, conor+dt,
daniel, heiko, jagan, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan
On Tue, Sep 05, 2023 at 10:32:33PM +0200, Jernej Škrabec wrote:
> On Monday, August 28, 2023 8:19:41 PM CEST Chris Morgan wrote:
> > From: Chris Morgan <macromorgan@hotmail.com>
> >
> > The Anbernic RG-Nano is a small portable game device based on the
> > Allwinner V3s SoC. It has GPIO buttons on the face and side for
> > input, a single mono speaker, a 240x240 SPI controlled display, a USB-C
> > OTG port, an SD card slot for booting, and 64MB of RAM included in the
> > SoC.
> >
> > Working/Tested:
> > - SDMMC
> > - UART (for debugging)
> > - Buttons
> > - Charging/battery/PMIC
> > - Speaker
> > - RTC
> > - USB Host and Gadget*
> > - Display (at 60hz)
> >
> > *There is an issue with the usb_phy where it forces the device to host
> > mode. Until the phy driver is fixed this can be bypassed by either
> > removing the phy references from the ohci and ehci nodes or by setting
> > the usbphy on the ohci and ehci nodes to 1 (which is incorrect).
>
> DT is HW description, so driver independent and above comment should be
> removed from commit message.
>
> Otherwise:
> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>
> Best regards,
> Jernej
Should I resubmit with the text removed, or can it be edited before
being sent upstream?
Thank you.
>
> >
> > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> > ---
> > arch/arm/boot/dts/allwinner/Makefile | 1 +
> > .../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++
> > 2 files changed, 285 insertions(+)
> > create mode 100644
> > arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> >
> > diff --git a/arch/arm/boot/dts/allwinner/Makefile
> > b/arch/arm/boot/dts/allwinner/Makefile index 589a1ce1120a..2be83a1edcbb
> > 100644
> > --- a/arch/arm/boot/dts/allwinner/Makefile
> > +++ b/arch/arm/boot/dts/allwinner/Makefile
> > @@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
> > sun8i-t113s-mangopi-mq-r-t113.dtb \
> > sun8i-t3-cqa3t-bv3.dtb \
> > sun8i-v3-sl631-imx179.dtb \
> > + sun8i-v3s-anbernic-rg-nano.dtb \
> > sun8i-v3s-licheepi-zero.dtb \
> > sun8i-v3s-licheepi-zero-dock.dtb \
> > sun8i-v40-bananapi-m2-berry.dtb
> > diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> > b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts new file mode
> > 100644
> > index 000000000000..bcccb0d3f9ce
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> > @@ -0,0 +1,284 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +
> > +/dts-v1/;
> > +#include <dt-bindings/input/linux-event-codes.h>
> > +#include "sun8i-v3s.dtsi"
> > +#include "sunxi-common-regulators.dtsi"
> > +
> > +/ {
> > + model = "Anbernic RG Nano";
> > + compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s";
> > +
> > + aliases {
> > + serial0 = &uart0;
> > + };
> > +
> > + backlight: backlight {
> > + compatible = "pwm-backlight";
> > + brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>;
> > + default-brightness-level = <11>;
> > + power-supply = <®_vcc5v0>;
> > + pwms = <&pwm 0 40000 1>;
> > + };
> > +
> > + chosen {
> > + stdout-path = "serial0:115200n8";
> > + };
> > +
> > + gpio_keys: gpio-keys {
> > + compatible = "gpio-keys";
> > +
> > + button-a {
> > + gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-A";
> > + linux,code = <BTN_EAST>;
> > + };
> > +
> > + button-b {
> > + gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-B";
> > + linux,code = <BTN_SOUTH>;
> > + };
> > +
> > + button-down {
> > + gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "DPAD-DOWN";
> > + linux,code = <BTN_DPAD_DOWN>;
> > + };
> > +
> > + button-left {
> > + gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "DPAD-LEFT";
> > + linux,code = <BTN_DPAD_LEFT>;
> > + };
> > +
> > + button-right {
> > + gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "DPAD-RIGHT";
> > + linux,code = <BTN_DPAD_RIGHT>;
> > + };
> > +
> > + button-se {
> > + gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-SELECT";
> > + linux,code = <BTN_SELECT>;
> > + };
> > +
> > + button-st {
> > + gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-START";
> > + linux,code = <BTN_START>;
> > + };
> > +
> > + button-tl {
> > + gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-L";
> > + linux,code = <BTN_TL>;
> > + };
> > +
> > + button-tr {
> > + gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-R";
> > + linux,code = <BTN_TR>;
> > + };
> > +
> > + button-up {
> > + gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "DPAD-UP";
> > + linux,code = <BTN_DPAD_UP>;
> > + };
> > +
> > + button-x {
> > + gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-X";
> > + linux,code = <BTN_NORTH>;
> > + };
> > +
> > + button-y {
> > + gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW |
> GPIO_PULL_UP)>;
> > + label = "BTN-Y";
> > + linux,code = <BTN_WEST>;
> > + };
> > + };
> > +};
> > +
> > +&ccu {
> > + clocks = <&osc24M>, <&osc32k>;
> > +};
> > +
> > +&codec {
> > + allwinner,audio-routing = "Speaker", "HP",
> > + "MIC1", "Mic",
> > + "Mic", "HBIAS";
> > + allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
> /* PF6
> > */ + status = "okay";
> > +};
> > +
> > +&ehci {
> > + status = "okay";
> > +};
> > +
> > +&i2c0 {
> > + status = "okay";
> > +
> > + gpio_expander: gpio@20 {
> > + compatible = "nxp,pcal6416";
> > + reg = <0x20>;
> > + gpio-controller;
> > + #gpio-cells = <2>;
> > + #interrupt-cells = <2>;
> > + interrupt-controller;
> > + interrupt-parent = <&pio>;
> > + interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */
> > + vcc-supply = <®_vcc3v3>;
> > + };
> > +
> > + axp209: pmic@34 {
> > + reg = <0x34>;
> > + interrupt-parent = <&pio>;
> > + interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5
> */
> > + };
> > +
> > + pcf8563: rtc@51 {
> > + compatible = "nxp,pcf8563";
> > + reg = <0x51>;
> > + };
> > +};
> > +
> > +#include "axp209.dtsi"
> > +
> > +&battery_power_supply {
> > + status = "okay";
> > +};
> > +
> > +&mmc0 {
> > + broken-cd;
> > + bus-width = <4>;
> > + disable-wp;
> > + vmmc-supply = <®_vcc3v3>;
> > + vqmmc-supply = <®_vcc3v3>;
> > + status = "okay";
> > +};
> > +
> > +&ohci {
> > + status = "okay";
> > +};
> > +
> > +&pio {
> > + clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
> > + vcc-pb-supply = <®_vcc3v3>;
> > + vcc-pc-supply = <®_vcc3v3>;
> > + vcc-pf-supply = <®_vcc3v3>;
> > + vcc-pg-supply = <®_vcc3v3>;
> > +
> > + spi0_no_miso_pins: spi0-no-miso-pins {
> > + pins = "PC1", "PC2", "PC3";
> > + function = "spi0";
> > + };
> > +};
> > +
> > +&pwm {
> > + pinctrl-0 = <&pwm0_pin>;
> > + pinctrl-names = "default";
> > + status = "okay";
> > +};
> > +
> > +/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */
> > +®_dcdc2 {
> > + regulator-always-on;
> > + regulator-max-microvolt = <1250000>;
> > + regulator-min-microvolt = <1250000>;
> > + regulator-name = "vdd-cpu";
> > +};
> > +
> > +/* DCDC3 wired into every 3.3v input that isn't the RTC. */
> > +®_dcdc3 {
> > + regulator-always-on;
> > + regulator-max-microvolt = <3300000>;
> > + regulator-min-microvolt = <3300000>;
> > + regulator-name = "vcc-io";
> > +};
> > +
> > +/*
> > + * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be
> > + * software modified. Note that setting voltage here to 3.3v for accuracy
> > + * sake causes an issue with the driver that causes it to fail to probe
> > + * because of a voltage constraint in the driver.
> > + */
> > +®_ldo1 {
> > + regulator-always-on;
> > + regulator-name = "vcc-rtc";
> > +};
> > +
> > +/* LDO2 wired into VCC-PLL and audio codec. */
> > +®_ldo2 {
> > + regulator-always-on;
> > + regulator-max-microvolt = <3000000>;
> > + regulator-min-microvolt = <3000000>;
> > + regulator-name = "vcc-pll";
> > +};
> > +
> > +/* LDO3, LDO4, and LDO5 unused. */
> > +®_ldo3 {
> > + status = "disabled";
> > +};
> > +
> > +®_ldo4 {
> > + status = "disabled";
> > +};
> > +
> > +/* External RTC used instead, internal RTC runs fast. */
> > +&rtc {
> > + status = "disabled";
> > +};
> > +
> > +&spi0 {
> > + pinctrl-0 = <&spi0_no_miso_pins>;
> > + pinctrl-names = "default";
> > + status = "okay";
> > +
> > + display@0 {
> > + compatible = "saef,sftc154b", "panel-mipi-dbi-spi";
> > + reg = <0>;
> > + backlight = <&backlight>;
> > + dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
> > + reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
> > + spi-max-frequency = <100000000>;
> > +
> > + height-mm = <39>;
> > + width-mm = <39>;
> > +
> > + /* Set hb-porch to compensate for non-visible area */
> > + panel-timing {
> > + hactive = <240>;
> > + vactive = <240>;
> > + hback-porch = <80>;
> > + vback-porch = <0>;
> > + clock-frequency = <0>;
> > + hfront-porch = <0>;
> > + hsync-len = <0>;
> > + vfront-porch = <0>;
> > + vsync-len = <0>;
> > + };
> > + };
> > +};
> > +
> > +&uart0 {
> > + pinctrl-0 = <&uart0_pb_pins>;
> > + pinctrl-names = "default";
> > + status = "okay";
> > +};
> > +
> > +&usb_otg {
> > + dr_mode = "otg";
> > + status = "okay";
> > +};
> > +
> > +&usb_power_supply {
> > + status = "okay";
> > +};
> > +
> > +&usbphy {
> > + usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /*
> PG5 */
> > + status = "okay";
> > +};
>
>
>
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-09-07 15:39 ` Chris Morgan
@ 2023-09-07 15:48 ` Jernej Škrabec
0 siblings, 0 replies; 24+ messages in thread
From: Jernej Škrabec @ 2023-09-07 15:48 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-sunxi, devicetree, airlied, andre.przywara, conor+dt,
daniel, heiko, jagan, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, wens,
Chris Morgan
On Thursday, September 7, 2023 5:39:17 PM CEST Chris Morgan wrote:
> On Tue, Sep 05, 2023 at 10:32:33PM +0200, Jernej Škrabec wrote:
> > On Monday, August 28, 2023 8:19:41 PM CEST Chris Morgan wrote:
> > > From: Chris Morgan <macromorgan@hotmail.com>
> > >
> > > The Anbernic RG-Nano is a small portable game device based on the
> > > Allwinner V3s SoC. It has GPIO buttons on the face and side for
> > > input, a single mono speaker, a 240x240 SPI controlled display, a USB-C
> > > OTG port, an SD card slot for booting, and 64MB of RAM included in the
> > > SoC.
> > >
> > > Working/Tested:
> > > - SDMMC
> > > - UART (for debugging)
> > > - Buttons
> > > - Charging/battery/PMIC
> > > - Speaker
> > > - RTC
> > > - USB Host and Gadget*
> > > - Display (at 60hz)
> > >
> > > *There is an issue with the usb_phy where it forces the device to host
> > > mode. Until the phy driver is fixed this can be bypassed by either
> > > removing the phy references from the ohci and ehci nodes or by setting
> > > the usbphy on the ohci and ehci nodes to 1 (which is incorrect).
> >
> > DT is HW description, so driver independent and above comment should be
> > removed from commit message.
> >
> > Otherwise:
> > Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> >
> > Best regards,
> > Jernej
>
> Should I resubmit with the text removed, or can it be edited before
> being sent upstream?
It can be edited if nothing else pops up. In any case, it will be applied
after 6.6-rc1 is released.
Best regards,
Jernej
>
> Thank you.
>
> > > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> > > ---
> > >
> > > arch/arm/boot/dts/allwinner/Makefile | 1 +
> > > .../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++
> > > 2 files changed, 285 insertions(+)
> > > create mode 100644
> > >
> > > arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> > >
> > > diff --git a/arch/arm/boot/dts/allwinner/Makefile
> > > b/arch/arm/boot/dts/allwinner/Makefile index 589a1ce1120a..2be83a1edcbb
> > > 100644
> > > --- a/arch/arm/boot/dts/allwinner/Makefile
> > > +++ b/arch/arm/boot/dts/allwinner/Makefile
> > > @@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
> > >
> > > sun8i-t113s-mangopi-mq-r-t113.dtb \
> > > sun8i-t3-cqa3t-bv3.dtb \
> > > sun8i-v3-sl631-imx179.dtb \
> > >
> > > + sun8i-v3s-anbernic-rg-nano.dtb \
> > >
> > > sun8i-v3s-licheepi-zero.dtb \
> > > sun8i-v3s-licheepi-zero-dock.dtb \
> > > sun8i-v40-bananapi-m2-berry.dtb
> > >
> > > diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> > > b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts new file
> > > mode
> > > 100644
> > > index 000000000000..bcccb0d3f9ce
> > > --- /dev/null
> > > +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> > > @@ -0,0 +1,284 @@
> > > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > > +
> > > +/dts-v1/;
> > > +#include <dt-bindings/input/linux-event-codes.h>
> > > +#include "sun8i-v3s.dtsi"
> > > +#include "sunxi-common-regulators.dtsi"
> > > +
> > > +/ {
> > > + model = "Anbernic RG Nano";
> > > + compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s";
> > > +
> > > + aliases {
> > > + serial0 = &uart0;
> > > + };
> > > +
> > > + backlight: backlight {
> > > + compatible = "pwm-backlight";
> > > + brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>;
> > > + default-brightness-level = <11>;
> > > + power-supply = <®_vcc5v0>;
> > > + pwms = <&pwm 0 40000 1>;
> > > + };
> > > +
> > > + chosen {
> > > + stdout-path = "serial0:115200n8";
> > > + };
> > > +
> > > + gpio_keys: gpio-keys {
> > > + compatible = "gpio-keys";
> > > +
> > > + button-a {
> > > + gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW
|
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-A";
> > > + linux,code = <BTN_EAST>;
> > > + };
> > > +
> > > + button-b {
> > > + gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW
|
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-B";
> > > + linux,code = <BTN_SOUTH>;
> > > + };
> > > +
> > > + button-down {
> > > + gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW |
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "DPAD-DOWN";
> > > + linux,code = <BTN_DPAD_DOWN>;
> > > + };
> > > +
> > > + button-left {
> > > + gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW |
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "DPAD-LEFT";
> > > + linux,code = <BTN_DPAD_LEFT>;
> > > + };
> > > +
> > > + button-right {
> > > + gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW |
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "DPAD-RIGHT";
> > > + linux,code = <BTN_DPAD_RIGHT>;
> > > + };
> > > +
> > > + button-se {
> > > + gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW |
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-SELECT";
> > > + linux,code = <BTN_SELECT>;
> > > + };
> > > +
> > > + button-st {
> > > + gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW |
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-START";
> > > + linux,code = <BTN_START>;
> > > + };
> > > +
> > > + button-tl {
> > > + gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW |
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-L";
> > > + linux,code = <BTN_TL>;
> > > + };
> > > +
> > > + button-tr {
> > > + gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW
|
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-R";
> > > + linux,code = <BTN_TR>;
> > > + };
> > > +
> > > + button-up {
> > > + gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW |
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "DPAD-UP";
> > > + linux,code = <BTN_DPAD_UP>;
> > > + };
> > > +
> > > + button-x {
> > > + gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW
|
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-X";
> > > + linux,code = <BTN_NORTH>;
> > > + };
> > > +
> > > + button-y {
> > > + gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW
|
> >
> > GPIO_PULL_UP)>;
> >
> > > + label = "BTN-Y";
> > > + linux,code = <BTN_WEST>;
> > > + };
> > > + };
> > > +};
> > > +
> > > +&ccu {
> > > + clocks = <&osc24M>, <&osc32k>;
> > > +};
> > > +
> > > +&codec {
> > > + allwinner,audio-routing = "Speaker", "HP",
> > > + "MIC1", "Mic",
> > > + "Mic", "HBIAS";
> > > + allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
> >
> > /* PF6
> >
> > > */ + status = "okay";
> > > +};
> > > +
> > > +&ehci {
> > > + status = "okay";
> > > +};
> > > +
> > > +&i2c0 {
> > > + status = "okay";
> > > +
> > > + gpio_expander: gpio@20 {
> > > + compatible = "nxp,pcal6416";
> > > + reg = <0x20>;
> > > + gpio-controller;
> > > + #gpio-cells = <2>;
> > > + #interrupt-cells = <2>;
> > > + interrupt-controller;
> > > + interrupt-parent = <&pio>;
> > > + interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */
> > > + vcc-supply = <®_vcc3v3>;
> > > + };
> > > +
> > > + axp209: pmic@34 {
> > > + reg = <0x34>;
> > > + interrupt-parent = <&pio>;
> > > + interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5
> >
> > */
> >
> > > + };
> > > +
> > > + pcf8563: rtc@51 {
> > > + compatible = "nxp,pcf8563";
> > > + reg = <0x51>;
> > > + };
> > > +};
> > > +
> > > +#include "axp209.dtsi"
> > > +
> > > +&battery_power_supply {
> > > + status = "okay";
> > > +};
> > > +
> > > +&mmc0 {
> > > + broken-cd;
> > > + bus-width = <4>;
> > > + disable-wp;
> > > + vmmc-supply = <®_vcc3v3>;
> > > + vqmmc-supply = <®_vcc3v3>;
> > > + status = "okay";
> > > +};
> > > +
> > > +&ohci {
> > > + status = "okay";
> > > +};
> > > +
> > > +&pio {
> > > + clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
> > > + vcc-pb-supply = <®_vcc3v3>;
> > > + vcc-pc-supply = <®_vcc3v3>;
> > > + vcc-pf-supply = <®_vcc3v3>;
> > > + vcc-pg-supply = <®_vcc3v3>;
> > > +
> > > + spi0_no_miso_pins: spi0-no-miso-pins {
> > > + pins = "PC1", "PC2", "PC3";
> > > + function = "spi0";
> > > + };
> > > +};
> > > +
> > > +&pwm {
> > > + pinctrl-0 = <&pwm0_pin>;
> > > + pinctrl-names = "default";
> > > + status = "okay";
> > > +};
> > > +
> > > +/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */
> > > +®_dcdc2 {
> > > + regulator-always-on;
> > > + regulator-max-microvolt = <1250000>;
> > > + regulator-min-microvolt = <1250000>;
> > > + regulator-name = "vdd-cpu";
> > > +};
> > > +
> > > +/* DCDC3 wired into every 3.3v input that isn't the RTC. */
> > > +®_dcdc3 {
> > > + regulator-always-on;
> > > + regulator-max-microvolt = <3300000>;
> > > + regulator-min-microvolt = <3300000>;
> > > + regulator-name = "vcc-io";
> > > +};
> > > +
> > > +/*
> > > + * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be
> > > + * software modified. Note that setting voltage here to 3.3v for
> > > accuracy
> > > + * sake causes an issue with the driver that causes it to fail to probe
> > > + * because of a voltage constraint in the driver.
> > > + */
> > > +®_ldo1 {
> > > + regulator-always-on;
> > > + regulator-name = "vcc-rtc";
> > > +};
> > > +
> > > +/* LDO2 wired into VCC-PLL and audio codec. */
> > > +®_ldo2 {
> > > + regulator-always-on;
> > > + regulator-max-microvolt = <3000000>;
> > > + regulator-min-microvolt = <3000000>;
> > > + regulator-name = "vcc-pll";
> > > +};
> > > +
> > > +/* LDO3, LDO4, and LDO5 unused. */
> > > +®_ldo3 {
> > > + status = "disabled";
> > > +};
> > > +
> > > +®_ldo4 {
> > > + status = "disabled";
> > > +};
> > > +
> > > +/* External RTC used instead, internal RTC runs fast. */
> > > +&rtc {
> > > + status = "disabled";
> > > +};
> > > +
> > > +&spi0 {
> > > + pinctrl-0 = <&spi0_no_miso_pins>;
> > > + pinctrl-names = "default";
> > > + status = "okay";
> > > +
> > > + display@0 {
> > > + compatible = "saef,sftc154b", "panel-mipi-dbi-spi";
> > > + reg = <0>;
> > > + backlight = <&backlight>;
> > > + dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
> > > + reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
> > > + spi-max-frequency = <100000000>;
> > > +
> > > + height-mm = <39>;
> > > + width-mm = <39>;
> > > +
> > > + /* Set hb-porch to compensate for non-visible area */
> > > + panel-timing {
> > > + hactive = <240>;
> > > + vactive = <240>;
> > > + hback-porch = <80>;
> > > + vback-porch = <0>;
> > > + clock-frequency = <0>;
> > > + hfront-porch = <0>;
> > > + hsync-len = <0>;
> > > + vfront-porch = <0>;
> > > + vsync-len = <0>;
> > > + };
> > > + };
> > > +};
> > > +
> > > +&uart0 {
> > > + pinctrl-0 = <&uart0_pb_pins>;
> > > + pinctrl-names = "default";
> > > + status = "okay";
> > > +};
> > > +
> > > +&usb_otg {
> > > + dr_mode = "otg";
> > > + status = "okay";
> > > +};
> > > +
> > > +&usb_power_supply {
> > > + status = "okay";
> > > +};
> > > +
> > > +&usbphy {
> > > + usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /
*
> >
> > PG5 */
> >
> > > + status = "okay";
> > > +};
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-08-28 18:19 ` [PATCH V4 8/8] ARM: dts: sunxi: add support for " Chris Morgan
2023-09-05 20:32 ` Jernej Škrabec
@ 2023-09-09 20:42 ` Samuel Holland
2023-09-11 0:05 ` Andre Przywara
2 siblings, 0 replies; 24+ messages in thread
From: Samuel Holland @ 2023-09-09 20:42 UTC (permalink / raw)
To: Chris Morgan, linux-sunxi, jernej.skrabec
Cc: devicetree, airlied, andre.przywara, conor+dt, daniel, heiko,
jagan, krzysztof.kozlowski+dt, mripard, neil.armstrong, noralf,
robh+dt, sam, uwu, wens, Chris Morgan
On 8/28/23 13:19, Chris Morgan wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Anbernic RG-Nano is a small portable game device based on the
> Allwinner V3s SoC. It has GPIO buttons on the face and side for
> input, a single mono speaker, a 240x240 SPI controlled display, a USB-C
> OTG port, an SD card slot for booting, and 64MB of RAM included in the
> SoC.
>
> Working/Tested:
> - SDMMC
> - UART (for debugging)
> - Buttons
> - Charging/battery/PMIC
> - Speaker
> - RTC
> - USB Host and Gadget*
> - Display (at 60hz)
>
> *There is an issue with the usb_phy where it forces the device to host
> mode. Until the phy driver is fixed this can be bypassed by either
> removing the phy references from the ohci and ehci nodes or by setting
> the usbphy on the ohci and ehci nodes to 1 (which is incorrect).
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
> arch/arm/boot/dts/allwinner/Makefile | 1 +
> .../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++
> 2 files changed, 285 insertions(+)
> create mode 100644 arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
>
> diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile
> index 589a1ce1120a..2be83a1edcbb 100644
> --- a/arch/arm/boot/dts/allwinner/Makefile
> +++ b/arch/arm/boot/dts/allwinner/Makefile
> @@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
> sun8i-t113s-mangopi-mq-r-t113.dtb \
> sun8i-t3-cqa3t-bv3.dtb \
> sun8i-v3-sl631-imx179.dtb \
> + sun8i-v3s-anbernic-rg-nano.dtb \
> sun8i-v3s-licheepi-zero.dtb \
> sun8i-v3s-licheepi-zero-dock.dtb \
> sun8i-v40-bananapi-m2-berry.dtb
> diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> new file mode 100644
> index 000000000000..bcccb0d3f9ce
> --- /dev/null
> +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> @@ -0,0 +1,284 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +
> +/dts-v1/;
> +#include <dt-bindings/input/linux-event-codes.h>
> +#include "sun8i-v3s.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +/ {
> + model = "Anbernic RG Nano";
> + compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s";
> +
> + aliases {
> + serial0 = &uart0;
> + };
> +
> + backlight: backlight {
> + compatible = "pwm-backlight";
> + brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>;
> + default-brightness-level = <11>;
> + power-supply = <®_vcc5v0>;
> + pwms = <&pwm 0 40000 1>;
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + gpio_keys: gpio-keys {
> + compatible = "gpio-keys";
> +
> + button-a {
> + gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-A";
> + linux,code = <BTN_EAST>;
> + };
> +
> + button-b {
> + gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-B";
> + linux,code = <BTN_SOUTH>;
> + };
> +
> + button-down {
> + gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-DOWN";
> + linux,code = <BTN_DPAD_DOWN>;
> + };
> +
> + button-left {
> + gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-LEFT";
> + linux,code = <BTN_DPAD_LEFT>;
> + };
> +
> + button-right {
> + gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-RIGHT";
> + linux,code = <BTN_DPAD_RIGHT>;
> + };
> +
> + button-se {
> + gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-SELECT";
> + linux,code = <BTN_SELECT>;
> + };
> +
> + button-st {
> + gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-START";
> + linux,code = <BTN_START>;
> + };
> +
> + button-tl {
> + gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-L";
> + linux,code = <BTN_TL>;
> + };
> +
> + button-tr {
> + gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-R";
> + linux,code = <BTN_TR>;
> + };
> +
> + button-up {
> + gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-UP";
> + linux,code = <BTN_DPAD_UP>;
> + };
> +
> + button-x {
> + gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-X";
> + linux,code = <BTN_NORTH>;
> + };
> +
> + button-y {
> + gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-Y";
> + linux,code = <BTN_WEST>;
> + };
> + };
> +};
> +
> +&ccu {
> + clocks = <&osc24M>, <&osc32k>;
> +};
This is not accurate. The CCU's 32 kHz clock comes from the internal
RTC, whether you lie to the kernel about it or not. :)
If the external 32 kHz crystal represented by &osc32k really exists,
then I would expect the internal RTC to be accurate. At least the Linux
driver tries to switch to the external crystal.
If it's not using the external crystal... well, the V3s manual says
"Note: Internal 32kHz is divided from OSC24MHz". And there's no integer
factor of 24 MHz that gets you 32768 Hz, so that would explain the poor
accuracy. Even in that case, if you can't use the RTC as an RTC, it
should still be enabled in the DT, so the rest of the system can know
the actual OSC32K/LOSC clock frequency. Userspace should be able to deal
with the system having more than one RTC.
> +
> +&codec {
> + allwinner,audio-routing = "Speaker", "HP",
> + "MIC1", "Mic",
> + "Mic", "HBIAS";
> + allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PF6 */
> + status = "okay";
> +};
> +
> +&ehci {
> + status = "okay";
> +};
> +
> +&i2c0 {
> + status = "okay";
> +
> + gpio_expander: gpio@20 {
> + compatible = "nxp,pcal6416";
> + reg = <0x20>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + #interrupt-cells = <2>;
> + interrupt-controller;
> + interrupt-parent = <&pio>;
> + interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */
> + vcc-supply = <®_vcc3v3>;
> + };
> +
> + axp209: pmic@34 {
> + reg = <0x34>;
> + interrupt-parent = <&pio>;
> + interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5 */
> + };
> +
> + pcf8563: rtc@51 {
> + compatible = "nxp,pcf8563";
> + reg = <0x51>;
> + };
> +};
> +
> +#include "axp209.dtsi"
> +
> +&battery_power_supply {
> + status = "okay";
> +};
> +
> +&mmc0 {
> + broken-cd;
> + bus-width = <4>;
> + disable-wp;
> + vmmc-supply = <®_vcc3v3>;
> + vqmmc-supply = <®_vcc3v3>;
> + status = "okay";
> +};
> +
> +&ohci {
> + status = "okay";
> +};
> +
> +&pio {
> + clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
The same concern applies here.
Regards,
Samuel
> + vcc-pb-supply = <®_vcc3v3>;
> + vcc-pc-supply = <®_vcc3v3>;
> + vcc-pf-supply = <®_vcc3v3>;
> + vcc-pg-supply = <®_vcc3v3>;
> +
> + spi0_no_miso_pins: spi0-no-miso-pins {
> + pins = "PC1", "PC2", "PC3";
> + function = "spi0";
> + };
> +};
> +
> +&pwm {
> + pinctrl-0 = <&pwm0_pin>;
> + pinctrl-names = "default";
> + status = "okay";
> +};
> +
> +/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */
> +®_dcdc2 {
> + regulator-always-on;
> + regulator-max-microvolt = <1250000>;
> + regulator-min-microvolt = <1250000>;
> + regulator-name = "vdd-cpu";
> +};
> +
> +/* DCDC3 wired into every 3.3v input that isn't the RTC. */
> +®_dcdc3 {
> + regulator-always-on;
> + regulator-max-microvolt = <3300000>;
> + regulator-min-microvolt = <3300000>;
> + regulator-name = "vcc-io";
> +};
> +
> +/*
> + * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be
> + * software modified. Note that setting voltage here to 3.3v for accuracy
> + * sake causes an issue with the driver that causes it to fail to probe
> + * because of a voltage constraint in the driver.
> + */
> +®_ldo1 {
> + regulator-always-on;
> + regulator-name = "vcc-rtc";
> +};
> +
> +/* LDO2 wired into VCC-PLL and audio codec. */
> +®_ldo2 {
> + regulator-always-on;
> + regulator-max-microvolt = <3000000>;
> + regulator-min-microvolt = <3000000>;
> + regulator-name = "vcc-pll";
> +};
> +
> +/* LDO3, LDO4, and LDO5 unused. */
> +®_ldo3 {
> + status = "disabled";
> +};
> +
> +®_ldo4 {
> + status = "disabled";
> +};
> +
> +/* External RTC used instead, internal RTC runs fast. */
> +&rtc {
> + status = "disabled";
> +};
> +
> +&spi0 {
> + pinctrl-0 = <&spi0_no_miso_pins>;
> + pinctrl-names = "default";
> + status = "okay";
> +
> + display@0 {
> + compatible = "saef,sftc154b", "panel-mipi-dbi-spi";
> + reg = <0>;
> + backlight = <&backlight>;
> + dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
> + reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
> + spi-max-frequency = <100000000>;
> +
> + height-mm = <39>;
> + width-mm = <39>;
> +
> + /* Set hb-porch to compensate for non-visible area */
> + panel-timing {
> + hactive = <240>;
> + vactive = <240>;
> + hback-porch = <80>;
> + vback-porch = <0>;
> + clock-frequency = <0>;
> + hfront-porch = <0>;
> + hsync-len = <0>;
> + vfront-porch = <0>;
> + vsync-len = <0>;
> + };
> + };
> +};
> +
> +&uart0 {
> + pinctrl-0 = <&uart0_pb_pins>;
> + pinctrl-names = "default";
> + status = "okay";
> +};
> +
> +&usb_otg {
> + dr_mode = "otg";
> + status = "okay";
> +};
> +
> +&usb_power_supply {
> + status = "okay";
> +};
> +
> +&usbphy {
> + usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG5 */
> + status = "okay";
> +};
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-08-28 18:19 ` [PATCH V4 8/8] ARM: dts: sunxi: add support for " Chris Morgan
2023-09-05 20:32 ` Jernej Škrabec
2023-09-09 20:42 ` Samuel Holland
@ 2023-09-11 0:05 ` Andre Przywara
2023-09-11 13:35 ` Chen-Yu Tsai
2 siblings, 1 reply; 24+ messages in thread
From: Andre Przywara @ 2023-09-11 0:05 UTC (permalink / raw)
To: Chris Morgan
Cc: linux-sunxi, devicetree, airlied, conor+dt, daniel, heiko, jagan,
jernej.skrabec, krzysztof.kozlowski+dt, mripard, neil.armstrong,
noralf, robh+dt, sam, samuel, uwu, wens, Chris Morgan
On Mon, 28 Aug 2023 13:19:41 -0500
Chris Morgan <macroalpha82@gmail.com> wrote:
Hi Chris,
thanks for the changes. As Samuel already pointed out, there is now a
problem with the RTC...
> From: Chris Morgan <macromorgan@hotmail.com>
>
> The Anbernic RG-Nano is a small portable game device based on the
> Allwinner V3s SoC. It has GPIO buttons on the face and side for
> input, a single mono speaker, a 240x240 SPI controlled display, a USB-C
> OTG port, an SD card slot for booting, and 64MB of RAM included in the
> SoC.
>
> Working/Tested:
> - SDMMC
> - UART (for debugging)
> - Buttons
> - Charging/battery/PMIC
> - Speaker
> - RTC
> - USB Host and Gadget*
> - Display (at 60hz)
>
> *There is an issue with the usb_phy where it forces the device to host
> mode. Until the phy driver is fixed this can be bypassed by either
> removing the phy references from the ohci and ehci nodes or by setting
> the usbphy on the ohci and ehci nodes to 1 (which is incorrect).
>
> Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> ---
> arch/arm/boot/dts/allwinner/Makefile | 1 +
> .../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++
> 2 files changed, 285 insertions(+)
> create mode 100644 arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
>
> diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile
> index 589a1ce1120a..2be83a1edcbb 100644
> --- a/arch/arm/boot/dts/allwinner/Makefile
> +++ b/arch/arm/boot/dts/allwinner/Makefile
> @@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
> sun8i-t113s-mangopi-mq-r-t113.dtb \
> sun8i-t3-cqa3t-bv3.dtb \
> sun8i-v3-sl631-imx179.dtb \
> + sun8i-v3s-anbernic-rg-nano.dtb \
> sun8i-v3s-licheepi-zero.dtb \
> sun8i-v3s-licheepi-zero-dock.dtb \
> sun8i-v40-bananapi-m2-berry.dtb
> diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> new file mode 100644
> index 000000000000..bcccb0d3f9ce
> --- /dev/null
> +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> @@ -0,0 +1,284 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +
> +/dts-v1/;
> +#include <dt-bindings/input/linux-event-codes.h>
> +#include "sun8i-v3s.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +/ {
> + model = "Anbernic RG Nano";
> + compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s";
> +
> + aliases {
> + serial0 = &uart0;
> + };
> +
> + backlight: backlight {
> + compatible = "pwm-backlight";
> + brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>;
> + default-brightness-level = <11>;
> + power-supply = <®_vcc5v0>;
> + pwms = <&pwm 0 40000 1>;
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + gpio_keys: gpio-keys {
> + compatible = "gpio-keys";
> +
> + button-a {
> + gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-A";
> + linux,code = <BTN_EAST>;
> + };
> +
> + button-b {
> + gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-B";
> + linux,code = <BTN_SOUTH>;
> + };
> +
> + button-down {
> + gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-DOWN";
> + linux,code = <BTN_DPAD_DOWN>;
> + };
> +
> + button-left {
> + gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-LEFT";
> + linux,code = <BTN_DPAD_LEFT>;
> + };
> +
> + button-right {
> + gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-RIGHT";
> + linux,code = <BTN_DPAD_RIGHT>;
> + };
> +
> + button-se {
> + gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-SELECT";
> + linux,code = <BTN_SELECT>;
> + };
> +
> + button-st {
> + gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-START";
> + linux,code = <BTN_START>;
> + };
> +
> + button-tl {
> + gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-L";
> + linux,code = <BTN_TL>;
> + };
> +
> + button-tr {
> + gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-R";
> + linux,code = <BTN_TR>;
> + };
> +
> + button-up {
> + gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "DPAD-UP";
> + linux,code = <BTN_DPAD_UP>;
> + };
> +
> + button-x {
> + gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-X";
> + linux,code = <BTN_NORTH>;
> + };
> +
> + button-y {
> + gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> + label = "BTN-Y";
> + linux,code = <BTN_WEST>;
> + };
> + };
> +};
> +
> +&ccu {
> + clocks = <&osc24M>, <&osc32k>;
Samuel already pointed that out: please don't change that.
> +};
> +
> +&codec {
> + allwinner,audio-routing = "Speaker", "HP",
> + "MIC1", "Mic",
> + "Mic", "HBIAS";
> + allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PF6 */
> + status = "okay";
> +};
> +
> +&ehci {
> + status = "okay";
> +};
> +
> +&i2c0 {
> + status = "okay";
> +
> + gpio_expander: gpio@20 {
> + compatible = "nxp,pcal6416";
> + reg = <0x20>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + #interrupt-cells = <2>;
> + interrupt-controller;
> + interrupt-parent = <&pio>;
> + interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */
> + vcc-supply = <®_vcc3v3>;
> + };
> +
> + axp209: pmic@34 {
> + reg = <0x34>;
> + interrupt-parent = <&pio>;
> + interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5 */
> + };
> +
> + pcf8563: rtc@51 {
> + compatible = "nxp,pcf8563";
> + reg = <0x51>;
> + };
> +};
> +
> +#include "axp209.dtsi"
> +
> +&battery_power_supply {
> + status = "okay";
> +};
> +
> +&mmc0 {
> + broken-cd;
> + bus-width = <4>;
> + disable-wp;
> + vmmc-supply = <®_vcc3v3>;
> + vqmmc-supply = <®_vcc3v3>;
> + status = "okay";
> +};
> +
> +&ohci {
> + status = "okay";
> +};
> +
> +&pio {
> + clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
> + vcc-pb-supply = <®_vcc3v3>;
> + vcc-pc-supply = <®_vcc3v3>;
> + vcc-pf-supply = <®_vcc3v3>;
> + vcc-pg-supply = <®_vcc3v3>;
> +
> + spi0_no_miso_pins: spi0-no-miso-pins {
> + pins = "PC1", "PC2", "PC3";
> + function = "spi0";
> + };
> +};
> +
> +&pwm {
> + pinctrl-0 = <&pwm0_pin>;
> + pinctrl-names = "default";
> + status = "okay";
> +};
> +
> +/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */
> +®_dcdc2 {
> + regulator-always-on;
> + regulator-max-microvolt = <1250000>;
> + regulator-min-microvolt = <1250000>;
> + regulator-name = "vdd-cpu";
> +};
> +
> +/* DCDC3 wired into every 3.3v input that isn't the RTC. */
> +®_dcdc3 {
> + regulator-always-on;
> + regulator-max-microvolt = <3300000>;
> + regulator-min-microvolt = <3300000>;
> + regulator-name = "vcc-io";
> +};
> +
> +/*
> + * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be
> + * software modified. Note that setting voltage here to 3.3v for accuracy
> + * sake causes an issue with the driver that causes it to fail to probe
> + * because of a voltage constraint in the driver.
> + */
> +®_ldo1 {
> + regulator-always-on;
> + regulator-name = "vcc-rtc";
> +};
> +
> +/* LDO2 wired into VCC-PLL and audio codec. */
> +®_ldo2 {
> + regulator-always-on;
> + regulator-max-microvolt = <3000000>;
> + regulator-min-microvolt = <3000000>;
> + regulator-name = "vcc-pll";
> +};
> +
> +/* LDO3, LDO4, and LDO5 unused. */
> +®_ldo3 {
> + status = "disabled";
> +};
> +
> +®_ldo4 {
> + status = "disabled";
> +};
> +
> +/* External RTC used instead, internal RTC runs fast. */
> +&rtc {
> + status = "disabled";
So as Samuel mentioned, I don't think you should disable the RTC, even
if you have another RTC which provides more accurate time reading.
On most Allwinner chips the RTC provides more than just the actual
timekeeping functionality, as it also provides various derived clocks.
So when you say the "internal RTC runs fast", that sounds like the
board does not actually connect an external 32K crystal to the
X32KIN/X32KOUT pins?
So what happens if you remove the clocks property from the RTC node?
If I read the code correctly, that should make the driver aware of the
lack of a crystal, which might improve things?
The manual seems to somewhat suggest that an external oscillator is
mandatory - and we modelled the sun8i-v3s.dtsi base after that. Though
I believe the RTC supports using the internal RC oscillator, and
omitting the "clocks" property should make the driver switch the RTC
over.
This is at least my naive and quick interpretation of the code. I am
not an Allwinner RTC expert though, so happy to hear Samuel's opinion.
Regarding multiple RTCs: I didn't find anything which assigns a
priority level to multiple RTCs in the system. What you can do on the
userland side is to have a udev rule that links the PCF device to
/dev/rtc, so that most tools would use that as a time source.
Cheers,
Andre
> +};
> +
> +&spi0 {
> + pinctrl-0 = <&spi0_no_miso_pins>;
> + pinctrl-names = "default";
> + status = "okay";
> +
> + display@0 {
> + compatible = "saef,sftc154b", "panel-mipi-dbi-spi";
> + reg = <0>;
> + backlight = <&backlight>;
> + dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
> + reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
> + spi-max-frequency = <100000000>;
> +
> + height-mm = <39>;
> + width-mm = <39>;
> +
> + /* Set hb-porch to compensate for non-visible area */
> + panel-timing {
> + hactive = <240>;
> + vactive = <240>;
> + hback-porch = <80>;
> + vback-porch = <0>;
> + clock-frequency = <0>;
> + hfront-porch = <0>;
> + hsync-len = <0>;
> + vfront-porch = <0>;
> + vsync-len = <0>;
> + };
> + };
> +};
> +
> +&uart0 {
> + pinctrl-0 = <&uart0_pb_pins>;
> + pinctrl-names = "default";
> + status = "okay";
> +};
> +
> +&usb_otg {
> + dr_mode = "otg";
> + status = "okay";
> +};
> +
> +&usb_power_supply {
> + status = "okay";
> +};
> +
> +&usbphy {
> + usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG5 */
> + status = "okay";
> +};
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-09-11 0:05 ` Andre Przywara
@ 2023-09-11 13:35 ` Chen-Yu Tsai
2023-09-11 14:36 ` Andre Przywara
0 siblings, 1 reply; 24+ messages in thread
From: Chen-Yu Tsai @ 2023-09-11 13:35 UTC (permalink / raw)
To: Andre Przywara
Cc: Chris Morgan, linux-sunxi, devicetree, airlied, conor+dt, daniel,
heiko, jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, Chris Morgan
On Mon, Sep 11, 2023 at 8:07 AM Andre Przywara <andre.przywara@arm.com> wrote:
>
> On Mon, 28 Aug 2023 13:19:41 -0500
> Chris Morgan <macroalpha82@gmail.com> wrote:
>
> Hi Chris,
>
> thanks for the changes. As Samuel already pointed out, there is now a
> problem with the RTC...
>
> > From: Chris Morgan <macromorgan@hotmail.com>
> >
> > The Anbernic RG-Nano is a small portable game device based on the
> > Allwinner V3s SoC. It has GPIO buttons on the face and side for
> > input, a single mono speaker, a 240x240 SPI controlled display, a USB-C
> > OTG port, an SD card slot for booting, and 64MB of RAM included in the
> > SoC.
> >
> > Working/Tested:
> > - SDMMC
> > - UART (for debugging)
> > - Buttons
> > - Charging/battery/PMIC
> > - Speaker
> > - RTC
> > - USB Host and Gadget*
> > - Display (at 60hz)
> >
> > *There is an issue with the usb_phy where it forces the device to host
> > mode. Until the phy driver is fixed this can be bypassed by either
> > removing the phy references from the ohci and ehci nodes or by setting
> > the usbphy on the ohci and ehci nodes to 1 (which is incorrect).
> >
> > Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
> > ---
> > arch/arm/boot/dts/allwinner/Makefile | 1 +
> > .../allwinner/sun8i-v3s-anbernic-rg-nano.dts | 284 ++++++++++++++++++
> > 2 files changed, 285 insertions(+)
> > create mode 100644 arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> >
> > diff --git a/arch/arm/boot/dts/allwinner/Makefile b/arch/arm/boot/dts/allwinner/Makefile
> > index 589a1ce1120a..2be83a1edcbb 100644
> > --- a/arch/arm/boot/dts/allwinner/Makefile
> > +++ b/arch/arm/boot/dts/allwinner/Makefile
> > @@ -237,6 +237,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
> > sun8i-t113s-mangopi-mq-r-t113.dtb \
> > sun8i-t3-cqa3t-bv3.dtb \
> > sun8i-v3-sl631-imx179.dtb \
> > + sun8i-v3s-anbernic-rg-nano.dtb \
> > sun8i-v3s-licheepi-zero.dtb \
> > sun8i-v3s-licheepi-zero-dock.dtb \
> > sun8i-v40-bananapi-m2-berry.dtb
> > diff --git a/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> > new file mode 100644
> > index 000000000000..bcccb0d3f9ce
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/allwinner/sun8i-v3s-anbernic-rg-nano.dts
> > @@ -0,0 +1,284 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +
> > +/dts-v1/;
> > +#include <dt-bindings/input/linux-event-codes.h>
> > +#include "sun8i-v3s.dtsi"
> > +#include "sunxi-common-regulators.dtsi"
> > +
> > +/ {
> > + model = "Anbernic RG Nano";
> > + compatible = "anbernic,rg-nano", "allwinner,sun8i-v3s";
> > +
> > + aliases {
> > + serial0 = &uart0;
> > + };
> > +
> > + backlight: backlight {
> > + compatible = "pwm-backlight";
> > + brightness-levels = <0 1 2 3 8 14 21 32 46 60 80 100>;
> > + default-brightness-level = <11>;
> > + power-supply = <®_vcc5v0>;
> > + pwms = <&pwm 0 40000 1>;
> > + };
> > +
> > + chosen {
> > + stdout-path = "serial0:115200n8";
> > + };
> > +
> > + gpio_keys: gpio-keys {
> > + compatible = "gpio-keys";
> > +
> > + button-a {
> > + gpios = <&gpio_expander 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-A";
> > + linux,code = <BTN_EAST>;
> > + };
> > +
> > + button-b {
> > + gpios = <&gpio_expander 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-B";
> > + linux,code = <BTN_SOUTH>;
> > + };
> > +
> > + button-down {
> > + gpios = <&gpio_expander 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "DPAD-DOWN";
> > + linux,code = <BTN_DPAD_DOWN>;
> > + };
> > +
> > + button-left {
> > + gpios = <&gpio_expander 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "DPAD-LEFT";
> > + linux,code = <BTN_DPAD_LEFT>;
> > + };
> > +
> > + button-right {
> > + gpios = <&gpio_expander 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "DPAD-RIGHT";
> > + linux,code = <BTN_DPAD_RIGHT>;
> > + };
> > +
> > + button-se {
> > + gpios = <&gpio_expander 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-SELECT";
> > + linux,code = <BTN_SELECT>;
> > + };
> > +
> > + button-st {
> > + gpios = <&gpio_expander 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-START";
> > + linux,code = <BTN_START>;
> > + };
> > +
> > + button-tl {
> > + gpios = <&gpio_expander 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-L";
> > + linux,code = <BTN_TL>;
> > + };
> > +
> > + button-tr {
> > + gpios = <&gpio_expander 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-R";
> > + linux,code = <BTN_TR>;
> > + };
> > +
> > + button-up {
> > + gpios = <&gpio_expander 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "DPAD-UP";
> > + linux,code = <BTN_DPAD_UP>;
> > + };
> > +
> > + button-x {
> > + gpios = <&gpio_expander 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-X";
> > + linux,code = <BTN_NORTH>;
> > + };
> > +
> > + button-y {
> > + gpios = <&gpio_expander 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
> > + label = "BTN-Y";
> > + linux,code = <BTN_WEST>;
> > + };
> > + };
> > +};
> > +
> > +&ccu {
> > + clocks = <&osc24M>, <&osc32k>;
>
> Samuel already pointed that out: please don't change that.
>
> > +};
> > +
> > +&codec {
> > + allwinner,audio-routing = "Speaker", "HP",
> > + "MIC1", "Mic",
> > + "Mic", "HBIAS";
> > + allwinner,pa-gpios = <&pio 5 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PF6 */
> > + status = "okay";
> > +};
> > +
> > +&ehci {
> > + status = "okay";
> > +};
> > +
> > +&i2c0 {
> > + status = "okay";
> > +
> > + gpio_expander: gpio@20 {
> > + compatible = "nxp,pcal6416";
> > + reg = <0x20>;
> > + gpio-controller;
> > + #gpio-cells = <2>;
> > + #interrupt-cells = <2>;
> > + interrupt-controller;
> > + interrupt-parent = <&pio>;
> > + interrupts = <1 3 IRQ_TYPE_EDGE_BOTH>; /* PB3/EINT3 */
> > + vcc-supply = <®_vcc3v3>;
> > + };
> > +
> > + axp209: pmic@34 {
> > + reg = <0x34>;
> > + interrupt-parent = <&pio>;
> > + interrupts = <1 5 IRQ_TYPE_EDGE_FALLING>; /* PB5/EINT5 */
> > + };
> > +
> > + pcf8563: rtc@51 {
> > + compatible = "nxp,pcf8563";
> > + reg = <0x51>;
> > + };
> > +};
> > +
> > +#include "axp209.dtsi"
> > +
> > +&battery_power_supply {
> > + status = "okay";
> > +};
> > +
> > +&mmc0 {
> > + broken-cd;
> > + bus-width = <4>;
> > + disable-wp;
> > + vmmc-supply = <®_vcc3v3>;
> > + vqmmc-supply = <®_vcc3v3>;
> > + status = "okay";
> > +};
> > +
> > +&ohci {
> > + status = "okay";
> > +};
> > +
> > +&pio {
> > + clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
> > + vcc-pb-supply = <®_vcc3v3>;
> > + vcc-pc-supply = <®_vcc3v3>;
> > + vcc-pf-supply = <®_vcc3v3>;
> > + vcc-pg-supply = <®_vcc3v3>;
> > +
> > + spi0_no_miso_pins: spi0-no-miso-pins {
> > + pins = "PC1", "PC2", "PC3";
> > + function = "spi0";
> > + };
> > +};
> > +
> > +&pwm {
> > + pinctrl-0 = <&pwm0_pin>;
> > + pinctrl-names = "default";
> > + status = "okay";
> > +};
> > +
> > +/* DCDC2 wired into vdd-cpu, vdd-sys, and vdd-ephy. */
> > +®_dcdc2 {
> > + regulator-always-on;
> > + regulator-max-microvolt = <1250000>;
> > + regulator-min-microvolt = <1250000>;
> > + regulator-name = "vdd-cpu";
> > +};
> > +
> > +/* DCDC3 wired into every 3.3v input that isn't the RTC. */
> > +®_dcdc3 {
> > + regulator-always-on;
> > + regulator-max-microvolt = <3300000>;
> > + regulator-min-microvolt = <3300000>;
> > + regulator-name = "vcc-io";
> > +};
> > +
> > +/*
> > + * LDO1 wired into RTC, voltage is hard-wired at 3.3v and cannot be
> > + * software modified. Note that setting voltage here to 3.3v for accuracy
> > + * sake causes an issue with the driver that causes it to fail to probe
> > + * because of a voltage constraint in the driver.
> > + */
> > +®_ldo1 {
> > + regulator-always-on;
> > + regulator-name = "vcc-rtc";
> > +};
> > +
> > +/* LDO2 wired into VCC-PLL and audio codec. */
> > +®_ldo2 {
> > + regulator-always-on;
> > + regulator-max-microvolt = <3000000>;
> > + regulator-min-microvolt = <3000000>;
> > + regulator-name = "vcc-pll";
> > +};
> > +
> > +/* LDO3, LDO4, and LDO5 unused. */
> > +®_ldo3 {
> > + status = "disabled";
> > +};
> > +
> > +®_ldo4 {
> > + status = "disabled";
> > +};
> > +
> > +/* External RTC used instead, internal RTC runs fast. */
> > +&rtc {
> > + status = "disabled";
>
> So as Samuel mentioned, I don't think you should disable the RTC, even
> if you have another RTC which provides more accurate time reading.
> On most Allwinner chips the RTC provides more than just the actual
> timekeeping functionality, as it also provides various derived clocks.
>
> So when you say the "internal RTC runs fast", that sounds like the
> board does not actually connect an external 32K crystal to the
> X32KIN/X32KOUT pins?
> So what happens if you remove the clocks property from the RTC node?
> If I read the code correctly, that should make the driver aware of the
> lack of a crystal, which might improve things?
> The manual seems to somewhat suggest that an external oscillator is
> mandatory - and we modelled the sun8i-v3s.dtsi base after that. Though
> I believe the RTC supports using the internal RC oscillator, and
> omitting the "clocks" property should make the driver switch the RTC
> over.
>
> This is at least my naive and quick interpretation of the code. I am
> not an Allwinner RTC expert though, so happy to hear Samuel's opinion.
>
> Regarding multiple RTCs: I didn't find anything which assigns a
> priority level to multiple RTCs in the system. What you can do on the
> userland side is to have a udev rule that links the PCF device to
> /dev/rtc, so that most tools would use that as a time source.
You can add DT aliases to override the numbering, thus making an external
one rtc0 and the internal one rtc1. See
arch/arm/boot/dts/allwinner/sun6i-a31-hummingbird.dts for such an example.
ChenYu
> Cheers,
> Andre
>
> > +};
> > +
> > +&spi0 {
> > + pinctrl-0 = <&spi0_no_miso_pins>;
> > + pinctrl-names = "default";
> > + status = "okay";
> > +
> > + display@0 {
> > + compatible = "saef,sftc154b", "panel-mipi-dbi-spi";
> > + reg = <0>;
> > + backlight = <&backlight>;
> > + dc-gpios = <&pio 2 0 GPIO_ACTIVE_HIGH>; /* PC0 */
> > + reset-gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
> > + spi-max-frequency = <100000000>;
> > +
> > + height-mm = <39>;
> > + width-mm = <39>;
> > +
> > + /* Set hb-porch to compensate for non-visible area */
> > + panel-timing {
> > + hactive = <240>;
> > + vactive = <240>;
> > + hback-porch = <80>;
> > + vback-porch = <0>;
> > + clock-frequency = <0>;
> > + hfront-porch = <0>;
> > + hsync-len = <0>;
> > + vfront-porch = <0>;
> > + vsync-len = <0>;
> > + };
> > + };
> > +};
> > +
> > +&uart0 {
> > + pinctrl-0 = <&uart0_pb_pins>;
> > + pinctrl-names = "default";
> > + status = "okay";
> > +};
> > +
> > +&usb_otg {
> > + dr_mode = "otg";
> > + status = "okay";
> > +};
> > +
> > +&usb_power_supply {
> > + status = "okay";
> > +};
> > +
> > +&usbphy {
> > + usb0_id_det-gpios = <&pio 6 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PG5 */
> > + status = "okay";
> > +};
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH V4 8/8] ARM: dts: sunxi: add support for Anbernic RG-Nano
2023-09-11 13:35 ` Chen-Yu Tsai
@ 2023-09-11 14:36 ` Andre Przywara
0 siblings, 0 replies; 24+ messages in thread
From: Andre Przywara @ 2023-09-11 14:36 UTC (permalink / raw)
To: Chen-Yu Tsai
Cc: Chris Morgan, linux-sunxi, devicetree, airlied, conor+dt, daniel,
heiko, jagan, jernej.skrabec, krzysztof.kozlowski+dt, mripard,
neil.armstrong, noralf, robh+dt, sam, samuel, uwu, Chris Morgan
On Mon, 11 Sep 2023 21:35:19 +0800
Chen-Yu Tsai <wens@csie.org> wrote:
Hi Chen-Yu,
[...]
> > Regarding multiple RTCs: I didn't find anything which assigns a
> > priority level to multiple RTCs in the system. What you can do on the
> > userland side is to have a udev rule that links the PCF device to
> > /dev/rtc, so that most tools would use that as a time source.
>
> You can add DT aliases to override the numbering, thus making an external
> one rtc0 and the internal one rtc1. See
> arch/arm/boot/dts/allwinner/sun6i-a31-hummingbird.dts for such an example.
Ah, excellent, I somehow missed this. That should indeed solve that
problem.
Thanks for the heads up!
Andre
^ permalink raw reply [flat|nested] 24+ messages in thread