Skip to contentSkip to conversation

sunxi: A64/Pine64: update device tree from Linux

PATCH New Andre Przywara 3 participants 4 messages May 24, 2017 – Jun 1, 2017

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

PATCH v3 1/1 sunxi: A64/Pine64: update device tree from Linux

The Linux device tree for the Allwinner A64 SoC has changed a lot since the U-Boot version was merged.
Let's replace the current DT with a exact copy of the Linux one as of:
commit c6778ff813d2ca3e3c8733c87dc8b6831a64578b
Merge: 0ff4c01 3c0e3abd
Author: Linus Torvalds <[email protected]>
Date: Tue May 9 10:07:33 2017 -0700

This is the DT used in Linux 4.12-rc1.

Since U-Boot has an Ethernet driver (while Linux does not yet), we provide the required DT nodes for it in an ...-u-boot.dtsi file, to both mark them as U-Boot specific and to allow easier upgrading once Linux gets the driver and its own binding later.
Compared to the existing Ethernet DT nodes we just slightly tweak the clock and reset nodes in there to match the new bindings used by Linux for those.

---
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi    |  50 ++
 arch/arm/dts/sun50i-a64-pine64-plus.dts            |  26 +-
 arch/arm/dts/sun50i-a64-pine64.dts                 |  59 +-
 arch/arm/dts/sun50i-a64.dtsi                       | 639 ++++++---------------
 include/dt-bindings/clock/sun50i-a64-ccu.h         | 134 +++++
 .../dt-bindings/reset/sun50i-a64-ccu.h             | 109 ++--
 6 files changed, 489 insertions(+), 528 deletions(-)
 create mode 100644 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi
 create mode 100644 include/dt-bindings/clock/sun50i-a64-ccu.h
 rename arch/arm/dts/sun50i-a64-pine64-common.dtsi => include/dt-bindings/reset/sun50i-a64-ccu.h (52%)
arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi new file +50 -0
new file mode 100644
index 0000000..9c61bea
@@ -0,0 +1,50 @@
+/ {
+	aliases {
+		ethernet0 = &emac;
+	};
+
+	soc {
+		emac: ethernet at 01c30000 {
+			compatible = "allwinner,sun50i-a64-emac";
+			reg = <0x01c30000 0x2000>, <0x01c00030 0x4>;
+			reg-names = "emac", "syscon";
+			interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+			resets = <&ccu RST_BUS_EMAC>;
+			reset-names = "ahb";
+			clocks = <&ccu CLK_BUS_EMAC>;
+			clock-names = "ahb";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&rgmii_pins>;
+			phy-mode = "rgmii";
+			phy = <&phy1>;
+			status = "okay";
+
+			phy1: ethernet-phy at 1 {
+				reg = <1>;
+			};
+		};
+	};
+};
+
+&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>;
+	};
+
+	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>;
+	};
+};
arch/arm/dts/sun50i-a64-pine64-plus.dts +2 -24
index 389c609..790d14d 100644
@@ -40,33 +40,11 @@
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/dts-v1/;
-
-#include "sun50i-a64-pine64-common.dtsi"
+#include "sun50i-a64-pine64.dts"
 
 / {
 	model = "Pine64+";
 	compatible = "pine64,pine64-plus", "allwinner,sun50i-a64";
 
-	chosen {
-		stdout-path = "serial0:115200n8";
-	};
-
-	/* There is a model with 2GB of DRAM, but U-Boot fixes this for us. */
-	memory {
-		reg = <0x40000000 0x40000000>;
-	};
-};
-
-&emac {
-	pinctrl-names = "default";
-	pinctrl-0 = <&rgmii_pins>;
-	phy-mode = "rgmii";
-	phy = <&phy1>;
-	status = "okay";
-
-	phy1: ethernet-phy at 1 {
-	reg = <1>;
-	};
+	/* TODO: Camera, Ethernet PHY, touchscreen, etc. */
 };
-
arch/arm/dts/sun50i-a64-pine64.dts +56 -3

73 lines not on this page · raw message

arch/arm/dts/sun50i-a64.dtsi +190 -449

803 lines not on this page · raw message

include/dt-bindings/clock/sun50i-a64-ccu.h new file +134 -0

134 lines not on this page · raw message

include/dt-bindings/reset/sun50i-a64-ccu.h renamed from arch/arm/dts/sun50i-a64-pine64-common.dtsi +57 -52

128 lines not on this page · raw message

Signature · 1 line
2.9.0
#1 lore raw

PATCH v3 1/1 sunxi: A64/Pine64: update device tree from Linux

Quoted 10 lines · Andre Przywara

The Linux device tree for the Allwinner A64 SoC has changed a lot since the U-Boot version was merged.
Let's replace the current DT with a exact copy of the Linux one as of:
commit c6778ff813d2ca3e3c8733c87dc8b6831a64578b
Merge: 0ff4c01 3c0e3abd
Author: Linus Torvalds <[email protected]>
Date: Tue May 9 10:07:33 2017 -0700

This is the DT used in Linux 4.12-rc1.

Quoted 8 lines

Since U-Boot has an Ethernet driver (while Linux does not yet), we provide the required DT nodes for it in an ...-u-boot.dtsi file, to both mark them as U-Boot specific and to allow easier upgrading once Linux gets the driver and its own binding later.
Compared to the existing Ethernet DT nodes we just slightly tweak the clock and reset nodes in there to match the new bindings used by Linux for those.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170529/9edfb7a6/attachment.sig>
#2 lore raw

PATCH v3 1/1 sunxi: A64/Pine64: update device tree from Linux

In reply to Andre Przywara
Quoted 17 lines · Andre Przywara

The Linux device tree for the Allwinner A64 SoC has changed a lot since the U-Boot version was merged.
Let's replace the current DT with a exact copy of the Linux one as of:
commit c6778ff813d2ca3e3c8733c87dc8b6831a64578b
Merge: 0ff4c01 3c0e3abd
Author: Linus Torvalds <[email protected]>
Date: Tue May 9 10:07:33 2017 -0700

This is the DT used in Linux 4.12-rc1.

Since U-Boot has an Ethernet driver (while Linux does not yet), we provide the required DT nodes for it in an ...-u-boot.dtsi file, to both mark them as U-Boot specific and to allow easier upgrading once Linux gets the driver and its own binding later.
Compared to the existing Ethernet DT nodes we just slightly tweak the clock and reset nodes in there to match the new bindings used by Linux for those.

Quoted 3 lines
---
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi    |  50 ++

Yeah, may be this need to be named something like sun50i-a64-u-boot.dtsi as of now? since it may share the similar dt on other a64 board that we initiate the discussion about orangepi, and BPI.

All fine expect this name.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#3 lore raw

PATCH v3 1/1 sunxi: A64/Pine64: update device tree from Linux

Quoted 27 lines · Jagan Teki
Quoted 17 lines · Andre Przywara

The Linux device tree for the Allwinner A64 SoC has changed a lot since the U-Boot version was merged.
Let's replace the current DT with a exact copy of the Linux one as of:
commit c6778ff813d2ca3e3c8733c87dc8b6831a64578b
Merge: 0ff4c01 3c0e3abd
Author: Linus Torvalds <[email protected]>
Date: Tue May 9 10:07:33 2017 -0700

This is the DT used in Linux 4.12-rc1.

Since U-Boot has an Ethernet driver (while Linux does not yet), we provide the required DT nodes for it in an ...-u-boot.dtsi file, to both mark them as U-Boot specific and to allow easier upgrading once Linux gets the driver and its own binding later.
Compared to the existing Ethernet DT nodes we just slightly tweak the clock and reset nodes in there to match the new bindings used by Linux for those.

Quoted 3 lines
---
 arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi    |  50 ++

Yeah, may be this need to be named something like sun50i-a64-u-boot.dtsi as of now? since it may share the similar dt on other a64 board that we initiate the discussion about orangepi, and BPI.

Quoted 4 lines

All fine expect this name.

Applied to u-boot-sunxi/master

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.