Skip to contentSkip to conversation

ARM: sun7i: dt: Add new Olimex A20 EVB device

PATCH Superseded codekipper at gmail.com 2 participants 4 messages Sep 23, 2015 – Sep 25, 2015

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ARM: sun7i: dt: Add new Olimex A20 EVB device

From: Marcus Cooper <[email protected]>

The A20-SOM-EVB is a reference design of a 2-layer board for the A20-SOM.
It expands the features of A20-SOM by adding VGA connector, HDMI connector, audio In/Out, LCD connector, 2 Mpix camera, gigabit Ethernet, SATA, USB-OTG and 2 USB hosts.

---
Changes since v2:
- changed dcdc2 to have max voltage of 1.4V
Changes since v1:
- renamed dts from sun7i-a20-olinuxino-evb to sun7i-a20-olimex-som-evb
- added "axp209 dtsi"
- change regulator settings

---
 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts | 216 +++++++++++++++++++++++++
 2 files changed, 217 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
arch/arm/boot/dts/Makefile +1 -0
index 359dcb5..8419a3e 100644
@@ -617,6 +617,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
 	sun7i-a20-i12-tvbox.dtb \
 	sun7i-a20-m3.dtb \
 	sun7i-a20-mk808c.dtb \
+	sun7i-a20-olimex-som-evb.dtb \
 	sun7i-a20-olinuxino-lime.dtb \
 	sun7i-a20-olinuxino-lime2.dtb \
 	sun7i-a20-olinuxino-micro.dtb \
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +216 -0

216 lines not on this page · raw message

Signature · 1 line
2.4.6
#1 lore raw

PATCH v3 1/1 ARM: sun7i: dt: Add new Olimex A20 EVB device

Quoted 111 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

The A20-SOM-EVB is a reference design of a 2-layer board for the A20-SOM.
It expands the features of A20-SOM by adding VGA connector, HDMI connector, audio In/Out, LCD connector, 2 Mpix camera, gigabit Ethernet, SATA, USB-OTG and 2 USB hosts.

---
Changes since v2:
- changed dcdc2 to have max voltage of 1.4V
Changes since v1:
- renamed dts from sun7i-a20-olinuxino-evb to sun7i-a20-olimex-som-evb
- added "axp209 dtsi"
- change regulator settings

---
 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts | 216 +++++++++++++++++++++++++
 2 files changed, 217 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
arch/arm/boot/dts/Makefile +1 -0
index 359dcb5..8419a3e 100644
@@ -617,6 +617,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
 	sun7i-a20-i12-tvbox.dtb \
 	sun7i-a20-m3.dtb \
 	sun7i-a20-mk808c.dtb \
+	sun7i-a20-olimex-som-evb.dtb \
 	sun7i-a20-olinuxino-lime.dtb \
 	sun7i-a20-olinuxino-lime2.dtb \
 	sun7i-a20-olinuxino-micro.dtb \
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +71 -0
new file mode 100644
index 0000000..41b4b4a
@@ -0,0 +1,216 @@
+/*
+ * Copyright 2015 - Marcus Cooper <[email protected]>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+	model = "Olimex A20-Olimex-SOM-EVB";
+	compatible = "olimex,a20-olimex-som-evb", "allwinner,sun7i-a20";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins_olimex_som_evb>;
+
+		green {
+			label = "a20-olimex-som-evb:green:usr";
+			gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+			default-state = "on";

arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts line 81

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +10 -0
+		};
+	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};

Are you using that regulator somewhere?

Quoted 34 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +34 -0
+};
+
+&ahci {
+	target-supply = <&reg_ahci_5v>;
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ehci1 {
+	status = "okay";
+};
+
+&gmac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac_pins_rgmii_a>;
+	phy = <&phy1>;
+	phy-mode = "rgmii";
+	status = "okay";
+
+	phy1: ethernet-phy at 1 {
+		reg = <1>;
+	};
+};
+
+&i2c0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c0_pins_a>;
+	status = "okay";
+
+	axp209: pmic at 34 {
+		reg = <0x34>;

arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts line 125

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +10 -0
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pins_a>;
+	status = "okay";
+};

Having aliases for these two would be great to make sure that the bus number is fixed.

Quoted 93 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +90 -0
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+	vmmc-supply = <&reg_vcc3v3>;
+	bus-width = <4>;
+	cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+	cd-inverted;
+	status = "okay";
+};
+
+&ohci0 {
+	status = "okay";
+};
+
+&ohci1 {
+	status = "okay";
+};
+
+&pio {
+	ahci_pwr_pin_olimex_som_evb: ahci_pwr_pin at 1 {
+		allwinner,pins = "PC3";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+
+	led_pins_olimex_som_evb: led_pins at 0 {
+		allwinner,pins = "PH2";
+		allwinner,function = "gpio_out";
+		allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	};
+};
+
+&reg_ahci_5v {
+	pinctrl-0 = <&ahci_pwr_pin_olimex_som_evb>;
+	gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+};
+
+#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";
+};
+
+&reg_usb0_vbus {
+	status = "okay";
+};
+
+&reg_usb1_vbus {
+	status = "okay";
+};
+
+&reg_usb2_vbus {
+	status = "okay";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins_a>;
+	status = "okay";
+};
+
+&usbphy {
+	usb1_vbus-supply = <&reg_usb1_vbus>;
+	usb2_vbus-supply = <&reg_usb2_vbus>;
+	status = "okay";
+};
Signature · 1 line
2.4.6

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150925/888c8599/attachment-0001.sig>
#2 lore raw

PATCH v3 1/1 ARM: sun7i: dt: Add new Olimex A20 EVB device

Quoted 116 lines · Maxime Ripard
Quoted 115 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

The A20-SOM-EVB is a reference design of a 2-layer board for the A20-SOM.
It expands the features of A20-SOM by adding VGA connector, HDMI connector, audio In/Out, LCD connector, 2 Mpix camera, gigabit Ethernet, SATA, USB-OTG and 2 USB hosts.

---
Changes since v2:
- changed dcdc2 to have max voltage of 1.4V
Changes since v1:
- renamed dts from sun7i-a20-olinuxino-evb to sun7i-a20-olimex-som-evb
- added "axp209 dtsi"
- change regulator settings

---
 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts | 216 +++++++++++++++++++++++++
 2 files changed, 217 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
arch/arm/boot/dts/Makefile +1 -0
index 359dcb5..8419a3e 100644
@@ -617,6 +617,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
      sun7i-a20-i12-tvbox.dtb \
      sun7i-a20-m3.dtb \
      sun7i-a20-mk808c.dtb \
+     sun7i-a20-olimex-som-evb.dtb \
      sun7i-a20-olinuxino-lime.dtb \
      sun7i-a20-olinuxino-lime2.dtb \
      sun7i-a20-olinuxino-micro.dtb \
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +75 -0
new file mode 100644
index 0000000..41b4b4a
@@ -0,0 +1,216 @@
+/*
+ * Copyright 2015 - Marcus Cooper <[email protected]>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+     model = "Olimex A20-Olimex-SOM-EVB";
+     compatible = "olimex,a20-olimex-som-evb", "allwinner,sun7i-a20";
+
+     aliases {
+             serial0 = &uart0;
+     };
+
+     chosen {
+             stdout-path = "serial0:115200n8";
+     };
+
+     leds {
+             compatible = "gpio-leds";
+             pinctrl-names = "default";
+             pinctrl-0 = <&led_pins_olimex_som_evb>;
+
+             green {
+                     label = "a20-olimex-som-evb:green:usr";
+                     gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+                     default-state = "on";
+             };
+     };
+
+     reg_axp_ipsout: axp_ipsout {
Quoted 8 lines

arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts line 81

Quoted 6 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +6 -0
+             compatible = "regulator-fixed";
+             regulator-name = "axp-ipsout";
+             regulator-min-microvolt = <5000000>;
+             regulator-max-microvolt = <5000000>;
+             regulator-always-on;
+     };

Are you using that regulator somewhere?

Nope....seems only to be in this and the Lime2 dts which I'm copied for this patch. Guess it's safe for me to remove.

Quoted 40 lines
Quoted 40 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +39 -0
+};
+
+&ahci {
+     target-supply = <&reg_ahci_5v>;
+     status = "okay";
+};
+
+&ehci0 {
+     status = "okay";
+};
+
+&ehci1 {
+     status = "okay";
+};
+
+&gmac {
+     pinctrl-names = "default";
+     pinctrl-0 = <&gmac_pins_rgmii_a>;
+     phy = <&phy1>;
+     phy-mode = "rgmii";
+     status = "okay";
+
+     phy1: ethernet-phy at 1 {
+             reg = <1>;
+     };
+};
+
+&i2c0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&i2c0_pins_a>;
+     status = "okay";
+
+     axp209: pmic at 34 {
+             reg = <0x34>;
+             interrupt-parent = <&nmi_intc>;
+             interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+     };
+};
+
Quoted 8 lines

arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts line 125

Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +5 -0
+&i2c1 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&i2c1_pins_a>;
+     status = "okay";
+};

Having aliases for these two would be great to make sure that the bus number is fixed.

OK
CK

Quoted 102 lines
Quoted 92 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +90 -1
+&mmc0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+     vmmc-supply = <&reg_vcc3v3>;
+     bus-width = <4>;
+     cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+     cd-inverted;
+     status = "okay";
+};
+
+&ohci0 {
+     status = "okay";
+};
+
+&ohci1 {
+     status = "okay";
+};
+
+&pio {
+     ahci_pwr_pin_olimex_som_evb: ahci_pwr_pin at 1 {
+             allwinner,pins = "PC3";
+             allwinner,function = "gpio_out";
+             allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+             allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+     };
+
+     led_pins_olimex_som_evb: led_pins at 0 {
+             allwinner,pins = "PH2";
+             allwinner,function = "gpio_out";
+             allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+             allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+     };
+};
+
+&reg_ahci_5v {
+     pinctrl-0 = <&ahci_pwr_pin_olimex_som_evb>;
+     gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
+     status = "okay";
+};
+
+#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";
+};
+
+&reg_usb0_vbus {
+     status = "okay";
+};
+
+&reg_usb1_vbus {
+     status = "okay";
+};
+
+&reg_usb2_vbus {
+     status = "okay";
+};
+
+&uart0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&uart0_pins_a>;
+     status = "okay";
+};
+
+&usbphy {
+     usb1_vbus-supply = <&reg_usb1_vbus>;
+     usb2_vbus-supply = <&reg_usb2_vbus>;
+     status = "okay";
+};
--
Quoted 2 lines

2.4.6

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

#3 lore raw

PATCH v3 1/1 ARM: sun7i: dt: Add new Olimex A20 EVB device

In reply to Maxime Ripard
Quoted 164 lines · Maxime Ripard
Quoted 111 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

The A20-SOM-EVB is a reference design of a 2-layer board for the A20-SOM.
It expands the features of A20-SOM by adding VGA connector, HDMI connector, audio In/Out, LCD connector, 2 Mpix camera, gigabit Ethernet, SATA, USB-OTG and 2 USB hosts.

---
Changes since v2:
- changed dcdc2 to have max voltage of 1.4V
Changes since v1:
- renamed dts from sun7i-a20-olinuxino-evb to sun7i-a20-olimex-som-evb
- added "axp209 dtsi"
- change regulator settings

---
 arch/arm/boot/dts/Makefile                     |   1 +
 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts | 216 +++++++++++++++++++++++++
 2 files changed, 217 insertions(+)
 create mode 100644 arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
arch/arm/boot/dts/Makefile +1 -0
index 359dcb5..8419a3e 100644
@@ -617,6 +617,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \
      sun7i-a20-i12-tvbox.dtb \
      sun7i-a20-m3.dtb \
      sun7i-a20-mk808c.dtb \
+     sun7i-a20-olimex-som-evb.dtb \
      sun7i-a20-olinuxino-lime.dtb \
      sun7i-a20-olinuxino-lime2.dtb \
      sun7i-a20-olinuxino-micro.dtb \
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +71 -0
new file mode 100644
index 0000000..41b4b4a
@@ -0,0 +1,216 @@
+/*
+ * Copyright 2015 - Marcus Cooper <[email protected]>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun7i-a20.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+     model = "Olimex A20-Olimex-SOM-EVB";
+     compatible = "olimex,a20-olimex-som-evb", "allwinner,sun7i-a20";
+
+     aliases {
+             serial0 = &uart0;
+     };
+
+     chosen {
+             stdout-path = "serial0:115200n8";
+     };
+
+     leds {
+             compatible = "gpio-leds";
+             pinctrl-names = "default";
+             pinctrl-0 = <&led_pins_olimex_som_evb>;
+
+             green {
+                     label = "a20-olimex-som-evb:green:usr";
+                     gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
+                     default-state = "on";

arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts line 81

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +10 -0
+             };
+     };
+
+     reg_axp_ipsout: axp_ipsout {
+             compatible = "regulator-fixed";
+             regulator-name = "axp-ipsout";
+             regulator-min-microvolt = <5000000>;
+             regulator-max-microvolt = <5000000>;
+             regulator-always-on;
+     };

Are you using that regulator somewhere?

Quoted 39 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +39 -0
+};
+
+&ahci {
+     target-supply = <&reg_ahci_5v>;
+     status = "okay";
+};
+
+&ehci0 {
+     status = "okay";
+};
+
+&ehci1 {
+     status = "okay";
+};
+
+&gmac {
+     pinctrl-names = "default";
+     pinctrl-0 = <&gmac_pins_rgmii_a>;
+     phy = <&phy1>;
+     phy-mode = "rgmii";
+     status = "okay";
+
+     phy1: ethernet-phy at 1 {
+             reg = <1>;
+     };
+};
+
+&i2c0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&i2c0_pins_a>;
+     status = "okay";
+
+     axp209: pmic at 34 {
+             reg = <0x34>;
+             interrupt-parent = <&nmi_intc>;
+             interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+     };
+};
+
Quoted 8 lines

arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts line 125

Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +5 -0
+&i2c1 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&i2c1_pins_a>;
+     status = "okay";
+};

Having aliases for these two would be great to make sure that the bus number is fixed.

Maybe I should remove this from the dts for now. I do use it for controlling my i2s device but those changes would never be upstreamed. What do you think?
CK

Quoted 102 lines
Quoted 92 lines
arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts new file +90 -1
+&mmc0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+     vmmc-supply = <&reg_vcc3v3>;
+     bus-width = <4>;
+     cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+     cd-inverted;
+     status = "okay";
+};
+
+&ohci0 {
+     status = "okay";
+};
+
+&ohci1 {
+     status = "okay";
+};
+
+&pio {
+     ahci_pwr_pin_olimex_som_evb: ahci_pwr_pin at 1 {
+             allwinner,pins = "PC3";
+             allwinner,function = "gpio_out";
+             allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+             allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+     };
+
+     led_pins_olimex_som_evb: led_pins at 0 {
+             allwinner,pins = "PH2";
+             allwinner,function = "gpio_out";
+             allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+             allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+     };
+};
+
+&reg_ahci_5v {
+     pinctrl-0 = <&ahci_pwr_pin_olimex_som_evb>;
+     gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
+     status = "okay";
+};
+
+#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";
+};
+
+&reg_usb0_vbus {
+     status = "okay";
+};
+
+&reg_usb1_vbus {
+     status = "okay";
+};
+
+&reg_usb2_vbus {
+     status = "okay";
+};
+
+&uart0 {
+     pinctrl-names = "default";
+     pinctrl-0 = <&uart0_pins_a>;
+     status = "okay";
+};
+
+&usbphy {
+     usb1_vbus-supply = <&reg_usb1_vbus>;
+     usb2_vbus-supply = <&reg_usb2_vbus>;
+     status = "okay";
+};
--
Quoted 2 lines

2.4.6

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com