Skip to contentSkip to conversation

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

PATCH Superseded Andre Przywara 4 participants 30 messages Mar 2, 2018 – Mar 9, 2018

Subsystems (10)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

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

This is an extended version of the EMAC DT binding update, this time including the full Linux DTs for all H3, H5 and A64 boards. Patch 01 should be merged *now*, to leave some hint in the README for the v2018.03 release. Without building ARM Trusted Firmware with DEBUG=0 many H5 boards and the Pine64 can't be built successfully at the moment.

The old v2 EMAC DT update series is in patches 02-08, it prepares U-Boot's EMAC driver for using the new DT binding used in Linux, also updates the DTs to the new EMAC DT node already.

This time I added patches to sync the whole U-Boot DT files for the mentioned SoCs with those from Linux. However this first requires lifting the space limit we currently have due to the raw MMC environment. Patch 09 disables that for 64 bit sunxi boards, to give us finally some space. Patch 10 consequently reverts the disabling of features we saw a few weeks ago to migitate the size problem.

Patches 11-20 then brings in the Linux DTs, split by SoCs, with the .dtsi files first, then the board files.

Merging the H3 and H5 device tree files brings in significant changes, also to the structure of the .dtsi files. However U-Boot's own DT usage is pretty limited, so it doesn't matter.

The huge benefit of syncing the DTs is that we can use U-Boot's DT copy to directly pass it to the kernel, avoiding to actually load a .dtb file from somewhere. To allows seamless and automatic UEFI booting, so distribution installer images should just work (TM).

As a goodie the final patch brings in the actual SoPine + baseboard DT files, which we were completely missing so far.

Please let me know if that looks good. I am happy to rearrange or squash patches, but I tried to avoid huge commits, for the sake of reviewability.

Cheers,
Andre.

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 (20):
sunxi: README.sunxi64: Add hint about non-debug of ARM Trusted
Firmware
sunxi: gpio: add missing compatible strings
net: sun8i-emac: support new pinctrl DT bindings
net: sun8i-emac: add support for new EMAC DT binding
arm: dts: sunxi: update A64 to new EMAC binding
arm: dts: sunxi: update H3 to new EMAC binding
arm: dts: sunxi: update H5 to new EMAC binding
net: sun8i-emac: remove support for old binding
sunxi: disable direct MMC environment for 64 bit boards
sunxi: revert disabling of features
sunxi: DT: A64: update device tree file for Allwinner A64 SoC
sunxi: DT: A64: update board .dts files from Linux
Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0
sunxi: dts: A64 boards: Use fixed regulator for mmc0
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: H3: update libre-cc board .dts file
sunxi: DT: H2+: update Opi-zero .dts
sunxi: DT: A64: add proper SoPine baseboard device tree

 arch/arm/dts/Makefile                           |   3 +-
 arch/arm/dts/axp803.dtsi                        | 150 +++++
 arch/arm/dts/sun50i-a64-bananapi-m64.dts        | 154 +++++-
 arch/arm/dts/sun50i-a64-nanopi-a64.dts          |  99 ++++
 arch/arm/dts/sun50i-a64-olinuxino.dts           | 122 +++++
 arch/arm/dts/sun50i-a64-orangepi-win.dts        |   7 +-
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi |  50 --
 arch/arm/dts/sun50i-a64-pine64-plus.dts         |  17 +-
 arch/arm/dts/sun50i-a64-pine64.dts              | 171 ++++++
 arch/arm/dts/sun50i-a64-sopine-baseboard.dts    | 150 +++++
 arch/arm/dts/sun50i-a64-sopine.dtsi             | 142 +++++
 arch/arm/dts/sun50i-a64.dtsi                    | 204 ++++++-
 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts     | 105 +++-
 arch/arm/dts/sun50i-h5-nanopi-neo2.dts          |  89 ++-
 arch/arm/dts/sun50i-h5-orangepi-pc2.dts         | 170 ++++--
 arch/arm/dts/sun50i-h5-orangepi-prime.dts       | 164 +++++-
 arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts  |   7 +-
 arch/arm/dts/sun50i-h5.dtsi                     |  36 +-
 arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts    |  58 +-
 arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts      |  78 ++-
 arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts   |  15 +-
 arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts        |  71 +++
 arch/arm/dts/sun8i-h3-nanopi-m1.dts             |   6 +
 arch/arm/dts/sun8i-h3-nanopi-neo-air.dts        |   1 -
 arch/arm/dts/sun8i-h3-nanopi-neo.dts            |   6 +-
 arch/arm/dts/sun8i-h3-orangepi-2.dts            |  67 ++-
 arch/arm/dts/sun8i-h3-orangepi-lite.dts         |  25 +-
 arch/arm/dts/sun8i-h3-orangepi-one.dts          |  72 ++-
 arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts      |   9 +-
 arch/arm/dts/sun8i-h3-orangepi-pc.dts           |  88 ++-
 arch/arm/dts/sun8i-h3-orangepi-plus.dts         |  37 +-
 arch/arm/dts/sun8i-h3-orangepi-plus2e.dts       |  18 +-
 arch/arm/dts/sun8i-h3.dtsi                      | 488 ++---------------
 arch/arm/dts/sunxi-h3-h5.dtsi                   | 698 ++++++++++++++++++++++++
 board/sunxi/README.sunxi64                      |   6 +
 cmd/Kconfig                                     |   5 -
 configs/sopine_baseboard_defconfig              |   2 +-
 drivers/gpio/sunxi_gpio.c                       |   3 +
 drivers/net/sun8i_emac.c                        |  89 ++-
 drivers/video/Kconfig                           |   2 -
 env/Kconfig                                     |   5 +-
 include/configs/sunxi-common.h                  |   2 +-
 include/dt-bindings/clock/sun8i-r-ccu.h         |  59 ++
 include/dt-bindings/reset/sun8i-r-ccu.h         |  53 ++
 lib/Kconfig                                     |   1 -
 45 files changed, 2980 insertions(+), 824 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-r-ccu.h
 create mode 100644 include/dt-bindings/reset/sun8i-r-ccu.h
Signature · 1 line
2.14.1
#1 lore raw

PATCH v3 1/20 sunxi: README.sunxi64: Add hint about non-debug of ARM Trusted Firmware

As we are running into issues where the final U-Boot FIT image file is exceeding our size limit, add a hint to the README.sunxi64 file to point out the possibility of building non-debug versions of the ATF binary. These are about 12KB smaller than the standard debug build, and so allow successful U-Boot builds for many boards with the Allwinner H5 SoC.
Please note that under normal circumstances the debug build is still recommended, as it gives valuable clues in case something goes wrong in the ATF.

---
 board/sunxi/README.sunxi64 | 6 ++++++
 1 file changed, 6 insertions(+)
board/sunxi/README.sunxi64 +6 -0
index c492f749b8..eefa5001a2 100644
@@ -38,6 +38,12 @@ the root of your U-Boot build directory (or create a symbolic link).
 $ export BL31=/src/arm-trusted-firmware/build/sun50iw1p1/debug/bl31.bin
   (adjust the actual path accordingly)
 
+If you run into size issues with the resulting U-Boot image file, it might
+help to use a release build, by using "DEBUG=0" when building bl31.bin.
+As sometimes the ATF build process is a bit picky about the toolchain used,
+or if you can't be bothered with building ATF, there are known working
+binaries in the firmware repository[3], purely for convenience reasons.
+
  SPL/U-Boot
 ------------
 Both U-Boot proper and the SPL are using the 64-bit mode. As the boot ROM
Signature · 1 line
2.14.1
#2 lore raw

PATCH v3 2/20 sunxi: gpio: add missing compatible strings

In reply to Andre Przywara

The sunxi GPIO driver is missing some compatible strings for recent SoCs. While most of the sunxi GPIO code seems to not rely on this (and so works anyway), the sunxi_name_to_gpio() function does and fails at the moment (for instance when resolving the MMC CD pin name). Add the compatible strings for the A64 and V3s, which were missing from the list. This now covers all pinctrl nodes in our own DTs.

---
 drivers/gpio/sunxi_gpio.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpio/sunxi_gpio.c +3 -0
index 3cf01b6e36..ea6f3593b9 100644
@@ -354,12 +354,15 @@ static const struct udevice_id sunxi_gpio_ids[] = {
 	ID("allwinner,sun8i-a83t-pinctrl",	a_all),
 	ID("allwinner,sun8i-h3-pinctrl",	a_all),
 	ID("allwinner,sun8i-r40-pinctrl",	a_all),
+	ID("allwinner,sun8i-v3s-pinctrl",	a_all),
 	ID("allwinner,sun9i-a80-pinctrl",	a_all),
+	ID("allwinner,sun50i-a64-pinctrl",	a_all),
 	ID("allwinner,sun6i-a31-r-pinctrl",	l_2),
 	ID("allwinner,sun8i-a23-r-pinctrl",	l_1),
 	ID("allwinner,sun8i-a83t-r-pinctrl",	l_1),
 	ID("allwinner,sun8i-h3-r-pinctrl",	l_1),
 	ID("allwinner,sun9i-a80-r-pinctrl",	l_3),
+	ID("allwinner,sun50i-a64-r-pinctrl",	l_1),
 	{ }
 };
 
Signature · 1 line
2.14.1
#3 lore raw

PATCH v3 3/20 net: sun8i-emac: support new pinctrl DT bindings

In reply to Andre Przywara

The Linux kernel driver for the Allwinner pin controller gained support for generic properties, which are now also used in the DTs. The sun8i-emac Ethernet driver for new Allwinner MACs reads the pins from the DT, but so far only supported the old binding.
Update the parsing routine to cope with both the old and new bindings, so that the newer DTs can be used with U-Boot and its Ethernet driver.

---
 drivers/net/sun8i_emac.c | 52 ++++++++++++++++++++++++++++++++++++------------
 1 file changed, 39 insertions(+), 13 deletions(-)
drivers/net/sun8i_emac.c +39 -13
index 3ccc6b0bb6..df2b857310 100644
@@ -21,6 +21,7 @@
 #include <malloc.h>
 #include <miiphy.h>
 #include <net.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 #ifdef CONFIG_DM_GPIO
 #include <asm-generic/gpio.h>
 #endif
@@ -465,30 +466,55 @@ static int parse_phy_pins(struct udevice *dev)
 	}
 
 	drive = fdt_getprop_u32_default_node(gd->fdt_blob, offset, 0,
-					     "allwinner,drive", 4);
-	pull = fdt_getprop_u32_default_node(gd->fdt_blob, offset, 0,
-					    "allwinner,pull", 0);
+					     "drive-strength", ~0);
+	if (drive != ~0) {
+		if (drive <= 10)
+			drive = SUN4I_PINCTRL_10_MA;
+		else if (drive <= 20)
+			drive = SUN4I_PINCTRL_20_MA;
+		else if (drive <= 30)
+			drive = SUN4I_PINCTRL_30_MA;
+		else
+			drive = SUN4I_PINCTRL_40_MA;
+	} else {
+		drive = fdt_getprop_u32_default_node(gd->fdt_blob, offset, 0,
+						     "allwinner,drive", 4);
+	}
+
+	if (fdt_get_property(gd->fdt_blob, offset, "bias-pull-up", NULL))
+		pull = SUN4I_PINCTRL_PULL_UP;
+	else if (fdt_get_property(gd->fdt_blob, offset, "bias-disable", NULL))
+		pull = SUN4I_PINCTRL_NO_PULL;
+	else if (fdt_get_property(gd->fdt_blob, offset, "bias-pull-down", NULL))
+		pull = SUN4I_PINCTRL_PULL_DOWN;
+	else
+		pull = fdt_getprop_u32_default_node(gd->fdt_blob, offset, 0,
+						    "allwinner,pull", 0);
 	for (i = 0; ; i++) {
 		int pin;
 
 		pin_name = fdt_stringlist_get(gd->fdt_blob, offset,
 					      "allwinner,pins", i, NULL);
-		if (!pin_name)
-			break;
-		if (pin_name[0] != 'P')
-			continue;
-		pin = (pin_name[1] - 'A') << 5;
-		if (pin >= 26 << 5)
+		if (!pin_name) {
+			pin_name = fdt_stringlist_get(gd->fdt_blob, offset,
+						      "pins", i, NULL);
+			if (!pin_name)
+				break;
+		}
+
+		pin = sunxi_name_to_gpio(pin_name);
+		if (pin < 0)
 			continue;
-		pin += simple_strtol(&pin_name[2], NULL, 10);
 
 		sunxi_gpio_set_cfgpin(pin, SUN8I_GPD8_GMAC);
-		sunxi_gpio_set_drv(pin, drive);
-		sunxi_gpio_set_pull(pin, pull);
+		if (drive != ~0)
+			sunxi_gpio_set_drv(pin, drive);
+		if (pull != ~0)
+			sunxi_gpio_set_pull(pin, pull);
 	}
 
 	if (!i) {
-		printf("WARNING: emac: cannot find allwinner,pins property\n");
+		printf("WARNING: emac: cannot find pins property\n");
 		return -2;
 	}
 
Signature · 1 line
2.14.1
#4 lore raw

PATCH v3 4/20 net: sun8i-emac: add support for new EMAC DT binding

In reply to Andre Przywara

The Ethernet MAC used in newer Allwinner SoCs (H3, A64, H5) got an upstream Linux driver in v4.15.
This one uses a slightly different binding from the original one used by the U-Boot driver.
The differences to the old binding are:
- The "syscon" address is held in a separate node, referenced via a phandle in the "syscon" property.
- The reference to the PHY is held in a property called "phy-handle", not "phy".
- The PHY register is at offset 0x30 in the syscon device, not at 0.
- The internal PHY is activated when the node, which phy-handle points to, is a child node of an "allwinner,sun8i-h3-mdio-internal" node.

Teach the U-Boot driver how to find its resources in a "new-style" DT, so that we can use a Linux kernel compatible DT for U-Boot as well. This keeps support for the old binding for now, to allow a smooth transition.

---
 drivers/net/sun8i_emac.c | 55 ++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 7 deletions(-)
drivers/net/sun8i_emac.c +48 -7
index df2b857310..4ba8959239 100644
@@ -279,7 +279,7 @@ static int sun8i_emac_set_syscon(struct emac_eth_dev *priv)
 	int ret;
 	u32 reg;
 
-	reg = readl(priv->sysctl_reg);
+	reg = readl(priv->sysctl_reg + 0x30);
 
 	if (priv->variant == H3_EMAC) {
 		ret = sun8i_emac_set_syscon_ephy(priv, &reg);
@@ -310,7 +310,7 @@ static int sun8i_emac_set_syscon(struct emac_eth_dev *priv)
 		return -EINVAL;
 	}
 
-	writel(reg, priv->sysctl_reg);
+	writel(reg, priv->sysctl_reg + 0x30);
 
 	return 0;
 }
@@ -806,17 +806,50 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
 #endif
 
 	pdata->iobase = devfdt_get_addr_name(dev, "emac");
+	if (pdata->iobase == FDT_ADDR_T_NONE)
+		pdata->iobase = devfdt_get_addr(dev);
+	if (pdata->iobase == FDT_ADDR_T_NONE) {
+		debug("%s: Cannot find MAC base address\n", __func__);
+		return -EINVAL;
+	}
+
 	priv->sysctl_reg = devfdt_get_addr_name(dev, "syscon");
+	if (priv->sysctl_reg == FDT_ADDR_T_NONE) {
+		const fdt32_t *reg;
+
+		offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "syscon");
+		if (offset < 0) {
+			debug("%s: cannot find syscon node\n", __func__);
+			return -EINVAL;
+		}
+		reg = fdt_getprop(gd->fdt_blob, offset, "reg", NULL);
+		if (!reg) {
+			debug("%s: cannot find reg property in syscon node\n",
+			      __func__);
+			return -EINVAL;
+		}
+		priv->sysctl_reg = fdt_translate_address((void *)gd->fdt_blob,
+							 offset, reg);
+	} else
+		priv->sysctl_reg -= 0x30;
+	if (priv->sysctl_reg == FDT_ADDR_T_NONE) {
+		debug("%s: Cannot find syscon base address\n", __func__);
+		return -EINVAL;
+	}
 
 	pdata->phy_interface = -1;
 	priv->phyaddr = -1;
 	priv->use_internal_phy = false;
 
-	offset = fdtdec_lookup_phandle(gd->fdt_blob, node,
-				       "phy");
-	if (offset > 0)
-		priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg",
-					       -1);
+	offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy");
+	if (offset < 0)
+		offset = fdtdec_lookup_phandle(gd->fdt_blob, node,
+					       "phy-handle");
+	if (offset < 0) {
+		debug("%s: Cannot find PHY address\n", __func__);
+		return -EINVAL;
+	}
+	priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
 
 	phy_mode = fdt_getprop(gd->fdt_blob, node, "phy-mode", NULL);
 
@@ -841,6 +874,14 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
 		if (fdt_getprop(gd->fdt_blob, node,
 				"allwinner,use-internal-phy", NULL))
 			priv->use_internal_phy = true;
+		else {
+			int parent = fdt_parent_offset(gd->fdt_blob, offset);
+
+			if (parent >= 0 &&
+			    !fdt_node_check_compatible(gd->fdt_blob, parent,
+					"allwinner,sun8i-h3-mdio-internal"))
+				priv->use_internal_phy = true;
+		}
 	}
 
 	priv->interface = pdata->phy_interface;
Signature · 1 line
2.14.1
#5 lore raw

PATCH v3 5/20 arm: dts: sunxi: update A64 to new EMAC binding

In reply to Andre Przywara

The U-Boot driver for the sun8i-emac was using some preliminary DT binding. Now since Linux got its own driver in v4.15 and our driver can now cope with both bindings, let's convert the DT nodes used for the Pine64+ board over to the new bindings used by the kernel.

---
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi | 51 +++++++++++++++----------
 1 file changed, 30 insertions(+), 21 deletions(-)
arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi +30 -21
index 9c61beac01..32a263ce3d 100644
@@ -4,25 +4,38 @@
 	};
 
 	soc {
-		emac: ethernet at 01c30000 {
+		syscon: syscon at 1c00000 {
+			compatible = "allwinner,sun50i-a64-system-controller",
+				     "syscon";
+			reg = <0x01c00000 0x1000>;
+		};
+
+		emac: ethernet at 1c30000 {
 			compatible = "allwinner,sun50i-a64-emac";
-			reg = <0x01c30000 0x2000>, <0x01c00030 0x4>;
-			reg-names = "emac", "syscon";
+			syscon = <&syscon>;
+			reg = <0x01c30000 0x10000>;
 			interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "macirq";
 			resets = <&ccu RST_BUS_EMAC>;
-			reset-names = "ahb";
+			reset-names = "stmmaceth";
 			clocks = <&ccu CLK_BUS_EMAC>;
-			clock-names = "ahb";
+			clock-names = "stmmaceth";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			pinctrl-names = "default";
 			pinctrl-0 = <&rgmii_pins>;
 			phy-mode = "rgmii";
-			phy = <&phy1>;
+			phy-handle = <&ext_rgmii_phy>;
 			status = "okay";
 
-			phy1: ethernet-phy at 1 {
-				reg = <1>;
+			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>;
+				};
 			};
 		};
 	};
@@ -30,21 +43,17 @@
 
 &pio {
 	rmii_pins: rmii_pins {
-		allwinner,pins = "PD10", "PD11", "PD13", "PD14",
-				 "PD17", "PD18", "PD19", "PD20",
-				 "PD22", "PD23";
-		allwinner,function = "emac";
-		allwinner,drive = <3>;
-		allwinner,pull = <0>;
+		pins = "PD10", "PD11", "PD13", "PD14", "PD17",
+		       "PD18", "PD19", "PD20", "PD22", "PD23";
+		function = "emac";
+		drive-strength = <40>;
 	};
 
 	rgmii_pins: rgmii_pins {
-		allwinner,pins = "PD8", "PD9", "PD10", "PD11",
-				 "PD12", "PD13", "PD15",
-				 "PD16", "PD17", "PD18", "PD19",
-				 "PD20", "PD21", "PD22", "PD23";
-		allwinner,function = "emac";
-		allwinner,drive = <3>;
-		allwinner,pull = <0>;
+		pins = "PD8", "PD9", "PD10", "PD11", "PD12",
+		       "PD13", "PD15", "PD16", "PD17", "PD18",
+		       "PD19", "PD20", "PD21", "PD22", "PD23";
+		function = "emac";
+		drive-strength = <40>;
 	};
 };
Signature · 1 line
2.14.1
#6 lore raw

PATCH v3 6/20 arm: dts: sunxi: update H3 to new EMAC binding

In reply to Andre Przywara

The U-Boot driver for the sun8i-emac was using some preliminary DT binding. Now since Linux got its own driver in v4.15 and our driver can now cope with both bindings, let's convert the DT nodes used by the various H3 boards over to the new bindings used by the kernel.

---
 arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts  |  6 +--
 arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts |  7 +--
 arch/arm/dts/sun8i-h3-nanopi-neo.dts          |  6 +--
 arch/arm/dts/sun8i-h3-orangepi-2.dts          |  7 +--
 arch/arm/dts/sun8i-h3-orangepi-one.dts        |  7 +--
 arch/arm/dts/sun8i-h3-orangepi-pc.dts         |  7 +--
 arch/arm/dts/sun8i-h3-orangepi-plus.dts       |  8 +++-
 arch/arm/dts/sun8i-h3-orangepi-plus2e.dts     |  9 +++-
 arch/arm/dts/sun8i-h3.dtsi                    | 69 ++++++++++++++++++++-------
 9 files changed, 75 insertions(+), 51 deletions(-)
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +1 -5
index 20d489cb2a..e0efcb3ba3 100644
@@ -100,14 +100,10 @@
 };
 
 &emac {
-	phy = <&phy1>;
+	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
-	allwinner,use-internal-phy;
 	allwinner,leds-active-low;
 	status = "okay";
-	phy1: ethernet-phy at 1 {
-		reg = <1>;
-	};
 };
 
 &mmc0 {
arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts +1 -6
index 97b993f636..c8fd69f0a4 100644
@@ -125,15 +125,10 @@
 };
 
 &emac {
-	phy = <&phy1>;
+	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
-	allwinner,use-internal-phy;
 	allwinner,leds-active-low;
 	status = "okay";
-
-	phy1: ethernet-phy at 1 {
-		reg = <1>;
-	};
 };
 
 &ir {
arch/arm/dts/sun8i-h3-nanopi-neo.dts +1 -5
index 5113059098..78f6c24952 100644
@@ -48,12 +48,8 @@
 };
 
 &emac {
-	phy = <&phy1>;
+	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
-	allwinner,use-internal-phy;
 	allwinner,leds-active-low;
 	status = "okay";
-	phy1: ethernet-phy at 1 {
-		reg = <1>;
-	};
 };
arch/arm/dts/sun8i-h3-orangepi-2.dts +2 -5
index caa1a6959c..d97fdacb35 100644
@@ -55,6 +55,7 @@
 	aliases {
 		serial0 = &uart0;
 		/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
+		ethernet0 = &emac;
 		ethernet1 = &rtl8189;
 	};
 
@@ -110,14 +111,10 @@
 };
 
 &emac {
-	phy = <&phy1>;
+	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
-	allwinner,use-internal-phy;
 	allwinner,leds-active-low;
 	status = "okay";
-	phy1: ethernet-phy at 1 {
-		reg = <1>;
-	};
 };
 
 &ir {
arch/arm/dts/sun8i-h3-orangepi-one.dts +2 -5
index 8df5c74f04..adab1cbfc9 100644
@@ -53,6 +53,7 @@
 	compatible = "xunlong,orangepi-one", "allwinner,sun8i-h3";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -95,14 +96,10 @@
 };
 
 &emac {
-	phy = <&phy1>;
+	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
-	allwinner,use-internal-phy;
 	allwinner,leds-active-low;
 	status = "okay";
-	phy1: ethernet-phy at 1 {
-		reg = <1>;
-	};
 };
 
 &mmc0 {
arch/arm/dts/sun8i-h3-orangepi-pc.dts +2 -5
index b8340f74e7..afba264ea5 100644
@@ -53,6 +53,7 @@
 	compatible = "xunlong,orangepi-pc", "allwinner,sun8i-h3";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 	};
 
@@ -167,12 +168,8 @@
 };
 
 &emac {
-	phy = <&phy1>;
+	phy-handle = <&int_mii_phy>;
 	phy-mode = "mii";
-	allwinner,use-internal-phy;
 	allwinner,leds-active-low;
 	status = "okay";
-	phy1: ethernet-phy at 1 {
-		reg = <1>;
-	};
 };
arch/arm/dts/sun8i-h3-orangepi-plus.dts +7 -1
index e7079b26bc..136e4414a4 100644
@@ -82,7 +82,13 @@
 	pinctrl-0 = <&emac_rgmii_pins>;
 	phy-supply = <&reg_gmac_3v3>;
 	phy-mode = "rgmii";
-	/delete-property/allwinner,use-internal-phy;
+};
+
+&external_mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0>;
+	};
 };
 
 &mmc2 {
arch/arm/dts/sun8i-h3-orangepi-plus2e.dts +8 -1
index f97b040b35..51aaf49b6d 100644
@@ -69,8 +69,15 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&emac_rgmii_pins>;
 	phy-supply = <&reg_gmac_3v3>;
+	phy-handle = <&ext_rgmii_phy>;
 	phy-mode = "rgmii";
-	/delete-property/allwinner,use-internal-phy;
+};
+
+&external_mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <1>;
+	};
 };
 
 &pio {
arch/arm/dts/sun8i-h3.dtsi +51 -18

91 lines not on this page · raw message

Signature · 1 line
2.14.1
#7 lore raw

PATCH v3 7/20 arm: dts: sunxi: update H5 to new EMAC binding

In reply to Andre Przywara

The U-Boot driver for the sun8i-emac was using some preliminary DT binding. Now since Linux got its own driver in v4.15 and our driver can now cope with both bindings, let's convert the DT nodes used by the OrangePi PC2 over to the new bindings used by the kernel.

---
 arch/arm/dts/sun50i-h5-orangepi-pc2.dts | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm/dts/sun50i-h5-orangepi-pc2.dts +5 -2
index 780d59a096..d1c347d2b8 100644
@@ -108,10 +108,13 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&emac_rgmii_pins>;
 	phy-mode = "rgmii";
-	phy = <&phy1>;
+	phy-handle = <&ext_rgmii_phy>;
 	status = "okay";
+};
 
-	phy1: ethernet-phy at 1 {
+&external_mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
 		reg = <1>;
 	};
 };
Signature · 1 line
2.14.1
#8 lore raw

PATCH v3 8/20 net: sun8i-emac: remove support for old binding

In reply to Andre Przywara

The original DT binding used by U-Boot's sun8i-emac driver was not really agreed upon, and deviated from the "official" binding now used by the kernel. Since now all U-Boot users have been converted to the new binding, we can remove support for the old DT nodes from the driver.

---
 drivers/net/sun8i_emac.c | 78 ++++++++++++++++--------------------------------
 1 file changed, 26 insertions(+), 52 deletions(-)
drivers/net/sun8i_emac.c +26 -52
index 4ba8959239..fd13b6bf95 100644
@@ -456,7 +456,7 @@ static int parse_phy_pins(struct udevice *dev)
 {
 	int offset;
 	const char *pin_name;
-	int drive, pull, i;
+	int drive, pull = SUN4I_PINCTRL_NO_PULL, i;
 
 	offset = fdtdec_lookup_phandle(gd->fdt_blob, dev_of_offset(dev),
 				       "pinctrl-0");
@@ -476,31 +476,20 @@ static int parse_phy_pins(struct udevice *dev)
 			drive = SUN4I_PINCTRL_30_MA;
 		else
 			drive = SUN4I_PINCTRL_40_MA;
-	} else {
-		drive = fdt_getprop_u32_default_node(gd->fdt_blob, offset, 0,
-						     "allwinner,drive", 4);
 	}
 
 	if (fdt_get_property(gd->fdt_blob, offset, "bias-pull-up", NULL))
 		pull = SUN4I_PINCTRL_PULL_UP;
-	else if (fdt_get_property(gd->fdt_blob, offset, "bias-disable", NULL))
-		pull = SUN4I_PINCTRL_NO_PULL;
 	else if (fdt_get_property(gd->fdt_blob, offset, "bias-pull-down", NULL))
 		pull = SUN4I_PINCTRL_PULL_DOWN;
-	else
-		pull = fdt_getprop_u32_default_node(gd->fdt_blob, offset, 0,
-						    "allwinner,pull", 0);
+
 	for (i = 0; ; i++) {
 		int pin;
 
 		pin_name = fdt_stringlist_get(gd->fdt_blob, offset,
-					      "allwinner,pins", i, NULL);
-		if (!pin_name) {
-			pin_name = fdt_stringlist_get(gd->fdt_blob, offset,
-						      "pins", i, NULL);
-			if (!pin_name)
-				break;
-		}
+					      "pins", i, NULL);
+		if (!pin_name)
+			break;
 
 		pin = sunxi_name_to_gpio(pin_name);
 		if (pin < 0)
@@ -798,6 +787,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
 	struct eth_pdata *pdata = &sun8i_pdata->eth_pdata;
 	struct emac_eth_dev *priv = dev_get_priv(dev);
 	const char *phy_mode;
+	const fdt32_t *reg;
 	int node = dev_of_offset(dev);
 	int offset = 0;
 #ifdef CONFIG_DM_GPIO
@@ -805,33 +795,25 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
 	int ret = 0;
 #endif
 
-	pdata->iobase = devfdt_get_addr_name(dev, "emac");
-	if (pdata->iobase == FDT_ADDR_T_NONE)
-		pdata->iobase = devfdt_get_addr(dev);
+	pdata->iobase = devfdt_get_addr(dev);
 	if (pdata->iobase == FDT_ADDR_T_NONE) {
 		debug("%s: Cannot find MAC base address\n", __func__);
 		return -EINVAL;
 	}
 
-	priv->sysctl_reg = devfdt_get_addr_name(dev, "syscon");
-	if (priv->sysctl_reg == FDT_ADDR_T_NONE) {
-		const fdt32_t *reg;
-
-		offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "syscon");
-		if (offset < 0) {
-			debug("%s: cannot find syscon node\n", __func__);
-			return -EINVAL;
-		}
-		reg = fdt_getprop(gd->fdt_blob, offset, "reg", NULL);
-		if (!reg) {
-			debug("%s: cannot find reg property in syscon node\n",
-			      __func__);
-			return -EINVAL;
-		}
-		priv->sysctl_reg = fdt_translate_address((void *)gd->fdt_blob,
-							 offset, reg);
-	} else
-		priv->sysctl_reg -= 0x30;
+	offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "syscon");
+	if (offset < 0) {
+		debug("%s: cannot find syscon node\n", __func__);
+		return -EINVAL;
+	}
+	reg = fdt_getprop(gd->fdt_blob, offset, "reg", NULL);
+	if (!reg) {
+		debug("%s: cannot find reg property in syscon node\n",
+		      __func__);
+		return -EINVAL;
+	}
+	priv->sysctl_reg = fdt_translate_address((void *)gd->fdt_blob,
+						 offset, reg);
 	if (priv->sysctl_reg == FDT_ADDR_T_NONE) {
 		debug("%s: Cannot find syscon base address\n", __func__);
 		return -EINVAL;
@@ -841,10 +823,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
 	priv->phyaddr = -1;
 	priv->use_internal_phy = false;
 
-	offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy");
-	if (offset < 0)
-		offset = fdtdec_lookup_phandle(gd->fdt_blob, node,
-					       "phy-handle");
+	offset = fdtdec_lookup_phandle(gd->fdt_blob, node, "phy-handle");
 	if (offset < 0) {
 		debug("%s: Cannot find PHY address\n", __func__);
 		return -EINVAL;
@@ -871,17 +850,12 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
 	}
 
 	if (priv->variant == H3_EMAC) {
-		if (fdt_getprop(gd->fdt_blob, node,
-				"allwinner,use-internal-phy", NULL))
-			priv->use_internal_phy = true;
-		else {
-			int parent = fdt_parent_offset(gd->fdt_blob, offset);
+		int parent = fdt_parent_offset(gd->fdt_blob, offset);
 
-			if (parent >= 0 &&
-			    !fdt_node_check_compatible(gd->fdt_blob, parent,
-					"allwinner,sun8i-h3-mdio-internal"))
-				priv->use_internal_phy = true;
-		}
+		if (parent >= 0 &&
+		    !fdt_node_check_compatible(gd->fdt_blob, parent,
+				"allwinner,sun8i-h3-mdio-internal"))
+			priv->use_internal_phy = true;
 	}
 
 	priv->interface = pdata->phy_interface;
Signature · 1 line
2.14.1
#9 lore raw

PATCH v3 9/20 sunxi: disable direct MMC environment for 64 bit boards

In reply to Andre Przywara

Since the dawn of time for the Allwinner support in mainline U-Boot we store the environment to the SD card and write directly at 544KB from the beginning of the device. This leads to problems when the U-Boot proper image grows beyond 504KB and eventually overlaps. With one release of having the environment preferably in a FAT partition, let's now turn off the MMC variant fallback, so we get back all the space we need to implement features.
In case someone desperately needs to turn direct MMC environment back on, let's move that to 896KB (128K below 1MB), so that we won't be easily limited anymore.

---
 env/Kconfig                    | 5 +++--
 include/configs/sunxi-common.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
env/Kconfig +3 -2
index a3c6298273..b404855542 100644
@@ -152,7 +152,7 @@ config ENV_IS_IN_MMC
 	bool "Environment in an MMC device"
 	depends on !CHAIN_OF_TRUST
 	depends on MMC
-	default y if ARCH_SUNXI
+	default y if ARCH_SUNXI && !ARM64
 	default y if ARCH_EXYNOS4
 	default y if MX6SX || MX7D
 	default y if TEGRA30 || TEGRA124
@@ -443,7 +443,8 @@ config ENV_OFFSET
 	hex "Environment Offset"
 	depends on !ENV_IS_IN_UBI
 	depends on !ENV_IS_NOWHERE
-	default 0x88000 if ARCH_SUNXI
+	default 0x88000 if ARCH_SUNXI && !ARM64
+	default 0xe0000 if ARCH_SUNXI && ARM64
 	help
 	  Offset from the start of the device (or partition)
 
include/configs/sunxi-common.h +1 -1
index e4e7c22778..1c881286dd 100644
@@ -148,7 +148,7 @@
  * (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)), but the value will be used
  * directly in a makefile, without the preprocessor expansion.
  */
-#define CONFIG_BOARD_SIZE_LIMIT		0x7e000
+#define CONFIG_BOARD_SIZE_LIMIT		0xd6000
 #endif
 
 #if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1
Signature · 1 line
2.14.1
#10 lore raw

PATCH v3 9/20 sunxi: disable direct MMC environment for 64 bit boards

Hi,

Quoted 22 lines · Andre Przywara

Since the dawn of time for the Allwinner support in mainline U-Boot we store the environment to the SD card and write directly at 544KB from the beginning of the device. This leads to problems when the U-Boot proper image grows beyond 504KB and eventually overlaps. With one release of having the environment preferably in a FAT partition, let's now turn off the MMC variant fallback, so we get back all the space we need to implement features.
In case someone desperately needs to turn direct MMC environment back on, let's move that to 896KB (128K below 1MB), so that we won't be easily limited anymore.

---
 env/Kconfig                    | 5 +++--
 include/configs/sunxi-common.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
env/Kconfig +0 -0
index a3c6298273..b404855542 100644

env/Kconfig config ENV_IS_IN_MMC · line 155

Quoted 5 lines
env/Kconfig +1 -1
@@ -152,7 +152,7 @@ config ENV_IS_IN_MMC
 	bool "Environment in an MMC device"
 	depends on !CHAIN_OF_TRUST
 	depends on MMC
-	default y if ARCH_SUNXI
+	default y if ARCH_SUNXI && !ARM64

I'd go even further and remove it for everyone.

env/Kconfig config ENV_OFFSET · line 447

Quoted 10 lines
env/Kconfig +2 -1
 	default y if ARCH_EXYNOS4
 	default y if MX6SX || MX7D
 	default y if TEGRA30 || TEGRA124
@@ -443,7 +443,8 @@ config ENV_OFFSET
 	hex "Environment Offset"
 	depends on !ENV_IS_IN_UBI
 	depends on !ENV_IS_NOWHERE
-	default 0x88000 if ARCH_SUNXI
+	default 0x88000 if ARCH_SUNXI && !ARM64
+	default 0xe0000 if ARCH_SUNXI && ARM64

However, I'm not sure why that would be needed. I would rather keep the old value to have an easy fallback to the old environment, given that you disable a few things afterwards.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180302/0c622c23/attachment.sig>
#11 lore raw

PATCH v3 9/20 sunxi: disable direct MMC environment for 64 bit boards

Hi,

Quoted 20 lines · Maxime Ripard

Hi,

Quoted 17 lines · Andre Przywara

Since the dawn of time for the Allwinner support in mainline U-Boot we store the environment to the SD card and write directly at 544KB from the beginning of the device. This leads to problems when the U-Boot proper image grows beyond 504KB and eventually overlaps. With one release of having the environment preferably in a FAT partition, let's now turn off the MMC variant fallback, so we get back all the space we need to implement features.
In case someone desperately needs to turn direct MMC environment back on, let's move that to 896KB (128K below 1MB), so that we won't be easily limited anymore.

---
 env/Kconfig                    | 5 +++--
 include/configs/sunxi-common.h | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
Quoted 12 lines

env/Kconfig config ENV_IS_IN_MMC · line 155

Quoted 10 lines
env/Kconfig +1 -1
index a3c6298273..b404855542 100644
@@ -152,7 +152,7 @@ config ENV_IS_IN_MMC
 	bool "Environment in an MMC device"
 	depends on !CHAIN_OF_TRUST
 	depends on MMC
-	default y if ARCH_SUNXI
+	default y if ARCH_SUNXI && !ARM64

I'd go even further and remove it for everyone.

Fine, if you say so!

Quoted 15 lines

env/Kconfig config ENV_OFFSET · line 447

Quoted 11 lines
env/Kconfig +2 -1
 	default y if ARCH_EXYNOS4
 	default y if MX6SX || MX7D
 	default y if TEGRA30 || TEGRA124
@@ -443,7 +443,8 @@ config ENV_OFFSET
 	hex "Environment Offset"
 	depends on !ENV_IS_IN_UBI
 	depends on !ENV_IS_NOWHERE
-	default 0x88000 if ARCH_SUNXI
+	default 0x88000 if ARCH_SUNXI && !ARM64
+	default 0xe0000 if ARCH_SUNXI && ARM64

However, I'm not sure why that would be needed. I would rather keep the old value to have an easy fallback to the old environment, given that you disable a few things afterwards.

Yeah, fair enough. Wasn't so sure about it anyway.

Cheers,
Andre.

#12 lore raw

PATCH v3 10/20 sunxi: revert disabling of features

In reply to Andre Przywara

In January some commits were introduced to mitigate the U-Boot image size issues we encountered on sunxi builds.
Now with the MMC environment removed we can bring them back, as we practically don't have a size limit anymore.

---
 cmd/Kconfig           | 5 -----
 drivers/video/Kconfig | 2 --
 lib/Kconfig           | 1 -
 3 files changed, 8 deletions(-)
cmd/Kconfig +0 -5
index 136836d146..27086df09b 100644
@@ -426,7 +426,6 @@ menu "Memory commands"
 config CMD_CRC32
 	bool "crc32"
 	select HASH
-	default n if ARCH_SUNXI
 	default y
 	help
 	  Compute CRC32.
@@ -568,7 +567,6 @@ config CMD_LZMADEC
 
 config CMD_UNZIP
 	bool "unzip"
-	default n if ARCH_SUNXI
 	default y if CMD_BOOTI
 	help
 	  Uncompress a zip-compressed memory region.
@@ -780,14 +778,12 @@ config CMD_I2C
 
 config CMD_LOADB
 	bool "loadb"
-	default n if ARCH_SUNXI
 	default y
 	help
 	  Load a binary file over serial line.
 
 config CMD_LOADS
 	bool "loads"
-	default n if ARCH_SUNXI
 	default y
 	help
 	  Load an S-Record file over serial line
@@ -1187,7 +1183,6 @@ config CMD_GETTIME
 # TODO: rename to CMD_SLEEP
 config CMD_MISC
 	bool "sleep"
-	default n if ARCH_SUNXI
 	default y
 	help
 	  Delay execution for some time
drivers/video/Kconfig +0 -2
index 2fc0defcd0..45a105db06 100644
@@ -38,7 +38,6 @@ config BACKLIGHT_GPIO
 config VIDEO_BPP8
 	bool "Support 8-bit-per-pixel displays"
 	depends on DM_VIDEO
-	default n if ARCH_SUNXI
 	default y if DM_VIDEO
 	help
 	  Support drawing text and bitmaps onto a 8-bit-per-pixel display.
@@ -49,7 +48,6 @@ config VIDEO_BPP8
 config VIDEO_BPP16
 	bool "Support 16-bit-per-pixel displays"
 	depends on DM_VIDEO
-	default n if ARCH_SUNXI
 	default y if DM_VIDEO
 	help
 	  Support drawing text and bitmaps onto a 16-bit-per-pixel display.
lib/Kconfig +0 -1
index 4fd41c4282..ab581f172f 100644
@@ -66,7 +66,6 @@ config PANIC_HANG
 
 config REGEX
 	bool "Enable regular expression support"
-	default n if ARCH_SUNXI
 	default y if NET
 	help
 	  If this variable is defined, U-Boot is linked against the
Signature · 1 line
2.14.1
#13 lore raw

PATCH v3 11/20 sunxi: DT: A64: update device tree file for Allwinner A64 SoC

In reply to Andre Przywara

Updates the device tree file from the the Linux tree as of v4.15-rc9, exactly Linux commit:
commit 16416084e06e1ebff51a9e7721a8cc4ccc186f28

Author: Corentin Labbe <[email protected]>
Date:   Tue Oct 31 09:19:15 2017 +0100

arm64: dts: allwinner: add snps,dwmac-mdio compatible to emac/mdio

This also pulls in the newly required include files for the clock and reset bindings.

---
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi |  61 ++-----
 arch/arm/dts/sun50i-a64.dtsi                    | 204 ++++++++++++++++++++----
 include/dt-bindings/clock/sun8i-r-ccu.h         |  59 +++++++
 include/dt-bindings/reset/sun8i-r-ccu.h         |  53 ++++++
 4 files changed, 299 insertions(+), 78 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 +176 -28

342 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.1
#14 lore raw

PATCH v3 12/20 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.15-rc9, exactly Linux commit:
commit bdfe4cebea11476d278b1b98dd0f7cdac8269d62

Author: Icenowy Zheng <[email protected]>
Date:   Fri Nov 10 17:26:54 2017 +0800

arm64: allwinner: a64: add Ethernet PHY regulator for several boards

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.

---
 arch/arm/dts/axp803.dtsi                        | 150 ++++++++++++++++++++
 arch/arm/dts/sun50i-a64-bananapi-m64.dts        | 161 +++++++++++++++++++--
 arch/arm/dts/sun50i-a64-nanopi-a64.dts          | 108 ++++++++++++--
 arch/arm/dts/sun50i-a64-olinuxino.dts           | 131 +++++++++++++++--
 arch/arm/dts/sun50i-a64-orangepi-win.dts        |   7 +-
 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              | 178 +++++++++++++++++++++++-
 8 files changed, 716 insertions(+), 56 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 +150 -0
new file mode 100644
index 0000000000..ff8af52743
@@ -0,0 +1,150 @@
+/*
+ * 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";
+		};
+	};
+};
arch/arm/dts/sun50i-a64-bananapi-m64.dts +152 -9

213 lines not on this page · raw message

arch/arm/dts/sun50i-a64-nanopi-a64.dts +100 -8

126 lines not on this page · raw message

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

148 lines not on this page · raw message

arch/arm/dts/sun50i-a64-orangepi-win.dts +4 -3
index cf76c35237..5f8ff4017d 100644
@@ -67,7 +67,7 @@
 };
 
 &ehci1 {
-       status = "okay";
+	status = "okay";
 };
 
 &mmc0 {
@@ -80,7 +80,7 @@
 };
 
 &ohci1 {
-       status = "okay";
+	status = "okay";
 };
 
 &uart0 {
@@ -90,5 +90,6 @@
 };
 
 &usbphy {
-       status = "okay";
+	status = "okay";
 };
+
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 +171 -7

222 lines not on this page · raw message

Signature · 1 line
2.14.1
#15 lore raw

PATCH v3 13/20 Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

In reply to Andre Przywara

Linux kernels before 4.12-rc1 don't know about the AXP803 PMIC, so can't enable the MMC driver with the current DT anymore, because that now depends on this regulator.
To restore compatiblity with older kernels (where MMC worked fine without explicit AXP support), restore the former fixed-regulator. This is no technical disadvantage, as the MMC power rail is actually VDD-SYS, which drives most of the rest of the board, so can't be turned off anyway. To underline this, this DCDC1 rail is marked as "regulator-always-on" in the DT.

This reverts Linux commit 3f241bfa60bdc9c4fde63fa6664a8ce00fd668c6.

Author: Jagan Teki <[email protected]>
Date:   Sat Aug 12 11:10:02 2017 +0530

arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

---
 arch/arm/dts/sun50i-a64-pine64.dts | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/arm/dts/sun50i-a64-pine64.dts +8 -1
index 604cdaedac..122b5d8e54 100644
@@ -62,6 +62,13 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_vcc3v3: vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
 };
 
 &ehci0 {
@@ -102,7 +109,7 @@
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
-	vmmc-supply = <&reg_dcdc1>;
+	vmmc-supply = <&reg_vcc3v3>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
 	cd-inverted;
 	disable-wp;
Signature · 1 line
2.14.1
#16 lore raw

PATCH v3 13/20 Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

Quoted 3 lines · Andre Przywara

Linux kernels before 4.12-rc1 don't know about the AXP803 PMIC, so can't enable the MMC driver with the current DT anymore, because that now depends on this regulator.

Given that only I2C, USB and MMC were supported at the time, is it really worth it? There's a lot of incentive to move to a newer kernel given the minimal support it had at the time.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180302/ccc29378/attachment.sig>
#17 lore raw

PATCH v3 13/20 Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

Hi,

Quoted 8 lines · Maxime Ripard
Quoted 3 lines · Andre Przywara

Linux kernels before 4.12-rc1 don't know about the AXP803 PMIC, so can't enable the MMC driver with the current DT anymore, because that now depends on this regulator.

Given that only I2C, USB and MMC were supported at the time, is it really worth it? There's a lot of incentive to move to a newer kernel given the minimal support it had at the time.

Yeah, this is somewhat true, although serial, USB and MMC are somewhat enough if one uses a USB Ethernet or WiFi adapter. And the kernel choice might not always a decision of the user (thinking of distributions here). But I was actually unsure about this as well, and wanted to hear some opinions.

One thing that comes to mind is other OSes. Does anyone know how if for instance FreeBSD supports the AXP and its Linux bindings? The whole goal of this series is to allow booting OSes with U-Boot's DT copy ($fdtcontroladdr), so if this patch would make their life easier, it might be worth it.

Regarding the whole forward/backward compatibility:
I clearly see the difficulty in coming up with a "perfect" DT from day one, especially for badly documented SoCs, where mainlining is driven by hobbyists. So I was wondering if we introduce a grace period, where we declare the DT "unstable" or "subject to incompatible changes" for some releases (not too many). In hindsight we might declare 4.12 the stable DT base for the A64, for instance.
This would allow us to start upstreaming early, with a small feature set only (just serial + clocks + pinctrl, as for the H6). Additional features (PMIC) might then add small incompatibilities (like this one here), until we are reasonably confident about the DT.
Does that sound useful?

So I am not insisting on this patch, but wanted to point out the problems that those seemingly innocent DT changes create and would be happy if we can at least try to avoid them in the future.

Cheers,
Andre.

#18 lore raw

[U-Boot] [linux-sunxi] Re: [PATCH v3 13/20] Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

Hi,

Quoted 4 lines · Andre Przywara

Regarding the whole forward/backward compatibility:
I clearly see the difficulty in coming up with a "perfect" DT from day one, especially for badly documented SoCs, where mainlining is driven by hobbyists. So I was wondering if we introduce a grace period, where we

Quoted 8 lines

declare the DT "unstable" or "subject to incompatible changes" for some releases (not too many). In hindsight we might declare 4.12 the stable DT base for the A64, for instance.
This would allow us to start upstreaming early, with a small feature set only (just serial + clocks + pinctrl, as for the H6). Additional features (PMIC) might then add small incompatibilities (like this one here), until we are reasonably confident about the DT.
Does that sound useful?

Kind of "staging" for DT ?

Signature · 1 line
Vincent Legoll
#19 lore raw

[U-Boot] [linux-sunxi] Re: [PATCH v3 13/20] Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

Hi,

Quoted 16 lines · Vincent Legoll

Hi,

Quoted 4 lines · Andre Przywara

Regarding the whole forward/backward compatibility:
I clearly see the difficulty in coming up with a "perfect" DT from day one, especially for badly documented SoCs, where mainlining is driven by hobbyists. So I was wondering if we introduce a grace period, where we

Quoted 8 lines

declare the DT "unstable" or "subject to incompatible changes" for some releases (not too many). In hindsight we might declare 4.12 the stable DT base for the A64, for instance.
This would allow us to start upstreaming early, with a small feature set only (just serial + clocks + pinctrl, as for the H6). Additional features (PMIC) might then add small incompatibilities (like this one here), until we are reasonably confident about the DT.
Does that sound useful?

Quoted 1 line

Kind of "staging" for DT ?

Yeah, somewhat, though I would like to see this moved out of the Linux context ;-) Actually this would also simplify collaboration with other stakeholders (U-Boot, *BSD, Your-toy-OS), as they can participate in the discussion without being bound to some particular release cycle or special upstreaming process.
And ideally the DT would not be in the Linux tree in the first place, to not give people the idea of it being a "Linux config file".

Cheers,
Andre.

#20 lore raw

PATCH v3 13/20 Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

In reply to Andre Przywara
Quoted 18 lines · On Fri, 2 Mar 2018 16:24:22 +0000 Andre Przywara <[email protected]> wrote:

Hi,

Quoted 8 lines · Maxime Ripard
Quoted 3 lines · Andre Przywara

Linux kernels before 4.12-rc1 don't know about the AXP803 PMIC, so can't enable the MMC driver with the current DT anymore, because that now depends on this regulator.

Given that only I2C, USB and MMC were supported at the time, is it really worth it? There's a lot of incentive to move to a newer kernel given the minimal support it had at the time.

Yeah, this is somewhat true, although serial, USB and MMC are somewhat enough if one uses a USB Ethernet or WiFi adapter. And the kernel choice might not always a decision of the user (thinking of distributions here). But I was actually unsure about this as well, and wanted to hear some opinions.

Quoted 5 lines

One thing that comes to mind is other OSes. Does anyone know how if for instance FreeBSD supports the AXP and its Linux bindings? The whole goal of this series is to allow booting OSes with U-Boot's DT copy ($fdtcontroladdr), so if this patch would make their life easier, it might be worth it.

Not yet but I started the work a few days ago and we should have a
driver soon.

Quoted 23 lines

Regarding the whole forward/backward compatibility:
I clearly see the difficulty in coming up with a "perfect" DT from day one, especially for badly documented SoCs, where mainlining is driven by hobbyists. So I was wondering if we introduce a grace period, where we declare the DT "unstable" or "subject to incompatible changes" for some releases (not too many). In hindsight we might declare 4.12 the stable DT base for the A64, for instance.
This would allow us to start upstreaming early, with a small feature set only (just serial + clocks + pinctrl, as for the H6). Additional features (PMIC) might then add small incompatibilities (like this one here), until we are reasonably confident about the DT.
Does that sound useful?

So I am not insisting on this patch, but wanted to point out the problems that those seemingly innocent DT changes create and would be happy if we can at least try to avoid them in the future.

Cheers,
Andre.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

Signature · 1 line
Emmanuel Vadot <[email protected]> <[email protected]>
#21 lore raw

PATCH v3 13/20 Revert: arm64: allwinner: a64: pine64: Use dcdc1 regulator for mmc0

In reply to Andre Przywara

Hi,

Quoted 16 lines · Andre Przywara
Quoted 8 lines · Maxime Ripard
Quoted 3 lines · Andre Przywara

Linux kernels before 4.12-rc1 don't know about the AXP803 PMIC, so can't enable the MMC driver with the current DT anymore, because that now depends on this regulator.

Given that only I2C, USB and MMC were supported at the time, is it really worth it? There's a lot of incentive to move to a newer kernel given the minimal support it had at the time.

Yeah, this is somewhat true, although serial, USB and MMC are somewhat enough if one uses a USB Ethernet or WiFi adapter. And the kernel choice might not always a decision of the user (thinking of distributions here). But I was actually unsure about this as well, and wanted to hear some opinions.

Quoted 5 lines

One thing that comes to mind is other OSes. Does anyone know how if for instance FreeBSD supports the AXP and its Linux bindings? The whole goal of this series is to allow booting OSes with U-Boot's DT copy ($fdtcontroladdr), so if this patch would make their life easier, it might be worth it.

I thought the DT was only about the hardware (and the firmware to some extent) and not about a particular implementation?

Quoted 4 lines

Regarding the whole forward/backward compatibility:
I clearly see the difficulty in coming up with a "perfect" DT from day one, especially for badly documented SoCs, where mainlining is driven by hobbyists. So I was wondering if we introduce a grace period, where we

Quoted 8 lines

declare the DT "unstable" or "subject to incompatible changes" for some releases (not too many). In hindsight we might declare 4.12 the stable DT base for the A64, for instance.
This would allow us to start upstreaming early, with a small feature set only (just serial + clocks + pinctrl, as for the H6). Additional features (PMIC) might then add small incompatibilities (like this one here), until we are reasonably confident about the DT.
Does that sound useful?

Well, yeah. It's one of reasons I listed when the DT stability was discussed. I'm glad we reached an agreement on this :)

On a more serious basis, while that would sound reasonable, there's also the issue that you're basically never done, so that period might extend indefinitely.

Even on the older SoCs that we first introduce 5 years ago we have to deal with remodelling the bindings, for mostly three reasons:
- We have some bindings that we were aware were suboptimal, and the stability lockdown took us by surprise, and we got stuck with bindings no one really liked.

- We have been ignoring some issues for quite some time that will need to get fixed eventually. For example, the power domains in the A31 are in this situation: since we didn't have any device that would allow us to test it, and since we couldn't use the genpd code for the CPUs in Linux at the time, we don't have any power domains described. However, there will probably be a time where we will actually need it for example to deal with the GPU.

- We are still discovering some quirks that need to remodel the DT. The DMA bus offset is a good example of that.

For the first one, I guess you could say that it's a bullet we have to bite. No binding will ever be perfect, and we'll always have to remodel things as we discover new usecases.

However, the two others are really the one that prevent you from saying "that's it, we're done" at a particular moment in time.

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180309/b0c1d567/attachment-0001.sig>
#22 lore raw

PATCH v3 14/20 sunxi: dts: A64 boards: Use fixed regulator for mmc0

In reply to Andre Przywara

Linux kernels before 4.12-rc1 don't know about the AXP803 PMIC, so can't enable the MMC driver with the current DT anymore, because that now depends on a driver for this regulator.
To restore compatiblity with older kernels (where MMC worked fine without explicit AXP support), restore the former fixed-regulator. This is no technical disadvantage, as the MMC power rail is actually VDD-SYS, which drives most of the rest of the board, so can't be turned off anyway. To underline this, this DCDC1 rail is marked as "regulator-always-on" in the DT.
This affects the BananaPi-M64, NanoPi-A64, Olinuxo-A64.

---
 arch/arm/dts/sun50i-a64-bananapi-m64.dts | 11 +++++++++--
 arch/arm/dts/sun50i-a64-nanopi-a64.dts   |  9 ++++++++-
 arch/arm/dts/sun50i-a64-olinuxino.dts    |  9 ++++++++-
 3 files changed, 25 insertions(+), 4 deletions(-)
arch/arm/dts/sun50i-a64-bananapi-m64.dts +9 -2
index 4a8d3f83a3..e84855d633 100644
@@ -60,6 +60,13 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	reg_vcc3v3: vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
@@ -99,7 +106,7 @@
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
-	vmmc-supply = <&reg_dcdc1>;
+	vmmc-supply = <&reg_vcc3v3>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
 	cd-inverted;
 	disable-wp;
@@ -129,7 +136,7 @@
 &mmc2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc2_pins>;
-	vmmc-supply = <&reg_dcdc1>;
+	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <8>;
 	non-removable;
 	cap-mmc-hw-reset;
arch/arm/dts/sun50i-a64-nanopi-a64.dts +8 -1
index 2beef9e6cb..6dedbfe609 100644
@@ -57,6 +57,13 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_vcc3v3: vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
 };
 
 &ehci0 {
@@ -81,7 +88,7 @@
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
-	vmmc-supply = <&reg_dcdc1>;
+	vmmc-supply = <&reg_vcc3v3>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
 	cd-inverted;
 	disable-wp;
arch/arm/dts/sun50i-a64-olinuxino.dts +8 -1
index 338e786155..c88ec4e281 100644
@@ -57,12 +57,19 @@
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_vcc3v3: vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
 };
 
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>;
-	vmmc-supply = <&reg_dcdc1>;
+	vmmc-supply = <&reg_vcc3v3>;
 	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
 	cd-inverted;
 	disable-wp;
Signature · 1 line
2.14.1
#23 lore raw

PATCH v3 15/20 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:
commit 776245ae02f63ba2b94596b892c597676e190e78

Author: Corentin Labbe <[email protected]>
Date:   Tue Oct 31 09:19:11 2017 +0100

ARM: dts: sunxi: h3/h5: represent the mdio switch used by sun8i-h3-emac

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 (temporarily) fix up the BananaPi-M2 board .dts, to maintain bisectability.

---
 arch/arm/dts/sun50i-h5.dtsi                |  36 +-
 arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts |   2 +-
 arch/arm/dts/sun8i-h3.dtsi                 | 521 ++-------------------
 arch/arm/dts/sunxi-h3-h5.dtsi              | 698 +++++++++++++++++++++++++++++
 4 files changed, 766 insertions(+), 491 deletions(-)
 create mode 100644 arch/arm/dts/sunxi-h3-h5.dtsi
arch/arm/dts/sun50i-h5.dtsi +27 -9
index c052f31131..18d45a96db 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 {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
 		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,10 +98,6 @@
 	compatible = "allwinner,sun50i-h5-ccu";
 };
 
-&gic {
-	compatible = "arm,gic-400";
-};
-
 &mmc0 {
 	compatible = "allwinner,sun50i-h5-mmc",
 		     "allwinner,sun50i-a64-mmc";
@@ -104,6 +122,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-h3-bananapi-m2-plus.dts +1 -1
index f3b1d5f6db..06fddaae8e 100644
@@ -185,7 +185,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.dtsi +40 -481

538 lines not on this page · raw message

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

698 lines not on this page · raw message

Signature · 1 line
2.14.1
#24 lore raw

PATCH v3 16/20 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.15-rc9, exactly Linux commit:
commit f88e9301948173dd35afad4a6939092c7f269aed

Author: Sergey Matyukevich <[email protected]>
Date:   Fri Nov 3 22:58:54 2017 +0300

arm64: dts: orange-pi-zero-plus2: fix sdcard detect

---
 arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts    | 105 ++++++++++++++--
 arch/arm/dts/sun50i-h5-nanopi-neo2.dts         |  89 +++++++++++--
 arch/arm/dts/sun50i-h5-orangepi-pc2.dts        | 165 +++++++++++++++++++------
 arch/arm/dts/sun50i-h5-orangepi-prime.dts      | 164 +++++++++++++++++++++---
 arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts |   7 +-
 5 files changed, 455 insertions(+), 75 deletions(-)
arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts +96 -9
index f1406c224b..7c028af58f 100644
@@ -1,18 +1,18 @@
 /*
  * Copyright (C) 2017 Antony Antony <[email protected]>
- * 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.
@@ -42,13 +42,14 @@
  */
 
 /dts-v1/;
-
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
-	model = "FriendlyARM NanoPi NEO Plus 2";
+	model = "FriendlyARM NanoPi NEO Plus2";
 	compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
 
 	aliases {
@@ -59,15 +60,76 @@
 		stdout-path = "serial0:115200n8";
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		pwr {
+			label = "nanopi:green:pwr";
+			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		status {
+			label = "nanopi:red:status";
+			gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	reg_gmac_3v3: gmac-3v3 {
+		compatible = "regulator-fixed";
+		pinctrl-names = "default";
+		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>;
+	};
+
 	reg_vcc3v3: vcc3v3 {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
 	};
+
+	vdd_cpux: gpio-regulator {
+		compatible = "regulator-gpio";
+		pinctrl-names = "default";
+		regulator-name = "vdd-cpux";
+		regulator-type = "voltage";
+		regulator-boot-on;
+		regulator-always-on;
+		regulator-min-microvolt = <1100000>;
+		regulator-max-microvolt = <1300000>;
+		regulator-ramp-delay = <50>; /* 4ms */
+		gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
+		gpios-states = <0x1>;
+		states = <1100000 0x0
+			  1300000 0x1>;
+	};
+
+	wifi_pwrseq: wifi_pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		pinctrl-names = "default";
+		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+		post-power-on-delay-ms = <200>;
+	};
 };
 
-&ehci1 {
+&codec {
+	allwinner,audio-routing =
+		"Line Out", "LINEOUT",
+		"MIC1", "Mic",
+		"Mic",  "MBIAS";
+	status = "okay";
+};
+
+&ehci0 {
+	status = "okay";
+};
+
+&ehci3 {
 	status = "okay";
 };
 
@@ -76,11 +138,26 @@
 	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
 	vmmc-supply = <&reg_vcc3v3>;
 	bus-width = <4>;
-	cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-	cd-inverted;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
 	status = "okay";
 };
 
+&mmc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins_a>;
+	vmmc-supply = <&reg_vcc3v3>;
+	vqmmc-supply = <&reg_vcc3v3>;
+	mmc-pwrseq = <&wifi_pwrseq>;
+	bus-width = <4>;
+	non-removable;
+	status = "okay";
+
+	brcmf: wifi at 1 {
+		reg = <1>;
+		compatible = "brcm,bcm4329-fmac";
+	};
+};
+
 &mmc2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc2_8bit_pins>;
@@ -91,7 +168,11 @@
 	status = "okay";
 };
 
-&ohci1 {
+&ohci0 {
+	status = "okay";
+};
+
+&ohci3 {
 	status = "okay";
 };
 
@@ -101,6 +182,12 @@
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "host";
+	status = "okay";
+};
+
 &usbphy {
+	/* USB Type-A ports' VBUS is always on */
 	status = "okay";
 };
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 +130 -35

224 lines not on this page · raw message

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

225 lines not on this page · raw message

arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts +1 -6
index 3f4baba310..a42fd79a62 100644
@@ -46,7 +46,6 @@
 
 #include <dt-bindings/gpio/gpio.h>
 
-
 / {
 	model = "OrangePi Zero Plus2";
 	compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
@@ -68,15 +67,11 @@
 };
 
 &mmc0 {
-	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>;
-	cd-inverted;
+	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
 	status = "okay";
 };
 
Signature · 1 line
2.14.1
#25 lore raw

PATCH v3 17/20 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.15-rc9, exactly Linux commit:
commit 4904337fe34fa7fc529d6f4d9ee8b96fe7db310a

Author: Corentin Labbe <[email protected]>
Date:   Tue Oct 31 09:19:12 2017 +0100

ARM: dts: sunxi: Restore EMAC changes (boards)

---
 arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts | 76 +++++++++++++++++----------
 arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts   | 71 +++++++++++++++++++++++++
 arch/arm/dts/sun8i-h3-nanopi-m1.dts        |  6 +++
 arch/arm/dts/sun8i-h3-nanopi-neo-air.dts   |  1 -
 arch/arm/dts/sun8i-h3-orangepi-2.dts       | 60 ++++++++++++---------
 arch/arm/dts/sun8i-h3-orangepi-lite.dts    | 25 ++++-----
 arch/arm/dts/sun8i-h3-orangepi-one.dts     | 65 +++++++++++++++++------
 arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts |  9 +++-
 arch/arm/dts/sun8i-h3-orangepi-pc.dts      | 83 ++++++++++++++++++++++--------
 arch/arm/dts/sun8i-h3-orangepi-plus.dts    | 29 +++++------
 arch/arm/dts/sun8i-h3-orangepi-plus2e.dts  | 15 +-----
 11 files changed, 302 insertions(+), 138 deletions(-)
arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts +49 -27
index 06fddaae8e..f2292deaa5 100644
@@ -46,13 +46,13 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Banana Pi BPI-M2-Plus";
 	compatible = "sinovoip,bpi-m2-plus", "allwinner,sun8i-h3";
 
 	aliases {
+		ethernet0 = &emac;
 		serial0 = &uart0;
 		serial1 = &uart1;
 	};
@@ -64,7 +64,6 @@
 	leds {
 		compatible = "gpio-leds";
 		pinctrl-names = "default";
-		pinctrl-0 = <&pwr_led_bpi_m2p>;
 
 		pwr_led {
 			label = "bananapi-m2-plus:red:pwr";
@@ -76,7 +75,6 @@
 	gpio_keys {
 		compatible = "gpio-keys";
 		pinctrl-names = "default";
-		pinctrl-0 = <&sw_r_bpi_m2p>;
 
 		sw4 {
 			label = "power";
@@ -85,14 +83,27 @@
 		};
 	};
 
+	reg_gmac_3v3: gmac-3v3 {
+		      compatible = "regulator-fixed";
+		      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>;
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		pinctrl-names = "default";
-		pinctrl-0 = <&wifi_en_bpi_m2p>;
 		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &ehci1 {
 	status = "okay";
 };
@@ -101,6 +112,24 @@
 	status = "okay";
 };
 
+&emac {
+	pinctrl-names = "default";
+	pinctrl-0 = <&emac_rgmii_pins>;
+	phy-supply = <&reg_gmac_3v3>;
+	phy-handle = <&ext_rgmii_phy>;
+	phy-mode = "rgmii";
+
+	allwinner,leds-active-low;
+	status = "okay";
+};
+
+&external_mdio {
+	ext_rgmii_phy: ethernet-phy at 1 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0>;
+	};
+};
+
 &ir {
 	pinctrl-names = "default";
 	pinctrl-0 = <&ir_pins_a>;
@@ -127,7 +156,7 @@
 	non-removable;
 	status = "okay";
 
-	brcmf: bcrmf at 1 {
+	brcmf: wifi at 1 {
 		reg = <1>;
 		compatible = "brcm,bcm4329-fmac";
 		interrupt-parent = <&pio>;
@@ -146,6 +175,10 @@
 	status = "okay";
 };
 
+&ohci0 {
+	status = "okay";
+};
+
 &ohci1 {
 	status = "okay";
 };
@@ -154,27 +187,9 @@
 	status = "okay";
 };
 
-&r_pio {
-	pwr_led_bpi_m2p: led_pins at 0 {
-		allwinner,pins = "PL10";
-		allwinner,function = "gpio_out";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-	};
-
-	sw_r_bpi_m2p: key_pins at 0 {
-		allwinner,pins = "PL3";
-		allwinner,function = "gpio_in";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-	};
-
-	wifi_en_bpi_m2p: wifi_en_pin {
-		allwinner,pins = "PL7";
-		allwinner,function = "gpio_out";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-	};
+&reg_usb0_vbus {
+	gpio = <&pio 3 11 GPIO_ACTIVE_HIGH>; /* PD11 */
+	status = "okay";
 };
 
 &uart0 {
@@ -189,7 +204,14 @@
 	status = "okay";
 };
 
+&usb_otg {
+	dr_mode = "otg";
+	status = "okay";
+};
+
 &usbphy {
-	/* USB VBUS is on as long as VCC-IO is on */
+	usb0_id_det-gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
+	usb0_vbus-supply = <&reg_usb0_vbus>;
+	/* USB host VBUS is on as long as VCC-IO is on */
 	status = "okay";
 };
arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts +71 -0

86 lines not on this page · raw message

arch/arm/dts/sun8i-h3-nanopi-m1.dts +6 -0
index ec63d104b4..3a2ccdb28a 100644
@@ -55,6 +55,12 @@
 	status = "okay";
 };
 
+&ir {
+	pinctrl-names = "default";
+	pinctrl-0 = <&ir_pins_a>;
+	status = "okay";
+};
+
 &ohci1 {
 	status = "okay";
 };
arch/arm/dts/sun8i-h3-nanopi-neo-air.dts +0 -1
index 3ba081c1f5..03ff6f8b93 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";
arch/arm/dts/sun8i-h3-orangepi-2.dts +37 -23

92 lines not on this page · raw message

arch/arm/dts/sun8i-h3-orangepi-lite.dts +9 -16
index 1550fee1ec..a70a1daf4e 100644
@@ -46,7 +46,6 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
 	model = "Xunlong Orange Pi Lite";
@@ -142,27 +141,21 @@
 };
 
 &pio {
-	leds_opc: led_pins at 0 {
-		allwinner,pins = "PA15";
-		allwinner,function = "gpio_out";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	leds_opc: led_pins {
+		pins = "PA15";
+		function = "gpio_out";
 	};
 };
 
 &r_pio {
-	leds_r_opc: led_pins at 0 {
-		allwinner,pins = "PL10";
-		allwinner,function = "gpio_out";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	leds_r_opc: led_pins {
+		pins = "PL10";
+		function = "gpio_out";
 	};
 
-	sw_r_opc: key_pins at 0 {
-		allwinner,pins = "PL3";
-		allwinner,function = "gpio_in";
-		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+	sw_r_opc: key_pins {
+		pins = "PL3";
+		function = "gpio_in";
 	};
 };
 
arch/arm/dts/sun8i-h3-orangepi-one.dts +48 -17

103 lines not on this page · raw message

arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts +7 -2
index 851fd2c2cc..a10281b455 100644
@@ -53,6 +53,11 @@
 	};
 };
 
+&emac {
+	/* LEDs changed to active high on the plus */
+	/delete-property/ allwinner,leds-active-low;
+};
+
 &mmc1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc1_pins_a>;
@@ -82,7 +87,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 +61 -22

130 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.1
#26 lore raw

PATCH v3 18/20 sunxi: DT: H3: update libre-cc board .dts file

In reply to Andre Przywara

Update the board DT file to match the updated h3.dtsi base. This file is not (yet?) in Linux, so we can't update from there directly.

---
 arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts +8 -0
index c8fd69f0a4..cb3ecddb33 100644
@@ -112,6 +112,10 @@
 	};
 };
 
+&ehci0 {
+	status = "okay";
+};
+
 &ehci1 {
 	status = "okay";
 };
@@ -147,6 +151,10 @@
 	status = "okay";
 };
 
+&ohci0 {
+	status = "okay";
+};
+
 &ohci1 {
 	status = "okay";
 };
Signature · 1 line
2.14.1
#27 lore raw

PATCH v3 19/20 sunxi: DT: H2+: update Opi-zero .dts

In reply to Andre Przywara

Update the .dts file for the OrangePi Zero board, using the H2+ SoC. This is as of v4.15-rc9, exactly Linux commit:
commit 4904337fe34fa7fc529d6f4d9ee8b96fe7db310a

Author: Corentin Labbe <[email protected]>
Date:   Tue Oct 31 09:19:12 2017 +0100

ARM: dts: sunxi: Restore EMAC changes (boards)

---
 arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 52 ++++++++++++++++++++++++++--
 1 file changed, 50 insertions(+), 2 deletions(-)
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts +50 -2
index e0efcb3ba3..6713d0f2b3 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";
 };
@@ -134,17 +139,60 @@
 	};
 };
 
+&mmc1_pins_a {
+	bias-pull-up;
+};
+
+&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 */
 };
Signature · 1 line
2.14.1
#28 lore raw

PATCH v3 20/20 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.

---
 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 e9fe71431c..429c757fa0 100644
@@ -367,7 +367,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 8ca43a6eac..cba392fb6c 100644
@@ -9,7 +9,7 @@ CONFIG_DRAM_ZQ=3881949
 CONFIG_DRAM_ODT_EN=y
 CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
-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_SPL=y
 # CONFIG_CMD_FLASH is not set
Signature · 1 line
2.14.1
#29 lore raw

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

In reply to Andre Przywara
Quoted 29 lines · Andre Przywara

This is an extended version of the EMAC DT binding update, this time including the full Linux DTs for all H3, H5 and A64 boards. Patch 01 should be merged *now*, to leave some hint in the README for the v2018.03 release. Without building ARM Trusted Firmware with DEBUG=0 many H5 boards and the Pine64 can't be built successfully at the moment.

The old v2 EMAC DT update series is in patches 02-08, it prepares U-Boot's EMAC driver for using the new DT binding used in Linux, also updates the DTs to the new EMAC DT node already.

This time I added patches to sync the whole U-Boot DT files for the mentioned SoCs with those from Linux. However this first requires lifting the space limit we currently have due to the raw MMC environment. Patch 09 disables that for 64 bit sunxi boards, to give us finally some space. Patch 10 consequently reverts the disabling of features we saw a few weeks ago to migitate the size problem.

Patches 11-20 then brings in the Linux DTs, split by SoCs, with the .dtsi files first, then the board files.

Merging the H3 and H5 device tree files brings in significant changes, also to the structure of the .dtsi files. However U-Boot's own DT usage is pretty limited, so it doesn't matter.

The huge benefit of syncing the DTs is that we can use U-Boot's DT copy to directly pass it to the kernel, avoiding to actually load a .dtb file from somewhere. To allows seamless and automatic UEFI booting, so distribution installer images should just work (TM).

Quoted 5 lines

As a goodie the final patch brings in the actual SoPine + baseboard DT files, which we were completely missing so far.

Please let me know if that looks good. I am happy to rearrange or squash patches, but I tried to avoid huge commits, for the sake of reviewability.

Apart from the comments on the two patches I already sent,

Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180302/f6621941/attachment.sig>