Skip to contentSkip to conversation

sunxi: sync H3, H5, A64 DTs from mainline Linux

PATCH New Andre Przywara 2 participants 8 messages Jul 4, 2018 – Jul 16, 2018

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v7 cover sunxi: sync H3, H5, A64 DTs from mainline Linux

This is an updated version of the series which brings the exact mainline Linux device tree files for various Allwinner boards into U-Boot. Apart from using the usually more correct reference DT files, this offers the big benefit of being able to use U-Boot's DT copy for directly passing it to the kernel. This avoids to actually load a .dtb file from somewhere, and allows seamless and automatic UEFI booting, so distribution installer images should just work (TM).

This covers the ARMv8 SoCs (H5, A64), but also all boards with the H3, as this is somewhat married to the H5 and can only be updated together. The H3 and H5 DT files have diverged quite a bit, but as U-Boot's own usage of the DT is (yet) quite limited, there should be no regressions. The patches are split to first update the SoC .dtsi file, then the board .dts files in a second patch. They are grouped to handle the A64 first, then the H5 and H3. I put the respective kernel commit IDs in the commit messages.
Patch 6 brings in the mainline DT for the SoPine baseboard, for which we didn't have a separate .dts in U-Boot so far.

This is based on origin/master, and requires the USB shutdown fix. Please let me know what I should it base it against, maybe closer to the time we actually want to merge this (to avoid playing cat and mouse here).

Maxime, I kept you Acked-by: from the previous posts, as I literally just updated to the latest Linux master, which went through your review anyway. Hope that's OK for you.

Cheers,
Andre.

Changelog v6 .. v7:
- drop Pine64-LTS DT (will send it to Linux first)
- update to Linux v4.18-rc3

Changelog v5 .. v6:
- bring back DT update patches
- update to Linux v4.17-rc5

Changelog v4 .. v5:
- drop Linux DT update patches for now
- fix minor checkpatch complaints

Changelog v3 .. v4:
- remove MMC environment for all Allwinner boards (including 32 bit ones)
- keep MMC environment offset to the old values
- drop DT adjustments to use fixed MMC regulator

Changelog v2 .. v3:
01: added, was on the list before
02: drop redundant H5 line
03-08: unchanged
09-20: added

Changelog v1 .. v2:
01, 02, 03: unchanged
04, 05, 06, 07: added

Andre Przywara (6):
sunxi: DT: A64: update device tree file for Allwinner A64 SoC
sunxi: DT: A64: update board .dts files from Linux
sunxi: DT: update device tree files for Allwinner H3 and H5 SoCs
sunxi: DT: H5: update board .dts files from Linux
sunxi: DT: H3: update board .dts files from Linux
sunxi: DT: A64: add proper SoPine baseboard device tree

 arch/arm/dts/Makefile                           |   3 +-
 arch/arm/dts/axp803.dtsi                        | 155 +++++
 arch/arm/dts/sun50i-a64-bananapi-m64.dts        | 195 +++++-
 arch/arm/dts/sun50i-a64-nanopi-a64.dts          | 111 ++-
 arch/arm/dts/sun50i-a64-olinuxino.dts           | 153 ++++-
 arch/arm/dts/sun50i-a64-orangepi-win.dts        | 135 +++-
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi |  59 --
 arch/arm/dts/sun50i-a64-pine64-plus.dts         |  17 +-
 arch/arm/dts/sun50i-a64-pine64.dts              | 186 ++++-
 arch/arm/dts/sun50i-a64-sopine-baseboard.dts    | 150 +++++
 arch/arm/dts/sun50i-a64-sopine.dtsi             | 142 ++++
 arch/arm/dts/sun50i-a64.dtsi                    | 305 ++++++++-
 arch/arm/dts/sun50i-h5-libretech-all-h3-cc.dts  |   5 +-
 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts     | 122 +++-
 arch/arm/dts/sun50i-h5-nanopi-neo2.dts          |  91 ++-
 arch/arm/dts/sun50i-h5-orangepi-pc2.dts         | 151 ++++-
 arch/arm/dts/sun50i-h5-orangepi-prime.dts       | 176 ++++-
 arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts  |  64 +-
 arch/arm/dts/sun50i-h5.dtsi                     |  38 +-
 arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts    |  55 +-
 arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts      |  96 ++-
 arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts   |   3 +-
 arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts        |  78 +++
 arch/arm/dts/sun8i-h3-nanopi-m1.dts             |  42 ++
 arch/arm/dts/sun8i-h3-nanopi-neo-air.dts        |  28 +-
 arch/arm/dts/sun8i-h3-nanopi-neo.dts            |  17 +
 arch/arm/dts/sun8i-h3-nanopi.dtsi               |  13 +-
 arch/arm/dts/sun8i-h3-orangepi-2.dts            |  92 ++-
 arch/arm/dts/sun8i-h3-orangepi-lite.dts         |  57 +-
 arch/arm/dts/sun8i-h3-orangepi-one.dts          | 116 +++-
 arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts      |  11 +-
 arch/arm/dts/sun8i-h3-orangepi-pc.dts           | 141 +++-
 arch/arm/dts/sun8i-h3-orangepi-plus.dts         |  29 +-
 arch/arm/dts/sun8i-h3-orangepi-plus2e.dts       |  15 +-
 arch/arm/dts/sun8i-h3.dtsi                      | 602 +++--------------
 arch/arm/dts/sunxi-h3-h5.dtsi                   | 860 ++++++++++++++++++++++++
 arch/arm/dts/sunxi-libretech-all-h3-cc.dtsi     |   2 -
 configs/sopine_baseboard_defconfig              |   2 +-
 include/dt-bindings/clock/sun8i-de2.h           |  18 +
 include/dt-bindings/clock/sun8i-r-ccu.h         |  59 ++
 include/dt-bindings/reset/sun8i-de2.h           |  14 +
 include/dt-bindings/reset/sun8i-r-ccu.h         |  53 ++
 42 files changed, 3741 insertions(+), 920 deletions(-)
 create mode 100644 arch/arm/dts/axp803.dtsi
 delete mode 100644 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi
 create mode 100644 arch/arm/dts/sun50i-a64-sopine-baseboard.dts
 create mode 100644 arch/arm/dts/sun50i-a64-sopine.dtsi
 create mode 100644 arch/arm/dts/sunxi-h3-h5.dtsi
 create mode 100644 include/dt-bindings/clock/sun8i-de2.h
 create mode 100644 include/dt-bindings/clock/sun8i-r-ccu.h
 create mode 100644 include/dt-bindings/reset/sun8i-de2.h
 create mode 100644 include/dt-bindings/reset/sun8i-r-ccu.h
Signature · 1 line
2.14.4
#1 lore raw

PATCH v7 1/6 sunxi: DT: A64: update device tree file for Allwinner A64 SoC

Updates the device tree file from the the Linux tree as of v4.18-rc3, exactly Linux commit:
commit c1cff65f9b16b31e731e2e75bbe06638c86e1996

Author: Harald Geyer <[email protected]>
Date:   Thu Mar 15 16:25:08 2018 +0000

arm64: dts: allwinner: a64: add simplefb for A64 SoC

This also pulls in the newly required include files for the clock and reset bindings, also removes the now redundant part from our *-u-boot.dtsi overlay file.
I kept the PWM node from U-Boot, as we recently gained this explicitly for U-Boot's own usage and I don't want to regress here. This node is in the queue for mainline Linux already, so the next sync will make it all equal again.

---
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi |  61 +----
 arch/arm/dts/sun50i-a64.dtsi                    | 305 +++++++++++++++++++++---
 include/dt-bindings/clock/sun8i-r-ccu.h         |  59 +++++
 include/dt-bindings/reset/sun8i-r-ccu.h         |  53 ++++
 4 files changed, 399 insertions(+), 79 deletions(-)
 create mode 100644 include/dt-bindings/clock/sun8i-r-ccu.h
 create mode 100644 include/dt-bindings/reset/sun8i-r-ccu.h
arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi +11 -50
index 32a263ce3d..1b8aa3d8dc 100644
@@ -2,58 +2,19 @@
 	aliases {
 		ethernet0 = &emac;
 	};
-
-	soc {
-		syscon: syscon at 1c00000 {
-			compatible = "allwinner,sun50i-a64-system-controller",
-				     "syscon";
-			reg = <0x01c00000 0x1000>;
-		};
-
-		emac: ethernet at 1c30000 {
-			compatible = "allwinner,sun50i-a64-emac";
-			syscon = <&syscon>;
-			reg = <0x01c30000 0x10000>;
-			interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names = "macirq";
-			resets = <&ccu RST_BUS_EMAC>;
-			reset-names = "stmmaceth";
-			clocks = <&ccu CLK_BUS_EMAC>;
-			clock-names = "stmmaceth";
-			#address-cells = <1>;
-			#size-cells = <0>;
-			pinctrl-names = "default";
-			pinctrl-0 = <&rgmii_pins>;
-			phy-mode = "rgmii";
-			phy-handle = <&ext_rgmii_phy>;
-			status = "okay";
-
-			mdio: mdio {
-				compatible = "snps,dwmac-mdio";
-				#address-cells = <1>;
-				#size-cells = <0>;
-				ext_rgmii_phy: ethernet-phy at 1 {
-					compatible = "ethernet-phy-ieee802.3-c22";
-					reg = <1>;
-				};
-			};
-		};
-	};
 };
 
-&pio {
-	rmii_pins: rmii_pins {
-		pins = "PD10", "PD11", "PD13", "PD14", "PD17",
-		       "PD18", "PD19", "PD20", "PD22", "PD23";
-		function = "emac";
-		drive-strength = <40>;
-	};
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	status = "okay";
+};
 
-	rgmii_pins: rgmii_pins {
-		pins = "PD8", "PD9", "PD10", "PD11", "PD12",
-		       "PD13", "PD15", "PD16", "PD17", "PD18",
-		       "PD19", "PD20", "PD21", "PD22", "PD23";
-		function = "emac";
-		drive-strength = <40>;
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
 	};
 };
arch/arm/dts/sun50i-a64.dtsi +276 -29

463 lines not on this page · raw message

include/dt-bindings/clock/sun8i-r-ccu.h new file +59 -0

59 lines not on this page · raw message

include/dt-bindings/reset/sun8i-r-ccu.h new file +53 -0

53 lines not on this page · raw message

Signature · 1 line
2.14.4
#2 lore raw

PATCH v7 2/6 sunxi: DT: A64: update board .dts files from Linux

In reply to Andre Przywara

Update the .dts files for the various boards with an Allwinner A64 SoC. This is as of v4.18-rc3, exactly Linux commit:
commit 818668055c9d588c9a9d151e3b258ed1adacba0b

Author: Jagan Teki <[email protected]>
Date:   Mon Apr 23 12:02:39 2018 +0530

arm64: dts: allwinner: a64: bananapi-m64: add usb otg

It updates the existing DT files, adds the newly added axp803.dtsi and removes our temporary kludge file to get Ethernet support in U-Boot. I left the amarula-relic alone, as this DT has not reached mainline yet. The changes are not critical anyway, and the next sync will fix this.

---
 arch/arm/dts/axp803.dtsi                        | 155 +++++++++++++++++++
 arch/arm/dts/sun50i-a64-bananapi-m64.dts        | 195 ++++++++++++++++++++++--
 arch/arm/dts/sun50i-a64-nanopi-a64.dts          | 111 ++++++++++++--
 arch/arm/dts/sun50i-a64-olinuxino.dts           | 153 ++++++++++++++++++-
 arch/arm/dts/sun50i-a64-orangepi-win.dts        | 135 ++++++++++++++--
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi |  20 ---
 arch/arm/dts/sun50i-a64-pine64-plus.dts         |  17 ++-
 arch/arm/dts/sun50i-a64-pine64.dts              | 186 ++++++++++++++++++++--
 8 files changed, 900 insertions(+), 72 deletions(-)
 create mode 100644 arch/arm/dts/axp803.dtsi
 delete mode 100644 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi
arch/arm/dts/axp803.dtsi new file +155 -0
new file mode 100644
index 0000000000..e5eae8bafc
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2017 Icenowy Zheng <[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.
+ */
+
+/*
+ * AXP803 Integrated Power Management Chip
+ * http://files.pine64.org/doc/datasheet/pine64/AXP803_Datasheet_V1.0.pdf
+ */
+
+&axp803 {
+	interrupt-controller;
+	#interrupt-cells = <1>;
+
+	regulators {
+		/* Default work frequency for buck regulators */
+		x-powers,dcdc-freq = <3000>;
+
+		reg_aldo1: aldo1 {
+			regulator-name = "aldo1";
+		};
+
+		reg_aldo2: aldo2 {
+			regulator-name = "aldo2";
+		};
+
+		reg_aldo3: aldo3 {
+			regulator-name = "aldo3";
+		};
+
+		reg_dc1sw: dc1sw {
+			regulator-name = "dc1sw";
+		};
+
+		reg_dcdc1: dcdc1 {
+			regulator-name = "dcdc1";
+		};
+
+		reg_dcdc2: dcdc2 {
+			regulator-name = "dcdc2";
+		};
+
+		reg_dcdc3: dcdc3 {
+			regulator-name = "dcdc3";
+		};
+
+		reg_dcdc4: dcdc4 {
+			regulator-name = "dcdc4";
+		};
+
+		reg_dcdc5: dcdc5 {
+			regulator-name = "dcdc5";
+		};
+
+		reg_dcdc6: dcdc6 {
+			regulator-name = "dcdc6";
+		};
+
+		reg_dldo1: dldo1 {
+			regulator-name = "dldo1";
+		};
+
+		reg_dldo2: dldo2 {
+			regulator-name = "dldo2";
+		};
+
+		reg_dldo3: dldo3 {
+			regulator-name = "dldo3";
+		};
+
+		reg_dldo4: dldo4 {
+			regulator-name = "dldo4";
+		};
+
+		reg_eldo1: eldo1 {
+			regulator-name = "eldo1";
+		};
+
+		reg_eldo2: eldo2 {
+			regulator-name = "eldo2";
+		};
+
+		reg_eldo3: eldo3 {
+			regulator-name = "eldo3";
+		};
+
+		reg_fldo1: fldo1 {
+			regulator-name = "fldo1";
+		};
+
+		reg_fldo2: fldo2 {
+			regulator-name = "fldo2";
+		};
+
+		reg_ldo_io0: ldo-io0 {
+			regulator-name = "ldo-io0";
+			status = "disabled";
+		};
+
+		reg_ldo_io1: ldo-io1 {
+			regulator-name = "ldo-io1";
+			status = "disabled";
+		};
+
+		reg_rtc_ldo: rtc-ldo {
+			/* RTC_LDO is a fixed, always-on regulator */
+			regulator-always-on;
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+			regulator-name = "rtc-ldo";
+		};
+
+		reg_drivevbus: drivevbus {
+			regulator-name = "drivevbus";
+			status = "disabled";
+		};
+	};
+};
arch/arm/dts/sun50i-a64-bananapi-m64.dts +184 -11

252 lines not on this page · raw message

arch/arm/dts/sun50i-a64-nanopi-a64.dts +101 -10

129 lines not on this page · raw message

arch/arm/dts/sun50i-a64-olinuxino.dts +145 -8

170 lines not on this page · raw message

arch/arm/dts/sun50i-a64-orangepi-win.dts +122 -13

157 lines not on this page · raw message

arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi deleted +0 -20
deleted file mode 100644
index 1b8aa3d8dc..0000000000
@@ -1,20 +0,0 @@
-/ {
-	aliases {
-		ethernet0 = &emac;
-	};
-};
-
-&emac {
-	pinctrl-names = "default";
-	pinctrl-0 = <&rgmii_pins>;
-	phy-mode = "rgmii";
-	phy-handle = <&ext_rgmii_phy>;
-	status = "okay";
-};
-
-&mdio {
-	ext_rgmii_phy: ethernet-phy at 1 {
-		compatible = "ethernet-phy-ieee802.3-c22";
-		reg = <1>;
-	};
-};
arch/arm/dts/sun50i-a64-pine64-plus.dts +16 -1
index 790d14daaa..24f1aac366 100644
@@ -46,5 +46,20 @@
 	model = "Pine64+";
 	compatible = "pine64,pine64-plus", "allwinner,sun50i-a64";
 
-	/* TODO: Camera, Ethernet PHY, touchscreen, etc. */
+	/* TODO: Camera, touchscreen, etc. */
+};
+
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii_pins>;
+	phy-mode = "rgmii";
+	phy-handle = <&ext_rgmii_phy>;
+	status = "okay";
+};
+
+&mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
 };
arch/arm/dts/sun50i-a64-pine64.dts +177 -9

229 lines not on this page · raw message

Signature · 1 line
2.14.4
#3 lore raw

PATCH v7 3/6 sunxi: DT: update device tree files for Allwinner H3 and H5 SoCs

In reply to Andre Przywara

Update the device tree files from the Linux tree as of v4.18-rc3, exactly Linux commit:
commit 55c5ba5e49a0a124ed416880e8227b493474495e

Author: Chen-Yu Tsai <[email protected]>
Date:   Tue Apr 24 19:34:22 2018 +0800

arm64: dts: allwinner: h5: Add cpu0 label for first cpu

Since the H3 and H5 are very similar (aside from the actual ARM cores), they share most the SoC .dtsi and thus have to be updated together. One tiny change is the removal of the "arm/" prefix from the include path in the sun50i-h5.dtsi, which is needed because we don't share the same sophisticated DT directory layout of Linux.
Also we need to fix up the board .dts files already, since the .dtsi removes some pins, so the .dts can't reference them anymore. This is to maintain bisectability.

---
 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts    |   2 -
 arch/arm/dts/sun50i-h5-nanopi-neo2.dts         |   2 -
 arch/arm/dts/sun50i-h5-orangepi-pc2.dts        |   2 -
 arch/arm/dts/sun50i-h5-orangepi-prime.dts      |   2 -
 arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts |   2 -
 arch/arm/dts/sun50i-h5.dtsi                    |  38 +-
 arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts   |   4 -
 arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts     |   6 +-
 arch/arm/dts/sun8i-h3-nanopi-neo-air.dts       |   2 -
 arch/arm/dts/sun8i-h3-nanopi.dtsi              |   2 -
 arch/arm/dts/sun8i-h3-orangepi-2.dts           |   4 -
 arch/arm/dts/sun8i-h3-orangepi-lite.dts        |   4 -
 arch/arm/dts/sun8i-h3-orangepi-one.dts         |   2 -
 arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts     |   2 -
 arch/arm/dts/sun8i-h3-orangepi-pc.dts          |   2 -
 arch/arm/dts/sun8i-h3.dtsi                     | 602 +++--------------
 arch/arm/dts/sunxi-h3-h5.dtsi                  | 860 +++++++++++++++++++++++++
 arch/arm/dts/sunxi-libretech-all-h3-cc.dtsi    |   2 -
 include/dt-bindings/clock/sun8i-de2.h          |  18 +
 include/dt-bindings/reset/sun8i-de2.h          |  14 +
 20 files changed, 1018 insertions(+), 554 deletions(-)
 create mode 100644 arch/arm/dts/sunxi-h3-h5.dtsi
 create mode 100644 include/dt-bindings/clock/sun8i-de2.h
 create mode 100644 include/dt-bindings/reset/sun8i-de2.h
arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts +0 -2
index f1406c224b..8b509c94c5 100644
@@ -72,8 +72,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
arch/arm/dts/sun50i-h5-nanopi-neo2.dts +0 -2
index c08af7881b..5e4dad7316 100644
@@ -71,8 +71,6 @@
 	compatible = "allwinner,sun50i-h5-mmc",
 		     "allwinner,sun50i-a64-mmc",
 		     "allwinner,sun5i-a13-mmc";
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
arch/arm/dts/sun50i-h5-orangepi-pc2.dts +0 -2
index a65300d5aa..92079dbfe0 100644
@@ -100,8 +100,6 @@
 	compatible = "allwinner,sun50i-h5-mmc",
 		     "allwinner,sun50i-a64-mmc",
 		     "allwinner,sun5i-a13-mmc";
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
arch/arm/dts/sun50i-h5-orangepi-prime.dts +0 -2
index 131d8058c4..540e5c7d93 100644
@@ -84,8 +84,6 @@
 	compatible = "allwinner,sun50i-h5-mmc",
 		     "allwinner,sun50i-a64-mmc",
 		     "allwinner,sun5i-a13-mmc";
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts +0 -2
index 3f4baba310..bc39abead0 100644
@@ -71,8 +71,6 @@
 	compatible = "allwinner,sun50i-h5-mmc",
 		     "allwinner,sun50i-a64-mmc",
 		     "allwinner,sun5i-a13-mmc";
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
arch/arm/dts/sun50i-h5.dtsi +30 -8
index c052f31131..4e4738cab0 100644
@@ -1,17 +1,17 @@
 /*
- * Copyright (c) 2016 ARM Ltd.
+ * Copyright (C) 2016 ARM Ltd.
  *
  * 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 library is free software; you can redistribute it and/or
+ *  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 library is distributed in the hope that it will be useful,
+ *     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.
@@ -40,24 +40,38 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "sun8i-h3.dtsi"
+#include <sunxi-h3-h5.dtsi>
 
 / {
 	cpus {
-		cpu at 0 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu at 0 {
 			compatible = "arm,cortex-a53", "arm,armv8";
+			device_type = "cpu";
+			reg = <0>;
 			enable-method = "psci";
 		};
+
 		cpu at 1 {
 			compatible = "arm,cortex-a53", "arm,armv8";
+			device_type = "cpu";
+			reg = <1>;
 			enable-method = "psci";
 		};
+
 		cpu at 2 {
 			compatible = "arm,cortex-a53", "arm,armv8";
+			device_type = "cpu";
+			reg = <2>;
 			enable-method = "psci";
 		};
+
 		cpu at 3 {
 			compatible = "arm,cortex-a53", "arm,armv8";
+			device_type = "cpu";
+			reg = <3>;
 			enable-method = "psci";
 		};
 	};
@@ -69,6 +83,14 @@
 
 	timer {
 		compatible = "arm,armv8-timer";
+		interrupts = <GIC_PPI 13
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 14
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 11
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+			     <GIC_PPI 10
+				(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
 	};
 };
 
@@ -76,8 +98,8 @@
 	compatible = "allwinner,sun50i-h5-ccu";
 };
 
-&gic {
-	compatible = "arm,gic-400";
+&display_clocks {
+	compatible = "allwinner,sun50i-h5-de2-clk";
 };
 
 &mmc0 {
@@ -104,6 +126,6 @@
 &pio {
 	interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
 		     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>,
-		   <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+		     <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
 	compatible = "allwinner,sun50i-h5-pinctrl";
 };
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +0 -4
index e0efcb3ba3..7c38264246 100644
@@ -107,8 +107,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
@@ -117,8 +115,6 @@
 };
 
 &mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_a>;
 	vmmc-supply = <&reg_vcc_wifi>;
 	mmc-pwrseq = <&wifi_pwrseq>;
 	bus-width = <4>;
arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts +1 -5
index e766aa3e2f..124ec472d1 100644
@@ -112,8 +112,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
@@ -122,8 +120,6 @@
 };
 
 &mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_a>;
 	vmmc-supply = <&reg_vcc3v3>;
 	vqmmc-supply = <&reg_vcc3v3>;
 	mmc-pwrseq = <&wifi_pwrseq>;
@@ -193,7 +189,7 @@
 
 &uart1 {
 	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins_a>;
+	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
 	status = "okay";
 };
 
arch/arm/dts/sun8i-h3-nanopi-neo-air.dts +0 -2
index 3ba081c1f5..4208a6a638 100644
@@ -76,8 +76,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
arch/arm/dts/sun8i-h3-nanopi.dtsi +0 -2
index c6decee41a..8b1b250bda 100644
@@ -97,8 +97,6 @@
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
 	cd-inverted;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	status = "okay";
 	vmmc-supply = <&reg_vcc3v3>;
 };
arch/arm/dts/sun8i-h3-orangepi-2.dts +0 -4
index d97fdacb35..b8320d2dd8 100644
@@ -124,8 +124,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
@@ -134,8 +132,6 @@
 };
 
 &mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_a>;
 	vmmc-supply = <&reg_vcc3v3>;
 	mmc-pwrseq = <&wifi_pwrseq>;
 	bus-width = <4>;
arch/arm/dts/sun8i-h3-orangepi-lite.dts +0 -4
index 1550fee1ec..b9b2b78cd9 100644
@@ -107,8 +107,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
@@ -117,8 +115,6 @@
 };
 
 &mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_a>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	non-removable;
arch/arm/dts/sun8i-h3-orangepi-one.dts +0 -2
index adab1cbfc9..16e602be1e 100644
@@ -103,8 +103,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts +0 -2
index 851fd2c2cc..4653cac49b 100644
@@ -54,8 +54,6 @@
 };
 
 &mmc1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_a>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	non-removable;
arch/arm/dts/sun8i-h3-orangepi-pc.dts +0 -2
index afba264ea5..3ae8f7c00e 100644
@@ -110,8 +110,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
arch/arm/dts/sun8i-h3.dtsi +95 -507

650 lines not on this page · raw message

arch/arm/dts/sunxi-h3-h5.dtsi new file +860 -0

860 lines not on this page · raw message

arch/arm/dts/sunxi-libretech-all-h3-cc.dtsi +0 -2
index 5d01bba180..111707cfa2 100644
@@ -131,8 +131,6 @@
 };
 
 &mmc0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc0_pins_a>;
 	vmmc-supply = <&reg_vcc_io>;
 	bus-width = <4>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
include/dt-bindings/clock/sun8i-de2.h new file +18 -0
new file mode 100644
index 0000000000..3bed63b524
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2016 Icenowy Zheng <[email protected]>
+ *
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_SUN8I_DE2_H_
+#define _DT_BINDINGS_CLOCK_SUN8I_DE2_H_
+
+#define CLK_BUS_MIXER0		0
+#define CLK_BUS_MIXER1		1
+#define CLK_BUS_WB		2
+
+#define CLK_MIXER0		6
+#define CLK_MIXER1		7
+#define CLK_WB			8
+
+#endif /* _DT_BINDINGS_CLOCK_SUN8I_DE2_H_ */
include/dt-bindings/reset/sun8i-de2.h new file +14 -0
new file mode 100644
index 0000000000..9526017432
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2016 Icenowy Zheng <[email protected]>
+ *
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+ */
+
+#ifndef _DT_BINDINGS_RESET_SUN8I_DE2_H_
+#define _DT_BINDINGS_RESET_SUN8I_DE2_H_
+
+#define RST_MIXER0	0
+#define RST_MIXER1	1
+#define RST_WB		2
+
+#endif /* _DT_BINDINGS_RESET_SUN8I_DE2_H_ */
Signature · 1 line
2.14.4
#4 lore raw

PATCH v7 4/6 sunxi: DT: H5: update board .dts files from Linux

In reply to Andre Przywara

Update the .dts file for the various boards with an Allwinner H5 SoC. This is as of v4.18-rc3, exactly Linux commit:
commit af5d05bdc99c211729cba0a3d5417bccfa308caf

Author: Neil Armstrong <[email protected]>
Date:   Tue Apr 24 13:47:14 2018 +0200

arm64: dts: allwinner: Add dts file for Libre Computer Board ALL-H3-CC H5 ver.

---
 arch/arm/dts/sun50i-h5-libretech-all-h3-cc.dts |   5 +-
 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts    | 120 +++++++++++++++--
 arch/arm/dts/sun50i-h5-nanopi-neo2.dts         |  89 ++++++++++++-
 arch/arm/dts/sun50i-h5-orangepi-pc2.dts        | 149 ++++++++++++++++++---
 arch/arm/dts/sun50i-h5-orangepi-prime.dts      | 174 ++++++++++++++++++++++---
 arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts |  62 ++++++++-
 6 files changed, 536 insertions(+), 63 deletions(-)
arch/arm/dts/sun50i-h5-libretech-all-h3-cc.dts +3 -2
index a7e53c5c26..a35f77de22 100644
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Copyright (C) 2018 Chen-Yu Tsai <[email protected]>
+ * Copyright (C) 2018 BayLibre, SAS
+ * Author: Neil Armstrong <[email protected]>
  */
 
 /dts-v1/;
 #include "sun50i-h5.dtsi"
-#include "sunxi-libretech-all-h3-cc.dtsi"
+#include <sunxi-libretech-all-h3-cc.dtsi>
 
 / {
 	model = "Libre Computer Board ALL-H3-CC H5";
arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts +111 -9

182 lines not on this page · raw message

arch/arm/dts/sun50i-h5-nanopi-neo2.dts +82 -7

139 lines not on this page · raw message

arch/arm/dts/sun50i-h5-orangepi-pc2.dts +128 -21

223 lines not on this page · raw message

arch/arm/dts/sun50i-h5-orangepi-prime.dts +156 -18

238 lines not on this page · raw message

arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts +56 -6

91 lines not on this page · raw message

Signature · 1 line
2.14.4
#5 lore raw

PATCH v7 5/6 sunxi: DT: H3: update board .dts files from Linux

In reply to Andre Przywara

Update the .dts file for the various boards with an Allwinner H3 SoC. This is as of v4.18-rc3, exactly Linux commit:
commit 721afaa2aeb860067decdddadc84ed16f42f2048 (HEAD)
Merge: 7c00e8ae041b 87815dda5593
Author: Linus Torvalds <[email protected]>
Date: Mon Jun 11 17:57:38 2018 -0700

Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

This also includes the OrangePi Zero .dts, which technically has an Allwinner H2+ SoC.

---
 arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts  |  51 +++++++++-
 arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts    |  90 +++++++++++------
 arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts |   3 +-
 arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts      |  78 +++++++++++++++
 arch/arm/dts/sun8i-h3-nanopi-m1.dts           |  42 ++++++++
 arch/arm/dts/sun8i-h3-nanopi-neo-air.dts      |  26 ++++-
 arch/arm/dts/sun8i-h3-nanopi-neo.dts          |  17 ++++
 arch/arm/dts/sun8i-h3-nanopi.dtsi             |  11 +-
 arch/arm/dts/sun8i-h3-orangepi-2.dts          |  88 +++++++++++-----
 arch/arm/dts/sun8i-h3-orangepi-lite.dts       |  53 ++++++----
 arch/arm/dts/sun8i-h3-orangepi-one.dts        | 114 +++++++++++++++++----
 arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts    |   9 +-
 arch/arm/dts/sun8i-h3-orangepi-pc.dts         | 139 +++++++++++++++++++++-----
 arch/arm/dts/sun8i-h3-orangepi-plus.dts       |  29 +++---
 arch/arm/dts/sun8i-h3-orangepi-plus2e.dts     |  15 +--
 15 files changed, 604 insertions(+), 161 deletions(-)
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +47 -4
index 7c38264246..0bc031fe4c 100644
@@ -49,7 +49,6 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Xunlong Orange Pi Zero";
@@ -58,6 +57,7 @@
 	aliases {
 		serial0 = &uart0;
 		/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
+		ethernet0 = &emac;
 		ethernet1 = &xr819;
 	};
 
@@ -92,9 +92,14 @@
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>;
+		post-power-on-delay-ms = <200>;
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &ehci1 {
 	status = "okay";
 };
@@ -109,8 +114,7 @@
 &mmc0 {
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-	cd-inverted;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
 	status = "okay";
 };
 
@@ -130,17 +134,56 @@
 	};
 };
 
+&ohci0 {
+	status = "okay";
+};
+
 &ohci1 {
 	status = "okay";
 };
 
+&spi0 {
+	/* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
+	status = "disabled";
+
+	flash at 0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "mxicy,mx25l1606e", "winbond,w25q128";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
 	status = "okay";
 };
 
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>;
+	status = "disabled";
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
+	status = "disabled";
+};
+
+&usb_otg {
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
 &usbphy {
-	/* USB VBUS is always on */
+	/*
+	 * USB Type-A port VBUS is always on. However, MicroUSB VBUS can only
+	 * power up the board; when it's used as OTG port, this VBUS is
+	 * always off even if the board is powered via GPIO pins.
+	 */
 	status = "okay";
+	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
 };
arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts +61 -29

159 lines not on this page · raw message

arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts +2 -1
index 50f2fb30d2..a8b2f0f1c1 100644
@@ -1,6 +1,7 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (C) 2017 Chen-Yu Tsai <[email protected]>
+ *
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  */
 
 /dts-v1/;
arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts +78 -0

93 lines not on this page · raw message

arch/arm/dts/sun8i-h3-nanopi-m1.dts +42 -0

54 lines not on this page · raw message

arch/arm/dts/sun8i-h3-nanopi-neo-air.dts +23 -3
index 4208a6a638..6246d3eff3 100644
@@ -45,7 +45,6 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "FriendlyARM NanoPi NEO Air";
@@ -73,16 +72,37 @@
 			gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
 		};
 	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+	};
 };
 
 &mmc0 {
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-	cd-inverted;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
 	status = "okay";
 };
 
+&mmc1 {
+	vmmc-supply = <&reg_vcc3v3>;
+	vqmmc-supply = <&reg_vcc3v3>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	brcmf: bcrmf at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+		interrupt-parent = <&pio>;
+		interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
+		interrupt-names = "host-wake";
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
arch/arm/dts/sun8i-h3-nanopi-neo.dts +17 -0
index 78f6c24952..9f33f6fae5 100644
@@ -47,9 +47,26 @@
 	compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &emac {
 	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
 	allwinner,leds-active-low;
 	status = "okay";
 };
+
+&ohci0 {
+	status = "okay";
+};
+
+&usb_otg {
+	status = "okay";
+	dr_mode = "peripheral";
+};
+
+&usbphy {
+	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+};
arch/arm/dts/sun8i-h3-nanopi.dtsi +5 -6
index 8b1b250bda..f110ee3822 100644
@@ -81,7 +81,7 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&sw_r_npi>;
 
-		k1 at 0 {
+		k1 {
 			label = "k1";
 			linux,code = <KEY_POWER>;
 			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
@@ -95,8 +95,7 @@
 
 &mmc0 {
 	bus-width = <4>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-	cd-inverted;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
 	status = "okay";
 	vmmc-supply = <&reg_vcc3v3>;
 };
@@ -106,19 +105,19 @@
 };
 
 &pio {
-	leds_npi: led_pins at 0 {
+	leds_npi: led_pins {
 		pins = "PA10";
 		function = "gpio_out";
 	};
 };
 
 &r_pio {
-	leds_r_npi: led_pins at 0 {
+	leds_r_npi: led_pins {
 		pins = "PL10";
 		function = "gpio_out";
 	};
 
-	sw_r_npi: key_pins at 0 {
+	sw_r_npi: key_pins {
 		pins = "PL3";
 		function = "gpio_in";
 	};
arch/arm/dts/sun8i-h3-orangepi-2.dts +63 -25

138 lines not on this page · raw message

arch/arm/dts/sun8i-h3-orangepi-lite.dts +35 -18

95 lines not on this page · raw message

arch/arm/dts/sun8i-h3-orangepi-one.dts +95 -19

162 lines not on this page · raw message

arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts +7 -2
index 4653cac49b..71fb732089 100644
@@ -53,6 +53,11 @@
 	};
 };
 
+&emac {
+	/* LEDs changed to active high on the plus */
+	/delete-property/ allwinner,leds-active-low;
+};
+
 &mmc1 {
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
@@ -80,7 +85,7 @@
 
 &mmc2_8bit_pins {
 	/* Increase drive strength for DDR modes */
-	allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+	drive-strength = <40>;
 	/* eMMC is missing pull-ups */
-	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	bias-pull-up;
 };
arch/arm/dts/sun8i-h3-orangepi-pc.dts +115 -24

192 lines not on this page · raw message

arch/arm/dts/sun8i-h3-orangepi-plus.dts +12 -17
index 136e4414a4..b403e5d787 100644
@@ -47,10 +47,12 @@
 	model = "Xunlong Orange Pi Plus / Plus 2";
 	compatible = "xunlong,orangepi-plus", "allwinner,sun8i-h3";
 
+	aliases {
+		ethernet0 = &emac;
+	};
+
 	reg_gmac_3v3: gmac-3v3 {
 		compatible = "regulator-fixed";
-		pinctrl-names = "default";
-		pinctrl-0 = <&gmac_power_pin_orangepi>;
 		regulator-name = "gmac-3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
@@ -77,11 +79,13 @@
 };
 
 &emac {
-	/* The Orange Pi Plus uses an external phy */
 	pinctrl-names = "default";
 	pinctrl-0 = <&emac_rgmii_pins>;
 	phy-supply = <&reg_gmac_3v3>;
+	phy-handle = <&ext_rgmii_phy>;
 	phy-mode = "rgmii";
+
+	status = "okay";
 };
 
 &external_mdio {
@@ -103,24 +107,15 @@
 
 &mmc2_8bit_pins {
 	/* Increase drive strength for DDR modes */
-	allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+	drive-strength = <40>;
 	/* eMMC is missing pull-ups */
-	allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+	bias-pull-up;
 };
 
 &pio {
-	gmac_power_pin_orangepi: gmac_power_pin at 0 {
-		allwinner,pins = "PD6";
-		allwinner,function = "gpio_out";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-	};
-
-	usb3_vbus_pin_a: usb3_vbus_pin at 0 {
-		allwinner,pins = "PG11";
-		allwinner,function = "gpio_out";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	usb3_vbus_pin_a: usb3_vbus_pin {
+		pins = "PG11";
+		function = "gpio_out";
 	};
 };
 
arch/arm/dts/sun8i-h3-orangepi-plus2e.dts +2 -13
index 51aaf49b6d..6dbf7b2e0c 100644
@@ -53,24 +53,22 @@
 
 	reg_gmac_3v3: gmac-3v3 {
 		compatible = "regulator-fixed";
-		pinctrl-names = "default";
-		pinctrl-0 = <&gmac_power_pin_orangepi>;
 		regulator-name = "gmac-3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 		startup-delay-us = <100000>;
 		enable-active-high;
-		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
+		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
 	};
 };
 
 &emac {
-	/* The Orange Pi Plus 2E uses an external gbit phy */
 	pinctrl-names = "default";
 	pinctrl-0 = <&emac_rgmii_pins>;
 	phy-supply = <&reg_gmac_3v3>;
 	phy-handle = <&ext_rgmii_phy>;
 	phy-mode = "rgmii";
+	status = "okay";
 };
 
 &external_mdio {
@@ -79,12 +77,3 @@
 		reg = <1>;
 	};
 };
-
-&pio {
-	gmac_power_pin_orangepi: gmac_power_pin at 0 {
-		allwinner,pins = "PD6";
-		allwinner,function = "gpio_out";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-	};
-};
Signature · 1 line
2.14.4
#6 lore raw

PATCH v7 6/6 sunxi: DT: A64: add proper SoPine baseboard device tree

In reply to Andre Przywara

When the defconfig for the SoPine baseboard was added, there wasn't any proper DT for the board yet, so we used the Pine64 DT as a placeholder. Copy the DT file(s) meanwhile added in Linux over to U-Boot, and use them in our defconfig.
This is as of v4.18-rc3, exactly Linux commit:
commit 7d556bfc49adddf2beb0d16c91945c3b8b783282

Author: Jagan Teki <[email protected]>
Date:   Mon Dec 4 10:23:07 2017 +0530

arm64: allwinner: a64-sopine: Fix to use dcdc1 regulator instead of vcc3v3

---
 arch/arm/dts/Makefile                        |   3 +-
 arch/arm/dts/sun50i-a64-sopine-baseboard.dts | 150 +++++++++++++++++++++++++++
 arch/arm/dts/sun50i-a64-sopine.dtsi          | 142 +++++++++++++++++++++++++
 configs/sopine_baseboard_defconfig           |   2 +-
 4 files changed, 295 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/dts/sun50i-a64-sopine-baseboard.dts
 create mode 100644 arch/arm/dts/sun50i-a64-sopine.dtsi
arch/arm/dts/Makefile +2 -1
index 64f6d21c3c..3359ac725b 100644
@@ -390,7 +390,8 @@ dtb-$(CONFIG_MACH_SUN50I) += \
 	sun50i-a64-olinuxino.dtb \
 	sun50i-a64-orangepi-win.dtb \
 	sun50i-a64-pine64-plus.dtb \
-	sun50i-a64-pine64.dtb
+	sun50i-a64-pine64.dtb \
+	sun50i-a64-sopine-baseboard.dtb
 dtb-$(CONFIG_MACH_SUN9I) += \
 	sun9i-a80-optimus.dtb \
 	sun9i-a80-cubieboard4.dtb \
arch/arm/dts/sun50i-a64-sopine-baseboard.dts new file +150 -0

150 lines not on this page · raw message

arch/arm/dts/sun50i-a64-sopine.dtsi new file +142 -0

142 lines not on this page · raw message

configs/sopine_baseboard_defconfig +1 -1
index 05436a1b43..c79c111b5d 100644
@@ -10,7 +10,7 @@ CONFIG_DRAM_ODT_EN=y
 CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SPL_SPI_SUNXI=y
-CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-sopine-baseboard"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_SPL_DOS_PARTITION is not set
Signature · 1 line
2.14.4
#7 lore raw

v7 cover sunxi: sync H3, H5, A64 DTs from mainline Linux

In reply to Andre Przywara
Quoted 57 lines · Andre Przywara

This is an updated version of the series which brings the exact mainline Linux device tree files for various Allwinner boards into U-Boot. Apart from using the usually more correct reference DT files, this offers the big benefit of being able to use U-Boot's DT copy for directly passing it to the kernel. This avoids to actually load a .dtb file from somewhere, and allows seamless and automatic UEFI booting, so distribution installer images should just work (TM).

This covers the ARMv8 SoCs (H5, A64), but also all boards with the H3, as this is somewhat married to the H5 and can only be updated together. The H3 and H5 DT files have diverged quite a bit, but as U-Boot's own usage of the DT is (yet) quite limited, there should be no regressions. The patches are split to first update the SoC .dtsi file, then the board .dts files in a second patch. They are grouped to handle the A64 first, then the H5 and H3. I put the respective kernel commit IDs in the commit messages.
Patch 6 brings in the mainline DT for the SoPine baseboard, for which we didn't have a separate .dts in U-Boot so far.

This is based on origin/master, and requires the USB shutdown fix. Please let me know what I should it base it against, maybe closer to the time we actually want to merge this (to avoid playing cat and mouse here).

Maxime, I kept you Acked-by: from the previous posts, as I literally just updated to the latest Linux master, which went through your review anyway. Hope that's OK for you.

Cheers,
Andre.

Changelog v6 .. v7:
- drop Pine64-LTS DT (will send it to Linux first)
- update to Linux v4.18-rc3

Changelog v5 .. v6:
- bring back DT update patches
- update to Linux v4.17-rc5

Changelog v4 .. v5:
- drop Linux DT update patches for now
- fix minor checkpatch complaints

Changelog v3 .. v4:
- remove MMC environment for all Allwinner boards (including 32 bit ones)
- keep MMC environment offset to the old values
- drop DT adjustments to use fixed MMC regulator

Changelog v2 .. v3:
01: added, was on the list before
02: drop redundant H5 line
03-08: unchanged
09-20: added

Changelog v1 .. v2:
01, 02, 03: unchanged
04, 05, 06, 07: added

Quoted 7 lines

Andre Przywara (6):
sunxi: DT: A64: update device tree file for Allwinner A64 SoC
sunxi: DT: A64: update board .dts files from Linux
sunxi: DT: update device tree files for Allwinner H3 and H5 SoCs
sunxi: DT: H5: update board .dts files from Linux
sunxi: DT: H3: update board .dts files from Linux
sunxi: DT: A64: add proper SoPine baseboard device tree

Applied to u-boot-sunxi/master