sunxi: update Pine64 device tree
Subsystems (5)
cover sunxi: update Pine64 device tree
When the Pine64 support was merged into U-Boot, there was no official Pine64 .dts in the Linux tree. Since this has changed now and the meanwhile merged Linux DT differs quite a lot from the (preliminary) .dts we used in U-Boot so far, let's update U-Boot's DT to match the Linux version. Beside the effect of using a single instance of the DT we gain the huge advantage of not (necessarily) needing to load a .dtb to boot Linux. Instead just specifying $fdtcontroladdr does the trick, which is used by the UEFI boot scheme already. This has the potential of relieving distributions from the burden of supplying .dtb files for each and every "supported" board.
Following Chen-Yu's suggestion on the last post, the first patch is a 1:1 copy of the Linux version (as of 4.12-rc1), the second one (re-)adds the DT nodes for the Ethernet MAC, which is both not-yet-upstream in Linux and also differening from the proposed Linux driver bindings. But let's fix that later once the Linux driver gets merged.
Given that U-Boot itself does not use the DT much (at least at the moment), there is little risk of breakage, so I'd be grateful if this could be still merged into the next release.
Cheers,
Andre.
Andre Przywara (2):
arm64: A64/Pine64: update device tree from Linux
sunxi: A64: (re-)add sun8i emac DT nodes
arch/arm/dts/sun50i-a64-pine64-common.dtsi | 93 ----- arch/arm/dts/sun50i-a64-pine64-plus.dts | 16 +- arch/arm/dts/sun50i-a64-pine64.dts | 60 ++- arch/arm/dts/sun50i-a64.dtsi | 634 ++++++++++------------------- include/dt-bindings/clock/sun50i-a64-ccu.h | 134 ++++++ include/dt-bindings/reset/sun50i-a64-ccu.h | 98 +++++ 6 files changed, 496 insertions(+), 539 deletions(-) delete mode 100644 arch/arm/dts/sun50i-a64-pine64-common.dtsi create mode 100644 include/dt-bindings/clock/sun50i-a64-ccu.h create mode 100644 include/dt-bindings/reset/sun50i-a64-ccu.h
Signature · 1 line
2.8.2
PATCH 1/2 arm64: 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
For this patch this makes U-Boot lose the (not yet upstream) Ethernet node, but the next patch will fix this up.
--- arch/arm/dts/sun50i-a64-pine64-common.dtsi | 93 ----- 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 ++++++ include/dt-bindings/reset/sun50i-a64-ccu.h | 98 +++++ 6 files changed, 480 insertions(+), 569 deletions(-) delete mode 100644 arch/arm/dts/sun50i-a64-pine64-common.dtsi create mode 100644 include/dt-bindings/clock/sun50i-a64-ccu.h create mode 100644 include/dt-bindings/reset/sun50i-a64-ccu.h
arch/arm/dts/sun50i-a64-pine64-common.dtsi deleted +0 -93
@@ -1,93 +0,0 @@ -/* - * 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 - * 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, - * 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. - */ - -#include "sun50i-a64.dtsi" - -/ { - - aliases { - serial0 = &uart0; - ethernet0 = &emac; - }; - - soc { - 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>, <&mmc0_default_cd_pin>; - vmmc-supply = <®_vcc3v3>; - cd-gpios = <&pio 5 6 0>; - cd-inverted; - status = "okay"; -}; - -&uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; -}; - -&i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; - status = "okay"; -}; - -&usbphy { - status = "okay"; -}; - -&ohci1 { - status = "okay"; -}; - -&ehci1 { - status = "okay"; -};
arch/arm/dts/sun50i-a64-pine64-plus.dts +2 -24
@@ -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 new file +98 -0
98 lines not on this page · raw message
Signature · 1 line
2.8.2
PATCH 2/2 sunxi: A64: (re-)add sun8i emac DT nodes
In reply to Andre PrzywaraAs the kernel DT does not have an Ethernet driver and bindings, lets (re-)add the DT bindings for U-Boot's sun8i EMAC Ethernet driver, which got lost when syncing the kernel DT to U-Boot.
This slightly updates the DT nodes to adapt to the new DT (clock and reset nodes), but keeps the rest the same to let it work with the existing U-Boot driver.
--- arch/arm/dts/sun50i-a64-pine64-plus.dts | 14 +++++++++++++- arch/arm/dts/sun50i-a64-pine64.dts | 1 + arch/arm/dts/sun50i-a64.dtsi | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-)
arch/arm/dts/sun50i-a64-pine64-plus.dts +13 -1
@@ -46,5 +46,17 @@ 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 = <&phy1>; + status = "okay"; + + phy1: ethernet-phy at 1 { + reg = <1>; + }; };
arch/arm/dts/sun50i-a64-pine64.dts +1 -0
@@ -52,6 +52,7 @@ aliases { serial0 = &uart0; + ethernet0 = &emac; }; chosen {
arch/arm/dts/sun50i-a64.dtsi +33 -0
@@ -295,6 +295,25 @@ pins = "PG8", "PG9"; function = "uart1"; }; + + 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>; + }; }; uart0: serial at 1c28000 {
@@ -423,5 +442,19 @@ interrupt-controller; #interrupt-cells = <3>; }; + + 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"; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; }; };
Signature · 1 line
2.8.2
PATCH 1/2 arm64: A64/Pine64: update device tree from Linux
In reply to Andre PrzywaraQuoted 8 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:
commitc6778ff813d2ca3e3c8733c87dc8b6831a64578b
Merge: 0ff4c013c0e3abd
Author: Linus Torvalds <[email protected]>
Date: Tue May 9 10:07:33 2017 -0700
Quoted 4 lines
For this patch this makes U-Boot lose the (not yet upstream) Ethernet node, but the next patch will fix this up.
Signed-off-by Andre Przywara <[email protected]>
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/20170522/fded5628/attachment.sig>
PATCH 2/2 sunxi: A64: (re-)add sun8i emac DT nodes
In reply to Andre PrzywaraQuoted 8 lines · Andre Przywara
As the kernel DT does not have an Ethernet driver and bindings, lets (re-)add the DT bindings for U-Boot's sun8i EMAC Ethernet driver, which got lost when syncing the kernel DT to U-Boot.
This slightly updates the DT nodes to adapt to the new DT (clock and reset nodes), but keeps the rest the same to let it work with the existing U-Boot driver.Signed-off-by Andre Przywara <[email protected]>
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/20170522/a29266f5/attachment.sig>
Tom Rini
NAKPATCH 2/2 sunxi: A64: (re-)add sun8i emac DT nodes
In reply to Andre PrzywaraQuoted 7 lines · Andre Przywara
As the kernel DT does not have an Ethernet driver and bindings, lets (re-)add the DT bindings for U-Boot's sun8i EMAC Ethernet driver, which got lost when syncing the kernel DT to U-Boot.
This slightly updates the DT nodes to adapt to the new DT (clock and reset nodes), but keeps the rest the same to let it work with the existing U-Boot driver.
Quoted 5 lines
Signed-off-by Andre Przywara <[email protected]>--- arch/arm/dts/sun50i-a64-pine64-plus.dts | 14 +++++++++++++- arch/arm/dts/sun50i-a64-pine64.dts | 1 + arch/arm/dts/sun50i-a64.dtsi | 33 +++++++++++++++++++++++++++++++++
NAK, please start making use of -u-boot.dtsi files for these so they won't keep getting lost.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170522/6ac0960a/attachment.sig>
PATCH 2/2 sunxi: A64: (re-)add sun8i emac DT nodes
Hi Tom,
Quoted 8 lines · Tom Rini
Quoted 7 lines · Andre Przywara
As the kernel DT does not have an Ethernet driver and bindings, lets (re-)add the DT bindings for U-Boot's sun8i EMAC Ethernet driver, which got lost when syncing the kernel DT to U-Boot.
This slightly updates the DT nodes to adapt to the new DT (clock and reset nodes), but keeps the rest the same to let it work with the existing U-Boot driver.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Andre Przywara <[email protected]>--- arch/arm/dts/sun50i-a64-pine64-plus.dts | 14 +++++++++++++- arch/arm/dts/sun50i-a64-pine64.dts | 1 + arch/arm/dts/sun50i-a64.dtsi | 33 +++++++++++++++++++++++++++++++++NAK, please start making use of
-u-boot.dtsifiles for these so they won't keep getting lost.
Ah, thanks for the heads up, wasn't aware of that.
I changed this patch, it looks quite neat now since this non-standard binding is now in a separate file and the original .dts files match exactly the Linux versions. Also it is expected that we will need to change these nodes anyway to match the upcoming Linux Ethernet bindings.
One thing I noticed is that the binman/ node got lost with this approach, is that because the -u-boot.dtsi scheme can only deal with one addon file and stops looking on the first hit (skipping sunxi-u-boot.dtsi)?
Cheers,
Andre.
PATCH 2/2 sunxi: A64: (re-)add sun8i emac DT nodes
Quoted 26 lines · Andre Przywara
Hi Tom,
Quoted 8 lines · Tom Rini
Quoted 7 lines · Andre Przywara
As the kernel DT does not have an Ethernet driver and bindings, lets (re-)add the DT bindings for U-Boot's sun8i EMAC Ethernet driver, which got lost when syncing the kernel DT to U-Boot.
This slightly updates the DT nodes to adapt to the new DT (clock and reset nodes), but keeps the rest the same to let it work with the existing U-Boot driver.Quoted 8 lines
Quoted 5 lines
Signed-off-by Andre Przywara <[email protected]>--- arch/arm/dts/sun50i-a64-pine64-plus.dts | 14 +++++++++++++- arch/arm/dts/sun50i-a64-pine64.dts | 1 + arch/arm/dts/sun50i-a64.dtsi | 33 +++++++++++++++++++++++++++++++++NAK, please start making use of
-u-boot.dtsifiles for these so they won't keep getting lost.Ah, thanks for the heads up, wasn't aware of that.
I changed this patch, it looks quite neat now since this non-standard binding is now in a separate file and the original .dts files match exactly the Linux versions. Also it is expected that we will need to change these nodes anyway to match the upcoming Linux Ethernet bindings.
Quoted 3 lines
One thing I noticed is that the binman/ node got lost with this approach, is that because the
-u-boot.dtsischeme can only deal with one addon file and stops looking on the first hit (skippingsunxi-u-boot.dtsi)?
Ah, I think we've found another problem to fix then, yes. Today we only allow one -u-boot.dtsi, but really we should allow for N of them, and allow for more specific ones (ie board-u-boot.dtsi) to override less specific (ie soc-u-boot.dtsi) ones, just like regular DTS files, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170523/c7753b18/attachment.sig>