2023-04-19 12:23:25

by Ludwig Kormann

[permalink] [raw]
Subject: [PATCH v2 1/1] arm: dts: sunxi: Add ICnova A20 ADB4006 board support

Add board support for ICnova A20 SomPi compute module on
ICnova ADB4006 development board.

Specification:
SoM
- Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz
- 512MB DDR3 RAM
- Fast Ethernet (Phy: Realtek RTL8201CP)
ADB4006
- I2C
- 2x USB 2.0
- 1x Fast Ethernet port
- 1x SATA
- 2x buttons (PWRON, Boot)
- 2x LEDS
- serial console
- HDMI
- µSD-Card slot
- Audio Line-In / Line-Out
- GPIO pinheaders

https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006
https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM

---

changes in v2:
- use short licensing header
- remove deprecated elements from led nodes
- disable csi power supply
- add missing pins in usbphy node
- split dts into SoM dtsi and carrier board dts

v1 of this patch was sent to the uboot mailing list [1].

[1] https://lists.denx.de/pipermail/u-boot/2023-April/514605.html

Signed-off-by: Ludwig Kormann <[email protected]>
---
.../devicetree/bindings/arm/sunxi.yaml | 6 +
arch/arm/boot/dts/Makefile | 1 +
.../boot/dts/sun7i-a20-icnova-a20-adb4006.dts | 137 ++++++++++++++++++
arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi | 63 ++++++++
4 files changed, 207 insertions(+)
create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi

diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
index 013821f4a7b8..12f0c236f17b 100644
--- a/Documentation/devicetree/bindings/arm/sunxi.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
@@ -305,6 +305,12 @@ properties:
- const: allwinner,i12-tvbox
- const: allwinner,sun7i-a20

+ - description: ICNova A20 ADB4006
+ items:
+ - const: incircuit,icnova-a20-adb4006
+ - const: incircuit,icnova-a20
+ - const: allwinner,sun7i-a20
+
- description: ICNova A20 SWAC
items:
- const: incircuit,icnova-a20-swac
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 3cc32722c394..b6b408417261 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1321,6 +1321,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
sun7i-a20-hummingbird.dtb \
sun7i-a20-itead-ibox.dtb \
sun7i-a20-i12-tvbox.dtb \
+ sun7i-a20-icnova-a20-adb4006.dtb \
sun7i-a20-icnova-swac.dtb \
sun7i-a20-lamobo-r1.dtb \
sun7i-a20-linutronix-testbox-v2.dtb \
diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
new file mode 100644
index 000000000000..c1606c085e4e
--- /dev/null
+++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
@@ -0,0 +1,137 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2023 In-Circuit GmbH
+
+/dts-v1/;
+
+#include "sun7i-a20-icnova-a20.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+ model = "In-Circuit ICnova A20 ADB4006";
+ compatible = "incircuit,icnova-a20-adb4006", "incircuit,icnova-a20",
+ "allwinner,sun7i-a20";
+
+ aliases {
+ serial0 = &uart0;
+ };
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ hdmi-connector {
+ compatible = "hdmi-connector";
+ type = "a";
+
+ port {
+ hdmi_con_in: endpoint {
+ remote-endpoint = <&hdmi_out_con>;
+ };
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
+ led-0 {
+ function = LED_FUNCTION_POWER;
+ color = <LED_COLOR_ID_YELLOW>;
+ gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */
+ default-state = "on";
+ };
+
+ led-1 {
+ function = LED_FUNCTION_HEARTBEAT;
+ color = <LED_COLOR_ID_RED>;
+ gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; /* PH20 */
+ linux,default-trigger = "heartbeat";
+ };
+ };
+};
+
+&ahci {
+ target-supply = <&reg_ahci_5v>;
+ status = "okay";
+};
+
+&codec {
+ status = "okay";
+};
+
+&de {
+ status = "okay";
+};
+
+&ehci0 {
+ status = "okay";
+};
+
+&ehci1 {
+ status = "okay";
+};
+
+&hdmi {
+ status = "okay";
+};
+
+&hdmi_out {
+ hdmi_out_con: endpoint {
+ remote-endpoint = <&hdmi_con_in>;
+ };
+};
+
+&mmc0 {
+ vmmc-supply = <&reg_vcc3v3>;
+ bus-width = <4>;
+ cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
+ status = "okay";
+};
+
+&ohci0 {
+ status = "okay";
+};
+
+&ohci1 {
+ status = "okay";
+};
+
+&otg_sram {
+ status = "okay";
+};
+
+&reg_ahci_5v {
+ status = "okay";
+};
+
+&ac_power_supply {
+ status = "okay";
+};
+
+&reg_usb1_vbus {
+ status = "okay";
+};
+
+&reg_usb2_vbus {
+ status = "okay";
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pb_pins>;
+ status = "okay";
+};
+
+&usb_otg {
+ dr_mode = "otg";
+ status = "okay";
+};
+
+&usbphy {
+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+ usb1_vbus-supply = <&reg_usb1_vbus>;
+ usb2_vbus-supply = <&reg_usb2_vbus>;
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi b/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
new file mode 100644
index 000000000000..f1142bda5cd7
--- /dev/null
+++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2023 In-Circuit GmbH
+
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/interrupt-controller/irq.h>
+
+&cpu0 {
+ cpu-supply = <&reg_dcdc2>;
+};
+
+&gmac {
+ pinctrl-names = "default";
+ pinctrl-0 = <&gmac_mii_pins>;
+ phy-handle = <&phy1>;
+ phy-mode = "mii";
+ status = "okay";
+};
+
+&i2c0 {
+ status = "okay";
+
+ axp209: pmic@34 {
+ reg = <0x34>;
+ interrupt-parent = <&nmi_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ };
+};
+
+&gmac_mdio {
+ phy1: ethernet-phy@1 {
+ reg = <1>;
+ };
+};
+
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+ regulator-always-on;
+ regulator-min-microvolt = <1000000>;
+ regulator-max-microvolt = <1400000>;
+ regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+ regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+ regulator-always-on;
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-name = "avcc";
+};
+
--
2.30.2


2023-04-19 13:13:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] arm: dts: sunxi: Add ICnova A20 ADB4006 board support

On 19/04/2023 14:12, Ludwig Kormann wrote:
> Add board support for ICnova A20 SomPi compute module on
> ICnova ADB4006 development board.
>
> Specification:
> SoM
> - Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz
> - 512MB DDR3 RAM
> - Fast Ethernet (Phy: Realtek RTL8201CP)
> ADB4006
> - I2C
> - 2x USB 2.0
> - 1x Fast Ethernet port
> - 1x SATA
> - 2x buttons (PWRON, Boot)
> - 2x LEDS
> - serial console
> - HDMI
> - µSD-Card slot
> - Audio Line-In / Line-Out
> - GPIO pinheaders
>
> https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006
> https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM
>
> ---
>
> changes in v2:
> - use short licensing header
> - remove deprecated elements from led nodes
> - disable csi power supply
> - add missing pins in usbphy node
> - split dts into SoM dtsi and carrier board dts
>
> v1 of this patch was sent to the uboot mailing list [1].
>
> [1] https://lists.denx.de/pipermail/u-boot/2023-April/514605.html
>
> Signed-off-by: Ludwig Kormann <[email protected]>
> ---
> .../devicetree/bindings/arm/sunxi.yaml | 6 +

Bindings are always separate patches. checkpatch did not complain?

> arch/arm/boot/dts/Makefile | 1 +
> .../boot/dts/sun7i-a20-icnova-a20-adb4006.dts | 137 ++++++++++++++++++
> arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi | 63 ++++++++
> 4 files changed, 207 insertions(+)
> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
>
> diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
> index 013821f4a7b8..12f0c236f17b 100644
> --- a/Documentation/devicetree/bindings/arm/sunxi.yaml
> +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
> @@ -305,6 +305,12 @@ properties:
> - const: allwinner,i12-tvbox
> - const: allwinner,sun7i-a20
>
> + - description: ICNova A20 ADB4006
> + items:
> + - const: incircuit,icnova-a20-adb4006
> + - const: incircuit,icnova-a20
> + - const: allwinner,sun7i-a20
> +
> - description: ICNova A20 SWAC
> items:
> - const: incircuit,icnova-a20-swac
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 3cc32722c394..b6b408417261 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -1321,6 +1321,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
> sun7i-a20-hummingbird.dtb \
> sun7i-a20-itead-ibox.dtb \
> sun7i-a20-i12-tvbox.dtb \
> + sun7i-a20-icnova-a20-adb4006.dtb \
> sun7i-a20-icnova-swac.dtb \
> sun7i-a20-lamobo-r1.dtb \
> sun7i-a20-linutronix-testbox-v2.dtb \
> diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> new file mode 100644
> index 000000000000..c1606c085e4e
> --- /dev/null
> +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> @@ -0,0 +1,137 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

Unusual license. Are you sure you are ok with GPLv5.0?

Also, at the end of your files - drop stray blank lines.

Best regards,
Krzysztof

2023-04-20 08:35:04

by Ludwig Kormann

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] arm: dts: sunxi: Add ICnova A20 ADB4006 board support

Hi,

thanks for your review.

Am 19.04.23 um 15:05 schrieb Krzysztof Kozlowski:
> On 19/04/2023 14:12, Ludwig Kormann wrote:
>> Add board support for ICnova A20 SomPi compute module on
>> ICnova ADB4006 development board.
>>
>> Specification:
>> SoM
>> - Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz
>> - 512MB DDR3 RAM
>> - Fast Ethernet (Phy: Realtek RTL8201CP)
>> ADB4006
>> - I2C
>> - 2x USB 2.0
>> - 1x Fast Ethernet port
>> - 1x SATA
>> - 2x buttons (PWRON, Boot)
>> - 2x LEDS
>> - serial console
>> - HDMI
>> - µSD-Card slot
>> - Audio Line-In / Line-Out
>> - GPIO pinheaders
>>
>> https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006
>> https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM
>>
>> ---
>>
>> changes in v2:
>> - use short licensing header
>> - remove deprecated elements from led nodes
>> - disable csi power supply
>> - add missing pins in usbphy node
>> - split dts into SoM dtsi and carrier board dts
>>
>> v1 of this patch was sent to the uboot mailing list [1].
>>
>> [1] https://lists.denx.de/pipermail/u-boot/2023-April/514605.html
>>
>> Signed-off-by: Ludwig Kormann <[email protected]>
>> ---
>>   .../devicetree/bindings/arm/sunxi.yaml        |   6 +
> Bindings are always separate patches. checkpatch did not complain?
>

I just ran checkpatch.pl, you're right, it does complain. I will move
the bindings to a seperate patch.

>> arch/arm/boot/dts/Makefile                    |   1 +
>>   .../boot/dts/sun7i-a20-icnova-a20-adb4006.dts | 137 ++++++++++++++++++
>>   arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi   |  63 ++++++++
>>   4 files changed, 207 insertions(+)
>>   create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>>   create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
>>
>> diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml
>> b/Documentation/devicetree/bindings/arm/sunxi.yaml
>> index 013821f4a7b8..12f0c236f17b 100644
>> --- a/Documentation/devicetree/bindings/arm/sunxi.yaml
>> +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
>> @@ -305,6 +305,12 @@ properties:
>>             - const: allwinner,i12-tvbox
>>             - const: allwinner,sun7i-a20
>>   +      - description: ICNova A20 ADB4006
>> +        items:
>> +          - const: incircuit,icnova-a20-adb4006
>> +          - const: incircuit,icnova-a20
>> +          - const: allwinner,sun7i-a20
>> +
>>         - description: ICNova A20 SWAC
>>           items:
>>             - const: incircuit,icnova-a20-swac
>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>> index 3cc32722c394..b6b408417261 100644
>> --- a/arch/arm/boot/dts/Makefile
>> +++ b/arch/arm/boot/dts/Makefile
>> @@ -1321,6 +1321,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
>>       sun7i-a20-hummingbird.dtb \
>>       sun7i-a20-itead-ibox.dtb \
>>       sun7i-a20-i12-tvbox.dtb \
>> +    sun7i-a20-icnova-a20-adb4006.dtb \
>>       sun7i-a20-icnova-swac.dtb \
>>       sun7i-a20-lamobo-r1.dtb \
>>       sun7i-a20-linutronix-testbox-v2.dtb \
>> diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>> b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>> new file mode 100644
>> index 000000000000..c1606c085e4e
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>> @@ -0,0 +1,137 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> Unusual license. Are you sure you are ok with GPLv5.0?

Thanks for the hint. I will remove the '+' and update the licensing to
"GPL-2.0 OR MIT".

>
> Also, at the end of your files - drop stray blank lines.

I will remove them.


I will implement the changes and provide patch series v3.

kind regards,
Ludwig

>
> Best regards,
> Krzysztof
>

2023-04-20 08:58:12

by Andre Przywara

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] arm: dts: sunxi: Add ICnova A20 ADB4006 board support

On Wed, 19 Apr 2023 15:05:17 +0200
Krzysztof Kozlowski <[email protected]> wrote:

> On 19/04/2023 14:12, Ludwig Kormann wrote:
> > Add board support for ICnova A20 SomPi compute module on
> > ICnova ADB4006 development board.
> >
> > Specification:
> > SoM
> > - Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz
> > - 512MB DDR3 RAM
> > - Fast Ethernet (Phy: Realtek RTL8201CP)
> > ADB4006
> > - I2C
> > - 2x USB 2.0
> > - 1x Fast Ethernet port
> > - 1x SATA
> > - 2x buttons (PWRON, Boot)
> > - 2x LEDS
> > - serial console
> > - HDMI
> > - µSD-Card slot
> > - Audio Line-In / Line-Out
> > - GPIO pinheaders
> >
> > https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006
> > https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM
> >
> > ---
> >
> > changes in v2:
> > - use short licensing header
> > - remove deprecated elements from led nodes
> > - disable csi power supply
> > - add missing pins in usbphy node
> > - split dts into SoM dtsi and carrier board dts
> >
> > v1 of this patch was sent to the uboot mailing list [1].
> >
> > [1] https://lists.denx.de/pipermail/u-boot/2023-April/514605.html
> >
> > Signed-off-by: Ludwig Kormann <[email protected]>
> > ---
> > .../devicetree/bindings/arm/sunxi.yaml | 6 +
>
> Bindings are always separate patches. checkpatch did not complain?
>
> > arch/arm/boot/dts/Makefile | 1 +
> > .../boot/dts/sun7i-a20-icnova-a20-adb4006.dts | 137 ++++++++++++++++++
> > arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi | 63 ++++++++
> > 4 files changed, 207 insertions(+)
> > create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> > create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
> >
> > diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
> > index 013821f4a7b8..12f0c236f17b 100644
> > --- a/Documentation/devicetree/bindings/arm/sunxi.yaml
> > +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
> > @@ -305,6 +305,12 @@ properties:
> > - const: allwinner,i12-tvbox
> > - const: allwinner,sun7i-a20
> >
> > + - description: ICNova A20 ADB4006
> > + items:
> > + - const: incircuit,icnova-a20-adb4006
> > + - const: incircuit,icnova-a20
> > + - const: allwinner,sun7i-a20
> > +
> > - description: ICNova A20 SWAC
> > items:
> > - const: incircuit,icnova-a20-swac
> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > index 3cc32722c394..b6b408417261 100644
> > --- a/arch/arm/boot/dts/Makefile
> > +++ b/arch/arm/boot/dts/Makefile
> > @@ -1321,6 +1321,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
> > sun7i-a20-hummingbird.dtb \
> > sun7i-a20-itead-ibox.dtb \
> > sun7i-a20-i12-tvbox.dtb \
> > + sun7i-a20-icnova-a20-adb4006.dtb \
> > sun7i-a20-icnova-swac.dtb \
> > sun7i-a20-lamobo-r1.dtb \
> > sun7i-a20-linutronix-testbox-v2.dtb \
> > diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> > new file mode 100644
> > index 000000000000..c1606c085e4e
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> > @@ -0,0 +1,137 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>
> Unusual license. Are you sure you are ok with GPLv5.0?

Is it really unusual? This is literally the most commonly used dual license
for DTs, grep counts 252 users in arm and 573 users in arm64.

Or is it that it's deprecated and we recommend (GPL-2.0 OR MIT) for new
files?

Cheers,
Andre


>
> Also, at the end of your files - drop stray blank lines.
>
> Best regards,
> Krzysztof
>

2023-04-20 09:09:37

by Andre Przywara

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] arm: dts: sunxi: Add ICnova A20 ADB4006 board support

On Wed, 19 Apr 2023 14:12:29 +0200
Ludwig Kormann <[email protected]> wrote:

Hi Ludwig,

thanks for posting this!

> Add board support for ICnova A20 SomPi compute module on
> ICnova ADB4006 development board.
>
> Specification:
> SoM
> - Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz
> - 512MB DDR3 RAM
> - Fast Ethernet (Phy: Realtek RTL8201CP)
> ADB4006
> - I2C
> - 2x USB 2.0
> - 1x Fast Ethernet port
> - 1x SATA
> - 2x buttons (PWRON, Boot)
> - 2x LEDS
> - serial console
> - HDMI
> - µSD-Card slot
> - Audio Line-In / Line-Out
> - GPIO pinheaders
>
> https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006
> https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM
>
> ---
>
> changes in v2:
> - use short licensing header
> - remove deprecated elements from led nodes
> - disable csi power supply
> - add missing pins in usbphy node
> - split dts into SoM dtsi and carrier board dts
>
> v1 of this patch was sent to the uboot mailing list [1].
>
> [1] https://lists.denx.de/pipermail/u-boot/2023-April/514605.html
>
> Signed-off-by: Ludwig Kormann <[email protected]>

So apart from what Krzysztof already mentioned (separate binding patch and
stray line), this looks good to me, and passed dt-validate. Also you
addressed all the comments I had on the U-Boot post (thanks for that), so
with those nits above fixed:

Reviewed-by: Andre Przywara <[email protected]>

Cheers,
Andre

> ---
> .../devicetree/bindings/arm/sunxi.yaml | 6 +
> arch/arm/boot/dts/Makefile | 1 +
> .../boot/dts/sun7i-a20-icnova-a20-adb4006.dts | 137 ++++++++++++++++++
> arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi | 63 ++++++++
> 4 files changed, 207 insertions(+)
> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
>
> diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
> index 013821f4a7b8..12f0c236f17b 100644
> --- a/Documentation/devicetree/bindings/arm/sunxi.yaml
> +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
> @@ -305,6 +305,12 @@ properties:
> - const: allwinner,i12-tvbox
> - const: allwinner,sun7i-a20
>
> + - description: ICNova A20 ADB4006
> + items:
> + - const: incircuit,icnova-a20-adb4006
> + - const: incircuit,icnova-a20
> + - const: allwinner,sun7i-a20
> +
> - description: ICNova A20 SWAC
> items:
> - const: incircuit,icnova-a20-swac
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 3cc32722c394..b6b408417261 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -1321,6 +1321,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
> sun7i-a20-hummingbird.dtb \
> sun7i-a20-itead-ibox.dtb \
> sun7i-a20-i12-tvbox.dtb \
> + sun7i-a20-icnova-a20-adb4006.dtb \
> sun7i-a20-icnova-swac.dtb \
> sun7i-a20-lamobo-r1.dtb \
> sun7i-a20-linutronix-testbox-v2.dtb \
> diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> new file mode 100644
> index 000000000000..c1606c085e4e
> --- /dev/null
> +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
> @@ -0,0 +1,137 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +// Copyright (C) 2023 In-Circuit GmbH
> +
> +/dts-v1/;
> +
> +#include "sun7i-a20-icnova-a20.dtsi"
> +
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/leds/common.h>
> +
> +/ {
> + model = "In-Circuit ICnova A20 ADB4006";
> + compatible = "incircuit,icnova-a20-adb4006", "incircuit,icnova-a20",
> + "allwinner,sun7i-a20";
> +
> + aliases {
> + serial0 = &uart0;
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + hdmi-connector {
> + compatible = "hdmi-connector";
> + type = "a";
> +
> + port {
> + hdmi_con_in: endpoint {
> + remote-endpoint = <&hdmi_out_con>;
> + };
> + };
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + led-0 {
> + function = LED_FUNCTION_POWER;
> + color = <LED_COLOR_ID_YELLOW>;
> + gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */
> + default-state = "on";
> + };
> +
> + led-1 {
> + function = LED_FUNCTION_HEARTBEAT;
> + color = <LED_COLOR_ID_RED>;
> + gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; /* PH20 */
> + linux,default-trigger = "heartbeat";
> + };
> + };
> +};
> +
> +&ahci {
> + target-supply = <&reg_ahci_5v>;
> + status = "okay";
> +};
> +
> +&codec {
> + status = "okay";
> +};
> +
> +&de {
> + status = "okay";
> +};
> +
> +&ehci0 {
> + status = "okay";
> +};
> +
> +&ehci1 {
> + status = "okay";
> +};
> +
> +&hdmi {
> + status = "okay";
> +};
> +
> +&hdmi_out {
> + hdmi_out_con: endpoint {
> + remote-endpoint = <&hdmi_con_in>;
> + };
> +};
> +
> +&mmc0 {
> + vmmc-supply = <&reg_vcc3v3>;
> + bus-width = <4>;
> + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
> + status = "okay";
> +};
> +
> +&ohci0 {
> + status = "okay";
> +};
> +
> +&ohci1 {
> + status = "okay";
> +};
> +
> +&otg_sram {
> + status = "okay";
> +};
> +
> +&reg_ahci_5v {
> + status = "okay";
> +};
> +
> +&ac_power_supply {
> + status = "okay";
> +};
> +
> +&reg_usb1_vbus {
> + status = "okay";
> +};
> +
> +&reg_usb2_vbus {
> + status = "okay";
> +};
> +
> +&uart0 {
> + pinctrl-names = "default";
> + pinctrl-0 = <&uart0_pb_pins>;
> + status = "okay";
> +};
> +
> +&usb_otg {
> + dr_mode = "otg";
> + status = "okay";
> +};
> +
> +&usbphy {
> + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
> + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
> + usb1_vbus-supply = <&reg_usb1_vbus>;
> + usb2_vbus-supply = <&reg_usb2_vbus>;
> + status = "okay";
> +};
> diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi b/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
> new file mode 100644
> index 000000000000..f1142bda5cd7
> --- /dev/null
> +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
> @@ -0,0 +1,63 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +// Copyright (C) 2023 In-Circuit GmbH
> +
> +#include "sun7i-a20.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +#include <dt-bindings/interrupt-controller/irq.h>
> +
> +&cpu0 {
> + cpu-supply = <&reg_dcdc2>;
> +};
> +
> +&gmac {
> + pinctrl-names = "default";
> + pinctrl-0 = <&gmac_mii_pins>;
> + phy-handle = <&phy1>;
> + phy-mode = "mii";
> + status = "okay";
> +};
> +
> +&i2c0 {
> + status = "okay";
> +
> + axp209: pmic@34 {
> + reg = <0x34>;
> + interrupt-parent = <&nmi_intc>;
> + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
> + };
> +};
> +
> +&gmac_mdio {
> + phy1: ethernet-phy@1 {
> + reg = <1>;
> + };
> +};
> +
> +#include "axp209.dtsi"
> +
> +&reg_dcdc2 {
> + regulator-always-on;
> + regulator-min-microvolt = <1000000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-name = "vdd-cpu";
> +};
> +
> +&reg_dcdc3 {
> + regulator-always-on;
> + regulator-min-microvolt = <1000000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-name = "vdd-int-dll";
> +};
> +
> +&reg_ldo1 {
> + regulator-name = "vdd-rtc";
> +};
> +
> +&reg_ldo2 {
> + regulator-always-on;
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3000000>;
> + regulator-name = "avcc";
> +};
> +

2023-04-20 09:26:25

by Ludwig Kormann

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] arm: dts: sunxi: Add ICnova A20 ADB4006 board support

Hi Andre,

Am 20.04.23 um 10:57 schrieb Andre Przywara:
> On Wed, 19 Apr 2023 14:12:29 +0200
> Ludwig Kormann <[email protected]> wrote:
>
> Hi Ludwig,
>
> thanks for posting this!
>
>> Add board support for ICnova A20 SomPi compute module on
>> ICnova ADB4006 development board.
>>
>> Specification:
>> SoM
>> - Processor: Allwinner A20 Cortex-A7 Dual Core at 1GHz
>> - 512MB DDR3 RAM
>> - Fast Ethernet (Phy: Realtek RTL8201CP)
>> ADB4006
>> - I2C
>> - 2x USB 2.0
>> - 1x Fast Ethernet port
>> - 1x SATA
>> - 2x buttons (PWRON, Boot)
>> - 2x LEDS
>> - serial console
>> - HDMI
>> - µSD-Card slot
>> - Audio Line-In / Line-Out
>> - GPIO pinheaders
>>
>> https://wiki.in-circuit.de/index.php5?title=ICnova_ADB4006
>> https://wiki.in-circuit.de/index.php5?title=ICnova_A20_SODIMM
>>
>> ---
>>
>> changes in v2:
>> - use short licensing header
>> - remove deprecated elements from led nodes
>> - disable csi power supply
>> - add missing pins in usbphy node
>> - split dts into SoM dtsi and carrier board dts
>>
>> v1 of this patch was sent to the uboot mailing list [1].
>>
>> [1] https://lists.denx.de/pipermail/u-boot/2023-April/514605.html
>>
>> Signed-off-by: Ludwig Kormann <[email protected]>
> So apart from what Krzysztof already mentioned (separate binding patch and
> stray line), this looks good to me, and passed dt-validate. Also you
> addressed all the comments I had on the U-Boot post (thanks for that), so
> with those nits above fixed:
>
> Reviewed-by: Andre Przywara <[email protected]>

Thanks for your review! I will provide v3 in a few minutes.

kind regards,
Ludwig
> Cheers,
> Andre
>
>> ---
>> .../devicetree/bindings/arm/sunxi.yaml | 6 +
>> arch/arm/boot/dts/Makefile | 1 +
>> .../boot/dts/sun7i-a20-icnova-a20-adb4006.dts | 137 ++++++++++++++++++
>> arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi | 63 ++++++++
>> 4 files changed, 207 insertions(+)
>> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
>>
>> diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
>> index 013821f4a7b8..12f0c236f17b 100644
>> --- a/Documentation/devicetree/bindings/arm/sunxi.yaml
>> +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
>> @@ -305,6 +305,12 @@ properties:
>> - const: allwinner,i12-tvbox
>> - const: allwinner,sun7i-a20
>>
>> + - description: ICNova A20 ADB4006
>> + items:
>> + - const: incircuit,icnova-a20-adb4006
>> + - const: incircuit,icnova-a20
>> + - const: allwinner,sun7i-a20
>> +
>> - description: ICNova A20 SWAC
>> items:
>> - const: incircuit,icnova-a20-swac
>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>> index 3cc32722c394..b6b408417261 100644
>> --- a/arch/arm/boot/dts/Makefile
>> +++ b/arch/arm/boot/dts/Makefile
>> @@ -1321,6 +1321,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
>> sun7i-a20-hummingbird.dtb \
>> sun7i-a20-itead-ibox.dtb \
>> sun7i-a20-i12-tvbox.dtb \
>> + sun7i-a20-icnova-a20-adb4006.dtb \
>> sun7i-a20-icnova-swac.dtb \
>> sun7i-a20-lamobo-r1.dtb \
>> sun7i-a20-linutronix-testbox-v2.dtb \
>> diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>> new file mode 100644
>> index 000000000000..c1606c085e4e
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>> @@ -0,0 +1,137 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>> +// Copyright (C) 2023 In-Circuit GmbH
>> +
>> +/dts-v1/;
>> +
>> +#include "sun7i-a20-icnova-a20.dtsi"
>> +
>> +#include <dt-bindings/gpio/gpio.h>
>> +#include <dt-bindings/leds/common.h>
>> +
>> +/ {
>> + model = "In-Circuit ICnova A20 ADB4006";
>> + compatible = "incircuit,icnova-a20-adb4006", "incircuit,icnova-a20",
>> + "allwinner,sun7i-a20";
>> +
>> + aliases {
>> + serial0 = &uart0;
>> + };
>> +
>> + chosen {
>> + stdout-path = "serial0:115200n8";
>> + };
>> +
>> + hdmi-connector {
>> + compatible = "hdmi-connector";
>> + type = "a";
>> +
>> + port {
>> + hdmi_con_in: endpoint {
>> + remote-endpoint = <&hdmi_out_con>;
>> + };
>> + };
>> + };
>> +
>> + leds {
>> + compatible = "gpio-leds";
>> +
>> + led-0 {
>> + function = LED_FUNCTION_POWER;
>> + color = <LED_COLOR_ID_YELLOW>;
>> + gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */
>> + default-state = "on";
>> + };
>> +
>> + led-1 {
>> + function = LED_FUNCTION_HEARTBEAT;
>> + color = <LED_COLOR_ID_RED>;
>> + gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; /* PH20 */
>> + linux,default-trigger = "heartbeat";
>> + };
>> + };
>> +};
>> +
>> +&ahci {
>> + target-supply = <&reg_ahci_5v>;
>> + status = "okay";
>> +};
>> +
>> +&codec {
>> + status = "okay";
>> +};
>> +
>> +&de {
>> + status = "okay";
>> +};
>> +
>> +&ehci0 {
>> + status = "okay";
>> +};
>> +
>> +&ehci1 {
>> + status = "okay";
>> +};
>> +
>> +&hdmi {
>> + status = "okay";
>> +};
>> +
>> +&hdmi_out {
>> + hdmi_out_con: endpoint {
>> + remote-endpoint = <&hdmi_con_in>;
>> + };
>> +};
>> +
>> +&mmc0 {
>> + vmmc-supply = <&reg_vcc3v3>;
>> + bus-width = <4>;
>> + cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
>> + status = "okay";
>> +};
>> +
>> +&ohci0 {
>> + status = "okay";
>> +};
>> +
>> +&ohci1 {
>> + status = "okay";
>> +};
>> +
>> +&otg_sram {
>> + status = "okay";
>> +};
>> +
>> +&reg_ahci_5v {
>> + status = "okay";
>> +};
>> +
>> +&ac_power_supply {
>> + status = "okay";
>> +};
>> +
>> +&reg_usb1_vbus {
>> + status = "okay";
>> +};
>> +
>> +&reg_usb2_vbus {
>> + status = "okay";
>> +};
>> +
>> +&uart0 {
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&uart0_pb_pins>;
>> + status = "okay";
>> +};
>> +
>> +&usb_otg {
>> + dr_mode = "otg";
>> + status = "okay";
>> +};
>> +
>> +&usbphy {
>> + usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
>> + usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
>> + usb1_vbus-supply = <&reg_usb1_vbus>;
>> + usb2_vbus-supply = <&reg_usb2_vbus>;
>> + status = "okay";
>> +};
>> diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi b/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
>> new file mode 100644
>> index 000000000000..f1142bda5cd7
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
>> @@ -0,0 +1,63 @@
>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>> +// Copyright (C) 2023 In-Circuit GmbH
>> +
>> +#include "sun7i-a20.dtsi"
>> +#include "sunxi-common-regulators.dtsi"
>> +
>> +#include <dt-bindings/interrupt-controller/irq.h>
>> +
>> +&cpu0 {
>> + cpu-supply = <&reg_dcdc2>;
>> +};
>> +
>> +&gmac {
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&gmac_mii_pins>;
>> + phy-handle = <&phy1>;
>> + phy-mode = "mii";
>> + status = "okay";
>> +};
>> +
>> +&i2c0 {
>> + status = "okay";
>> +
>> + axp209: pmic@34 {
>> + reg = <0x34>;
>> + interrupt-parent = <&nmi_intc>;
>> + interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>> + };
>> +};
>> +
>> +&gmac_mdio {
>> + phy1: ethernet-phy@1 {
>> + reg = <1>;
>> + };
>> +};
>> +
>> +#include "axp209.dtsi"
>> +
>> +&reg_dcdc2 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <1000000>;
>> + regulator-max-microvolt = <1400000>;
>> + regulator-name = "vdd-cpu";
>> +};
>> +
>> +&reg_dcdc3 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <1000000>;
>> + regulator-max-microvolt = <1400000>;
>> + regulator-name = "vdd-int-dll";
>> +};
>> +
>> +&reg_ldo1 {
>> + regulator-name = "vdd-rtc";
>> +};
>> +
>> +&reg_ldo2 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <3000000>;
>> + regulator-max-microvolt = <3000000>;
>> + regulator-name = "avcc";
>> +};
>> +
>

--
Dipl.-Ing. Ludwig Kormann

In-Circuit GmbH
Boltenhagener Straße 124
01109 Dresden
Germany

Phone: +49 351 42 66 850
Fax: +49 351 42 66 849
Email: [email protected]
https://www.in-circuit.de/

Name der Gesellschaft: In-Circuit GmbH
Sitz der Gesellschaft: Dresden
Handelsregister : HRB 23099
Geschäftsführer : Jörg Träger
UST-ID Nr. : DE237550066

2023-04-20 13:01:14

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/1] arm: dts: sunxi: Add ICnova A20 ADB4006 board support

On 20/04/2023 10:53, Andre Przywara wrote:
>> Bindings are always separate patches. checkpatch did not complain?
>>
>>> arch/arm/boot/dts/Makefile | 1 +
>>> .../boot/dts/sun7i-a20-icnova-a20-adb4006.dts | 137 ++++++++++++++++++
>>> arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi | 63 ++++++++
>>> 4 files changed, 207 insertions(+)
>>> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>>> create mode 100644 arch/arm/boot/dts/sun7i-a20-icnova-a20.dtsi
>>>
>>> diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentation/devicetree/bindings/arm/sunxi.yaml
>>> index 013821f4a7b8..12f0c236f17b 100644
>>> --- a/Documentation/devicetree/bindings/arm/sunxi.yaml
>>> +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml
>>> @@ -305,6 +305,12 @@ properties:
>>> - const: allwinner,i12-tvbox
>>> - const: allwinner,sun7i-a20
>>>
>>> + - description: ICNova A20 ADB4006
>>> + items:
>>> + - const: incircuit,icnova-a20-adb4006
>>> + - const: incircuit,icnova-a20
>>> + - const: allwinner,sun7i-a20
>>> +
>>> - description: ICNova A20 SWAC
>>> items:
>>> - const: incircuit,icnova-a20-swac
>>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>>> index 3cc32722c394..b6b408417261 100644
>>> --- a/arch/arm/boot/dts/Makefile
>>> +++ b/arch/arm/boot/dts/Makefile
>>> @@ -1321,6 +1321,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
>>> sun7i-a20-hummingbird.dtb \
>>> sun7i-a20-itead-ibox.dtb \
>>> sun7i-a20-i12-tvbox.dtb \
>>> + sun7i-a20-icnova-a20-adb4006.dtb \
>>> sun7i-a20-icnova-swac.dtb \
>>> sun7i-a20-lamobo-r1.dtb \
>>> sun7i-a20-linutronix-testbox-v2.dtb \
>>> diff --git a/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>>> new file mode 100644
>>> index 000000000000..c1606c085e4e
>>> --- /dev/null
>>> +++ b/arch/arm/boot/dts/sun7i-a20-icnova-a20-adb4006.dts
>>> @@ -0,0 +1,137 @@
>>> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
>>
>> Unusual license. Are you sure you are ok with GPLv5.0?
>
> Is it really unusual? This is literally the most commonly used dual license
> for DTs, grep counts 252 users in arm and 573 users in arm64.
>

No, the most commonly used is GPL-2.0 (optionally OR MIT/BSD). GPLv3 and
later appear, but it is actually weird to use it for kernel DTS where in
general we said no to GPLv3.

And my question is not the only one... just grep from responses from
other maintainers.

Best regards,
Krzysztof