[linux-sunxi] Re: [PATCH 8/8] arm64: dts: allwinner: Add OrangePi Zero 2 .dts

2020-12-02 Thread André Przywara
On 02/12/2020 15:57, Icenowy Zheng wrote:
> 在 2020-12-02星期三的 13:54 +,Andre Przywara写道:
>> The OrangePi Zero 2 is a development board with the new H616 SoC.
>>
>> It features the usual connectors used on those small boards, and
>> comes
>> with the AXP305, which seems to be compatible with the AXP805.
>>
>> For more details see: http://linux-sunxi.org/Xunlong_Orange_Pi_Zero2
>>
>> Signed-off-by: Andre Przywara 
>> ---
>>  arch/arm64/boot/dts/allwinner/Makefile|   1 +
>>  .../allwinner/sun50i-h616-orangepi-zero2.dts  | 228
>> ++
>>  2 files changed, 229 insertions(+)
>>  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-
>> orangepi-zero2.dts
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/Makefile
>> b/arch/arm64/boot/dts/allwinner/Makefile
>> index 211d1e9d4701..0cf8299b1ce7 100644
>> --- a/arch/arm64/boot/dts/allwinner/Makefile
>> +++ b/arch/arm64/boot/dts/allwinner/Makefile
>> @@ -35,3 +35,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-one-
>> plus.dtb
>>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
>>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb
>>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb
>> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-
>> zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-
>> zero2.dts
>> new file mode 100644
>> index ..814f5b4fec7c
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
>> @@ -0,0 +1,228 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
>> +/*
>> + * Copyright (C) 2020 Arm Ltd.
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include "sun50i-h616.dtsi"
>> +
>> +#include 
>> +#include 
>> +
>> +/ {
>> +model = "OrangePi Zero2";
>> +compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
>> +
>> +aliases {
>> +ethernet0 = 
>> +serial0 = 
>> +};
>> +
>> +chosen {
>> +stdout-path = "serial0:115200n8";
>> +};
>> +
>> +leds {
>> +compatible = "gpio-leds";
>> +
>> +power {
>> +label = "orangepi:red:power";
>> +gpios = < 2 13 GPIO_ACTIVE_HIGH>; /* PC13
>> */
>> +default-state = "on";
>> +};
>> +
>> +status {
>> +label = "orangepi:green:status";
>> +gpios = < 2 12 GPIO_ACTIVE_HIGH>; /* PC12
>> */
>> +};
>> +};
>> +
>> +reg_vcc5v: vcc5v {
>> +/* board wide 5V supply directly from the USB-C socket
>> */
>> +compatible = "regulator-fixed";
>> +regulator-name = "vcc-5v";
>> +regulator-min-microvolt = <500>;
>> +regulator-max-microvolt = <500>;
>> +regulator-always-on;
>> +};
>> +
>> +reg_usb1_vbus: usb1-vbus {
>> +compatible = "regulator-fixed";
>> +regulator-name = "usb1-vbus";
>> +regulator-min-microvolt = <500>;
>> +regulator-max-microvolt = <500>;
>> +enable-active-high;
>> +gpio = < 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
>> +status = "okay";
>> +};
>> +};
>> +
>> + {
>> +status = "okay";
>> +};
>> +
>> + {
>> +status = "okay";
>> +};
>> +
>> +/* USB 2 & 3 are on headers only. */
>> +
>> + {
>> +pinctrl-names = "default";
>> +pinctrl-0 = <_rgmii_pins>;
>> +phy-mode = "rgmii";
>> +phy-handle = <_rgmii_phy>;
>> +phy-supply = <_dcdce>;
>> +allwinner,rx-delay-ps = <3100>;
>> +allwinner,tx-delay-ps = <700>;
>> +status = "okay";
>> +};
>> +
>> + {
>> +ext_rgmii_phy: ethernet-phy@1 {
>> +compatible = "ethernet-phy-ieee802.3-c22";
>> +reg = <1>;
>> +};
>> +};
>> +
>> + {
>> +vmmc-supply = <_dcdce>;
>> +cd-gpios = < 5 6 GPIO_ACTIVE_LOW>;  /* PF6 */
>> +bus-width = <4>;
>> +status = "okay";
>> +};
>> +
>> + {
>> +status = "okay";
>> +};
>> +
>> + {
>> +status = "okay";
>> +};
>> +
>> +_i2c {
>> +status = "okay";
>> +
>> +axp305: pmic@36 {
>> +compatible = "x-powers,axp305", "x-powers,axp805",
>> + "x-powers,axp806";
>> +reg = <0x36>;
>> +
>> +/* dummy interrupt to appease the driver for now */
>> +interrupts = ;
>> +interrupt-controller;
>> +#interrupt-cells = <1>;
> 
> Is dummy interrupt future-proof?

No, it's just a placeholder. The whole interrupt controller story isn't
fully clear yet, the BSP DTS mentions one, but I didn't have time to
investigate this yet. There is no NMI pad anymore, but an NMI IRQ number
in this GIC table. The OPi Zero2 does not connect the AXP's IRQ pin to
anything.

I haven't checked the AXP driver yet, maybe it just needs to accept no
interrupts?

>> +
>> +x-powers,self-working-mode;
>> +vina-supply = <_vcc5v>;
>> +

[linux-sunxi] Re: [PATCH 8/8] arm64: dts: allwinner: Add OrangePi Zero 2 .dts

2020-12-02 Thread Maxime Ripard
On Wed, Dec 02, 2020 at 01:54:09PM +, Andre Przywara wrote:
> The OrangePi Zero 2 is a development board with the new H616 SoC.
> 
> It features the usual connectors used on those small boards, and comes
> with the AXP305, which seems to be compatible with the AXP805.
> 
> For more details see: http://linux-sunxi.org/Xunlong_Orange_Pi_Zero2
> 
> Signed-off-by: Andre Przywara 
> ---
>  arch/arm64/boot/dts/allwinner/Makefile|   1 +
>  .../allwinner/sun50i-h616-orangepi-zero2.dts  | 228 ++
>  2 files changed, 229 insertions(+)
>  create mode 100644 
> arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> 
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile 
> b/arch/arm64/boot/dts/allwinner/Makefile
> index 211d1e9d4701..0cf8299b1ce7 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -35,3 +35,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-one-plus.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts 
> b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> new file mode 100644
> index ..814f5b4fec7c
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> @@ -0,0 +1,228 @@
> +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
> +/*
> + * Copyright (C) 2020 Arm Ltd.
> + */
> +
> +/dts-v1/;
> +
> +#include "sun50i-h616.dtsi"
> +
> +#include 
> +#include 
> +
> +/ {
> + model = "OrangePi Zero2";
> + compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";

This needs to be documented too

> + aliases {
> + ethernet0 = 
> + serial0 = 
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + power {
> + label = "orangepi:red:power";
> + gpios = < 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
> + default-state = "on";
> + };
> +
> + status {
> + label = "orangepi:green:status";
> + gpios = < 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
> + };

Those node names don't follow the led binding convention

> + };
> +
> + reg_vcc5v: vcc5v {
> + /* board wide 5V supply directly from the USB-C socket */
> + compatible = "regulator-fixed";
> + regulator-name = "vcc-5v";
> + regulator-min-microvolt = <500>;
> + regulator-max-microvolt = <500>;
> + regulator-always-on;
> + };
> +
> + reg_usb1_vbus: usb1-vbus {
> + compatible = "regulator-fixed";
> + regulator-name = "usb1-vbus";
> + regulator-min-microvolt = <500>;
> + regulator-max-microvolt = <500>;
> + enable-active-high;
> + gpio = < 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
> + status = "okay";
> + };
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> +/* USB 2 & 3 are on headers only. */
> +
> + {
> + pinctrl-names = "default";
> + pinctrl-0 = <_rgmii_pins>;
> + phy-mode = "rgmii";
> + phy-handle = <_rgmii_phy>;
> + phy-supply = <_dcdce>;
> + allwinner,rx-delay-ps = <3100>;
> + allwinner,tx-delay-ps = <700>;
> + status = "okay";
> +};
> +
> + {
> + ext_rgmii_phy: ethernet-phy@1 {
> + compatible = "ethernet-phy-ieee802.3-c22";
> + reg = <1>;
> + };
> +};
> +
> + {
> + vmmc-supply = <_dcdce>;
> + cd-gpios = < 5 6 GPIO_ACTIVE_LOW>;  /* PF6 */
> + bus-width = <4>;
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> +_i2c {
> + status = "okay";
> +
> + axp305: pmic@36 {
> + compatible = "x-powers,axp305", "x-powers,axp805",
> +  "x-powers,axp806";
> + reg = <0x36>;
> +
> + /* dummy interrupt to appease the driver for now */
> + interrupts = ;
> + interrupt-controller;
> + #interrupt-cells = <1>;
> +
> + x-powers,self-working-mode;
> + vina-supply = <_vcc5v>;
> + vinb-supply = <_vcc5v>;
> + vinc-supply = <_vcc5v>;
> + vind-supply = <_vcc5v>;
> + vine-supply = <_vcc5v>;
> + aldoin-supply = <_vcc5v>;
> + bldoin-supply = <_vcc5v>;
> + cldoin-supply = <_vcc5v>;
> +
> + regulators {
> + reg_aldo1: aldo1 {
> + regulator-always-on;
> + 

[linux-sunxi] Re: [PATCH 8/8] arm64: dts: allwinner: Add OrangePi Zero 2 .dts

2020-12-02 Thread Icenowy Zheng
在 2020-12-02星期三的 13:54 +,Andre Przywara写道:
> The OrangePi Zero 2 is a development board with the new H616 SoC.
> 
> It features the usual connectors used on those small boards, and
> comes
> with the AXP305, which seems to be compatible with the AXP805.
> 
> For more details see: http://linux-sunxi.org/Xunlong_Orange_Pi_Zero2
> 
> Signed-off-by: Andre Przywara 
> ---
>  arch/arm64/boot/dts/allwinner/Makefile|   1 +
>  .../allwinner/sun50i-h616-orangepi-zero2.dts  | 228
> ++
>  2 files changed, 229 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-
> orangepi-zero2.dts
> 
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile
> b/arch/arm64/boot/dts/allwinner/Makefile
> index 211d1e9d4701..0cf8299b1ce7 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -35,3 +35,4 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-one-
> plus.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-
> zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-
> zero2.dts
> new file mode 100644
> index ..814f5b4fec7c
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
> @@ -0,0 +1,228 @@
> +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
> +/*
> + * Copyright (C) 2020 Arm Ltd.
> + */
> +
> +/dts-v1/;
> +
> +#include "sun50i-h616.dtsi"
> +
> +#include 
> +#include 
> +
> +/ {
> + model = "OrangePi Zero2";
> + compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
> +
> + aliases {
> + ethernet0 = 
> + serial0 = 
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + power {
> + label = "orangepi:red:power";
> + gpios = < 2 13 GPIO_ACTIVE_HIGH>; /* PC13
> */
> + default-state = "on";
> + };
> +
> + status {
> + label = "orangepi:green:status";
> + gpios = < 2 12 GPIO_ACTIVE_HIGH>; /* PC12
> */
> + };
> + };
> +
> + reg_vcc5v: vcc5v {
> + /* board wide 5V supply directly from the USB-C socket
> */
> + compatible = "regulator-fixed";
> + regulator-name = "vcc-5v";
> + regulator-min-microvolt = <500>;
> + regulator-max-microvolt = <500>;
> + regulator-always-on;
> + };
> +
> + reg_usb1_vbus: usb1-vbus {
> + compatible = "regulator-fixed";
> + regulator-name = "usb1-vbus";
> + regulator-min-microvolt = <500>;
> + regulator-max-microvolt = <500>;
> + enable-active-high;
> + gpio = < 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
> + status = "okay";
> + };
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> +/* USB 2 & 3 are on headers only. */
> +
> + {
> + pinctrl-names = "default";
> + pinctrl-0 = <_rgmii_pins>;
> + phy-mode = "rgmii";
> + phy-handle = <_rgmii_phy>;
> + phy-supply = <_dcdce>;
> + allwinner,rx-delay-ps = <3100>;
> + allwinner,tx-delay-ps = <700>;
> + status = "okay";
> +};
> +
> + {
> + ext_rgmii_phy: ethernet-phy@1 {
> + compatible = "ethernet-phy-ieee802.3-c22";
> + reg = <1>;
> + };
> +};
> +
> + {
> + vmmc-supply = <_dcdce>;
> + cd-gpios = < 5 6 GPIO_ACTIVE_LOW>;  /* PF6 */
> + bus-width = <4>;
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> +};
> +
> +_i2c {
> + status = "okay";
> +
> + axp305: pmic@36 {
> + compatible = "x-powers,axp305", "x-powers,axp805",
> +  "x-powers,axp806";
> + reg = <0x36>;
> +
> + /* dummy interrupt to appease the driver for now */
> + interrupts = ;
> + interrupt-controller;
> + #interrupt-cells = <1>;

Is dummy interrupt future-proof?

> +
> + x-powers,self-working-mode;
> + vina-supply = <_vcc5v>;
> + vinb-supply = <_vcc5v>;
> + vinc-supply = <_vcc5v>;
> + vind-supply = <_vcc5v>;
> + vine-supply = <_vcc5v>;
> + aldoin-supply = <_vcc5v>;
> + bldoin-supply = <_vcc5v>;
> + cldoin-supply = <_vcc5v>;
> +
> + regulators {
> + reg_aldo1: aldo1 {
> + regulator-always-on;
> + regulator-min-microvolt = <330>;
> +