]> git.sur5r.net Git - u-boot/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-sunxi master
authorTom Rini <trini@konsulko.com>
Tue, 17 Jul 2018 18:28:47 +0000 (14:28 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 17 Jul 2018 18:28:47 +0000 (14:28 -0400)
52 files changed:
arch/arm/dts/Makefile
arch/arm/dts/axp803.dtsi [new file with mode: 0644]
arch/arm/dts/sun50i-a64-bananapi-m64.dts
arch/arm/dts/sun50i-a64-nanopi-a64.dts
arch/arm/dts/sun50i-a64-olinuxino.dts
arch/arm/dts/sun50i-a64-orangepi-win.dts
arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi [deleted file]
arch/arm/dts/sun50i-a64-pine64-plus.dts
arch/arm/dts/sun50i-a64-pine64.dts
arch/arm/dts/sun50i-a64-sopine-baseboard.dts [new file with mode: 0644]
arch/arm/dts/sun50i-a64-sopine.dtsi [new file with mode: 0644]
arch/arm/dts/sun50i-a64.dtsi
arch/arm/dts/sun50i-h5-libretech-all-h3-cc.dts
arch/arm/dts/sun50i-h5-nanopi-neo-plus2.dts
arch/arm/dts/sun50i-h5-nanopi-neo2.dts
arch/arm/dts/sun50i-h5-orangepi-pc2.dts
arch/arm/dts/sun50i-h5-orangepi-prime.dts
arch/arm/dts/sun50i-h5-orangepi-zero-plus2.dts
arch/arm/dts/sun50i-h5.dtsi
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
arch/arm/dts/sun8i-h3-bananapi-m2-plus.dts
arch/arm/dts/sun8i-h3-libretech-all-h3-cc.dts
arch/arm/dts/sun8i-h3-nanopi-m1-plus.dts
arch/arm/dts/sun8i-h3-nanopi-m1.dts
arch/arm/dts/sun8i-h3-nanopi-neo-air.dts
arch/arm/dts/sun8i-h3-nanopi-neo.dts
arch/arm/dts/sun8i-h3-nanopi.dtsi
arch/arm/dts/sun8i-h3-orangepi-2.dts
arch/arm/dts/sun8i-h3-orangepi-lite.dts
arch/arm/dts/sun8i-h3-orangepi-one.dts
arch/arm/dts/sun8i-h3-orangepi-pc-plus.dts
arch/arm/dts/sun8i-h3-orangepi-pc.dts
arch/arm/dts/sun8i-h3-orangepi-plus.dts
arch/arm/dts/sun8i-h3-orangepi-plus2e.dts
arch/arm/dts/sun8i-h3.dtsi
arch/arm/dts/sun8i-r40-bananapi-m2-ultra.dts
arch/arm/dts/sun8i-r40.dtsi
arch/arm/dts/sunxi-h3-h5.dtsi [new file with mode: 0644]
arch/arm/dts/sunxi-libretech-all-h3-cc.dtsi
arch/arm/include/asm/arch-sunxi/clock_sun6i.h
arch/arm/mach-sunxi/Kconfig
configs/Bananapi_M2_Ultra_defconfig
configs/libretech_all_h3_cc_h2_plus_defconfig
configs/libretech_all_h3_cc_h3_defconfig
configs/libretech_all_h3_cc_h5_defconfig
configs/sopine_baseboard_defconfig
drivers/mmc/sunxi_mmc.c
drivers/net/sun8i_emac.c
include/dt-bindings/clock/sun8i-de2.h [new file with mode: 0644]
include/dt-bindings/clock/sun8i-r-ccu.h [new file with mode: 0644]
include/dt-bindings/reset/sun8i-de2.h [new file with mode: 0644]
include/dt-bindings/reset/sun8i-r-ccu.h [new file with mode: 0644]

index 946023093df65cbea2e3c04259982050ea46b047..9607239b031c7c701d8ca7beff2f64b5228c053c 100644 (file)
@@ -392,7 +392,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 \
diff --git a/arch/arm/dts/axp803.dtsi b/arch/arm/dts/axp803.dtsi
new file mode 100644 (file)
index 0000000..e5eae8b
--- /dev/null
@@ -0,0 +1,155 @@
+/*
+ * Copyright 2017 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * AXP803 Integrated Power Management Chip
+ * http://files.pine64.org/doc/datasheet/pine64/AXP803_Datasheet_V1.0.pdf
+ */
+
+&axp803 {
+       interrupt-controller;
+       #interrupt-cells = <1>;
+
+       regulators {
+               /* Default work frequency for buck regulators */
+               x-powers,dcdc-freq = <3000>;
+
+               reg_aldo1: aldo1 {
+                       regulator-name = "aldo1";
+               };
+
+               reg_aldo2: aldo2 {
+                       regulator-name = "aldo2";
+               };
+
+               reg_aldo3: aldo3 {
+                       regulator-name = "aldo3";
+               };
+
+               reg_dc1sw: dc1sw {
+                       regulator-name = "dc1sw";
+               };
+
+               reg_dcdc1: dcdc1 {
+                       regulator-name = "dcdc1";
+               };
+
+               reg_dcdc2: dcdc2 {
+                       regulator-name = "dcdc2";
+               };
+
+               reg_dcdc3: dcdc3 {
+                       regulator-name = "dcdc3";
+               };
+
+               reg_dcdc4: dcdc4 {
+                       regulator-name = "dcdc4";
+               };
+
+               reg_dcdc5: dcdc5 {
+                       regulator-name = "dcdc5";
+               };
+
+               reg_dcdc6: dcdc6 {
+                       regulator-name = "dcdc6";
+               };
+
+               reg_dldo1: dldo1 {
+                       regulator-name = "dldo1";
+               };
+
+               reg_dldo2: dldo2 {
+                       regulator-name = "dldo2";
+               };
+
+               reg_dldo3: dldo3 {
+                       regulator-name = "dldo3";
+               };
+
+               reg_dldo4: dldo4 {
+                       regulator-name = "dldo4";
+               };
+
+               reg_eldo1: eldo1 {
+                       regulator-name = "eldo1";
+               };
+
+               reg_eldo2: eldo2 {
+                       regulator-name = "eldo2";
+               };
+
+               reg_eldo3: eldo3 {
+                       regulator-name = "eldo3";
+               };
+
+               reg_fldo1: fldo1 {
+                       regulator-name = "fldo1";
+               };
+
+               reg_fldo2: fldo2 {
+                       regulator-name = "fldo2";
+               };
+
+               reg_ldo_io0: ldo-io0 {
+                       regulator-name = "ldo-io0";
+                       status = "disabled";
+               };
+
+               reg_ldo_io1: ldo-io1 {
+                       regulator-name = "ldo-io1";
+                       status = "disabled";
+               };
+
+               reg_rtc_ldo: rtc-ldo {
+                       /* RTC_LDO is a fixed, always-on regulator */
+                       regulator-always-on;
+                       regulator-min-microvolt = <3000000>;
+                       regulator-max-microvolt = <3000000>;
+                       regulator-name = "rtc-ldo";
+               };
+
+               reg_drivevbus: drivevbus {
+                       regulator-name = "drivevbus";
+                       status = "disabled";
+               };
+       };
+};
index dcde4a4881654e1e0c5110320e213a860d1bd908..0716b144118775df150f19010549a141c18e744f 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) 2016 ARM Ltd.
- * Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
  *
  * 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
@@ -52,6 +51,7 @@
        compatible = "sinovoip,bananapi-m64", "allwinner,sun50i-a64";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
                serial1 = &uart1;
        };
                stdout-path = "serial0:115200n8";
        };
 
-       reg_vcc3v3: vcc3v3 {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc3v3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
+       leds {
+               compatible = "gpio-leds";
+
+               pwr-led {
+                       label = "bananapi-m64:red:pwr";
+                       gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
+                       default-state = "on";
+               };
+
+               green {
+                       label = "bananapi-m64:green:user";
+                       gpios = <&pio 4 14 GPIO_ACTIVE_HIGH>; /* PE14 */
+               };
+
+               blue {
+                       label = "bananapi-m64:blue:user";
+                       gpios = <&pio 4 15 GPIO_ACTIVE_HIGH>; /* PE15 */
+               };
+       };
+
+       wifi_pwrseq: wifi_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
        };
 };
 
        status = "okay";
 };
 
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmii_pins>;
+       phy-mode = "rgmii";
+       phy-handle = <&ext_rgmii_phy>;
+       phy-supply = <&reg_dc1sw>;
+       status = "okay";
+};
+
 &i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins>;
        bias-pull-up;
 };
 
+&mdio {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
-       vmmc-supply = <&reg_vcc3v3>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-       cd-inverted;
+       vmmc-supply = <&reg_dcdc1>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
        disable-wp;
        bus-width = <4>;
        status = "okay";
 &mmc1 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc1_pins>;
-       vmmc-supply = <&reg_vcc3v3>;
+       vmmc-supply = <&reg_dldo2>;
+       vqmmc-supply = <&reg_dldo4>;
+       mmc-pwrseq = <&wifi_pwrseq>;
        bus-width = <4>;
        non-removable;
        status = "okay";
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&r_pio>;
+               interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+               interrupt-names = "host-wake";
+       };
 };
 
 &mmc2 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc2_pins>;
-       vmmc-supply = <&reg_vcc3v3>;
+       vmmc-supply = <&reg_dcdc1>;
        bus-width = <8>;
        non-removable;
        cap-mmc-hw-reset;
        status = "okay";
 };
 
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+               x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */
+       };
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo1 {
+       /*
+        * This regulator also drives the PE pingroup GPIOs,
+        * which also controls two LEDs.
+        */
+       regulator-always-on;
+       regulator-min-microvolt = <2800000>;
+       regulator-max-microvolt = <2800000>;
+       regulator-name = "afvcc-csi";
+};
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dc1sw {
+       /*
+        * This regulator also indirectly drives the PD pingroup GPIOs,
+        * which also controls the power LED.
+        */
+       regulator-always-on;
+       regulator-name = "vcc-phy";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1040000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-hdmi-dsi";
+};
+
+&reg_dldo2 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_dldo4 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi-io";
+};
+
+&reg_drivevbus {
+       regulator-name = "usb0-vbus";
+       status = "okay";
+};
+
+&reg_eldo1 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "cpvdd";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
 
 &usbphy {
        usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
+       usb0_vbus-supply = <&reg_drivevbus>;
        status = "okay";
 };
index 778636c73a338c0862845269e458c673ac662584..e2dce48fa29a096e8d9a155aeec64d9fcb9d685f 100644 (file)
        chosen {
                stdout-path = "serial0:115200n8";
        };
-
-       reg_vcc3v3: vcc3v3 {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc3v3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-       };
 };
 
 &ehci0 {
@@ -88,9 +81,8 @@
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
-       vmmc-supply = <&reg_vcc3v3>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-       cd-inverted;
+       vmmc-supply = <&reg_dcdc1>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
        disable-wp;
        bus-width = <4>;
        status = "okay";
        status = "okay";
 };
 
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-3v";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1040000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-hdmi-dsi";
+};
+
+&reg_dldo4 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-pg-wifi-io";
+};
+
+&reg_eldo1 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "cpvdd";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
index 7bd4730c93c2ef449d5885d5328ebb3d3313aa8d..3b3081b10ecbef973219e8830a33d9fd40aa5e5d 100644 (file)
                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 */
        };
 };
 
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
-       vmmc-supply = <&reg_vcc3v3>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-       cd-inverted;
+       vmmc-supply = <&reg_dcdc1>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
        disable-wp;
        bus-width = <4>;
        status = "okay";
 };
 
+&mmc1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc1_pins>;
+       vmmc-supply = <&reg_aldo2>;
+       vqmmc-supply = <&reg_dldo4>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       rtl8723bs: wifi@1 {
+               reg = <1>;
+               interrupt-parent = <&r_pio>;
+               interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
+               interrupt-names = "host-wake";
+       };
+};
+
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo1 {
+       regulator-always-on;
+       regulator-min-microvolt = <2800000>;
+       regulator-max-microvolt = <2800000>;
+       regulator-name = "vcc-pe";
+};
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1040000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vcc-ddr3";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-hdmi";
+};
+
+&reg_dldo2 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-mipi";
+};
+
+&reg_dldo3 {
+       regulator-min-microvolt = <2800000>;
+       regulator-max-microvolt = <2800000>;
+       regulator-name = "vcc-avdd-csi";
+};
+
+&reg_dldo4 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi-io";
+};
+
+&reg_eldo1 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "cpvdd";
+};
+
+&reg_eldo2 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vcc-dvdd-csi";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
index cf76c35237262b9686142eae6409377bc020b294..bf42690a3361e51f148f343eb1c9b9fa30251b9d 100644 (file)
        chosen {
                stdout-path = "serial0:115200n8";
        };
-
-       reg_vcc3v3: vcc3v3 {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc3v3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-       };
 };
 
 &ehci1 {
-       status = "okay";
+       status = "okay";
 };
 
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
-       vmmc-supply = <&reg_vcc3v3>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-       cd-inverted;
+       vmmc-supply = <&reg_dcdc1>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
        status = "okay";
 };
 
 &ohci1 {
-       status = "okay";
+       status = "okay";
+};
+
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo1 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "afvcc-csi";
+};
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1040000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1500000>;
+       regulator-max-microvolt = <1500000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-hdmi-dsi";
+};
+
+&reg_dldo2 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_dldo3 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "avdd-csi";
+};
+
+&reg_dldo4 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi-io";
+};
+
+&reg_eldo1 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "cpvdd";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
 };
 
 &uart0 {
 };
 
 &usbphy {
-       status = "okay";
+       status = "okay";
 };
+
diff --git a/arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi b/arch/arm/dts/sun50i-a64-pine64-plus-u-boot.dtsi
deleted file mode 100644 (file)
index 32a263c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/ {
-       aliases {
-               ethernet0 = &emac;
-       };
-
-       soc {
-               syscon: syscon@1c00000 {
-                       compatible = "allwinner,sun50i-a64-system-controller",
-                                    "syscon";
-                       reg = <0x01c00000 0x1000>;
-               };
-
-               emac: ethernet@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@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>;
-       };
-
-       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>;
-       };
-};
index 790d14daaa6a68f2b6ebe40594c5e78baea3f52a..24f1aac366d64355f5b6b37bb8e263bcce7f2e2d 100644 (file)
        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@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
 };
index c680ed385da3565da0291e325b5429fcb1e3eeec..a75825798a7174e9cc85d17171f400f8e3cdcabd 100644 (file)
        compatible = "pine64,pine64", "allwinner,sun50i-a64";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
+               serial1 = &uart1;
+               serial2 = &uart2;
+               serial3 = &uart3;
+               serial4 = &uart4;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
+};
 
-       reg_vcc3v3: vcc3v3 {
-               compatible = "regulator-fixed";
-               regulator-name = "vcc3v3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-       };
+&ehci0 {
+       status = "okay";
 };
 
 &ehci1 {
        status = "okay";
 };
 
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&rmii_pins>;
+       phy-mode = "rmii";
+       phy-handle = <&ext_rmii_phy1>;
+       phy-supply = <&reg_dc1sw>;
+       status = "okay";
+
+};
+
 &i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins>;
        bias-pull-up;
 };
 
+&mdio {
+       ext_rmii_phy1: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins>;
-       vmmc-supply = <&reg_vcc3v3>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-       cd-inverted;
+       vmmc-supply = <&reg_dcdc1>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
        disable-wp;
        bus-width = <4>;
        status = "okay";
 };
 
+&ohci0 {
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
 
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dc1sw {
+       regulator-name = "vcc-phy";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1040000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+/*
+ * The DRAM chips used by Pine64 boards are DDR3L-compatible, so they can
+ * work at 1.35V with less power consumption.
+ * As AXP803 DCDC5 cannot reach 1.35V accurately, use 1.36V instead.
+ */
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1360000>;
+       regulator-max-microvolt = <1360000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-hdmi";
+};
+
+&reg_dldo2 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-mipi";
+};
+
+&reg_dldo4 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&reg_eldo1 {
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "cpvdd";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
+};
+
+/* On Euler connector */
+&spdif {
+       status = "disabled";
+};
+
+/* On Exp and Euler connectors */
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
 
+/* On Wifi/BT connector, with RTS/CTS */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+       status = "disabled";
+};
+
+/* On Pi-2 connector */
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins>;
+       status = "disabled";
+};
+
+/* On Euler connector */
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
+       status = "disabled";
+};
+
+/* On Euler connector, RTS/CTS optional */
+&uart4 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart4_pins>;
+       status = "disabled";
+};
+
 &usb_otg {
        dr_mode = "host";
        status = "okay";
diff --git a/arch/arm/dts/sun50i-a64-sopine-baseboard.dts b/arch/arm/dts/sun50i-a64-sopine-baseboard.dts
new file mode 100644 (file)
index 0000000..abe179d
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2017 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * Based on sun50i-a64-pine64.dts, which is:
+ *   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.
+ */
+
+/dts-v1/;
+
+#include "sun50i-a64-sopine.dtsi"
+
+/ {
+       model = "SoPine with baseboard";
+       compatible = "pine64,sopine-baseboard", "pine64,sopine",
+                    "allwinner,sun50i-a64";
+
+       aliases {
+               ethernet0 = &emac;
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       reg_vcc1v8: vcc1v8 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc1v8";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&rgmii_pins>;
+       phy-mode = "rgmii";
+       phy-handle = <&ext_rgmii_phy>;
+       phy-supply = <&reg_dc1sw>;
+       status = "okay";
+};
+
+&mdio {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       vqmmc-supply = <&reg_vcc1v8>;
+       bus-width = <8>;
+       non-removable;
+       cap-mmc-hw-reset;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&reg_dc1sw {
+       regulator-name = "vcc-phy";
+};
+
+&reg_dldo1 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-hdmi";
+};
+
+&reg_dldo2 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-mipi";
+};
+
+&reg_dldo4 {
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-wifi";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
diff --git a/arch/arm/dts/sun50i-a64-sopine.dtsi b/arch/arm/dts/sun50i-a64-sopine.dtsi
new file mode 100644 (file)
index 0000000..43418bd
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2017 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * Based on sun50i-a64-pine64.dts, which is:
+ *   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"
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins>;
+       vmmc-supply = <&reg_dcdc1>;
+       non-removable;
+       disable-wp;
+       bus-width = <4>;
+       status = "okay";
+};
+
+&r_rsb {
+       status = "okay";
+
+       axp803: pmic@3a3 {
+               compatible = "x-powers,axp803";
+               reg = <0x3a3>;
+               interrupt-parent = <&r_intc>;
+               interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+       };
+};
+
+#include "axp803.dtsi"
+
+&reg_aldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-pl";
+};
+
+&reg_aldo3 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "vcc-pll-avcc";
+};
+
+&reg_dcdc1 {
+       regulator-always-on;
+       regulator-min-microvolt = <3300000>;
+       regulator-max-microvolt = <3300000>;
+       regulator-name = "vcc-3v3";
+};
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1040000>;
+       regulator-max-microvolt = <1300000>;
+       regulator-name = "vdd-cpux";
+};
+
+/* DCDC3 is polyphased with DCDC2 */
+
+&reg_dcdc5 {
+       regulator-always-on;
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-dram";
+};
+
+&reg_dcdc6 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-sys";
+};
+
+&reg_eldo1 {
+       regulator-always-on;
+       regulator-min-microvolt = <1800000>;
+       regulator-max-microvolt = <1800000>;
+       regulator-name = "vdd-1v8-lpddr";
+};
+
+&reg_fldo1 {
+       regulator-min-microvolt = <1200000>;
+       regulator-max-microvolt = <1200000>;
+       regulator-name = "vcc-1v2-hsic";
+};
+
+/*
+ * The A64 chip cannot work without this regulator off, although
+ * it seems to be only driving the AR100 core.
+ * Maybe we don't still know well about CPUs domain.
+ */
+&reg_fldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1100000>;
+       regulator-max-microvolt = <1100000>;
+       regulator-name = "vdd-cpus";
+};
+
+&reg_rtc_ldo {
+       regulator-name = "vcc-rtc";
+};
index a82a3d89af64a531c7a29af276827f27989b2ff2..7a083637c445bcc052471db750a7f7cb194b9f57 100644 (file)
@@ -43,6 +43,7 @@
  */
 
 #include <dt-bindings/clock/sun50i-a64-ccu.h>
+#include <dt-bindings/clock/sun8i-r-ccu.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/sun50i-a64-ccu.h>
 
        #address-cells = <1>;
        #size-cells = <1>;
 
+       chosen {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+/*
+ * The pipeline mixer0-lcd0 depends on clock CLK_MIXER0 from DE2 CCU.
+ * However there is no support for this clock on A64 yet, so we depend
+ * on the upstream clocks here to keep them (and thus CLK_MIXER0) up.
+ */
+               simplefb_lcd: framebuffer-lcd {
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
+                       allwinner,pipeline = "mixer0-lcd0";
+                       clocks = <&ccu CLK_TCON0>,
+                                <&ccu CLK_DE>, <&ccu CLK_BUS_DE>;
+                       status = "disabled";
+               };
+       };
+
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
                method = "smc";
        };
 
+       sound_spdif {
+               compatible = "simple-audio-card";
+               simple-audio-card,name = "On-board SPDIF";
+
+               simple-audio-card,cpu {
+                       sound-dai = <&spdif>;
+               };
+
+               simple-audio-card,codec {
+                       sound-dai = <&spdif_out>;
+               };
+       };
+
+       spdif_out: spdif-out {
+               #sound-dai-cells = <0>;
+               compatible = "linux,spdif-dit";
+       };
+
        timer {
                compatible = "arm,armv8-timer";
                interrupts = <GIC_PPI 13
                #size-cells = <1>;
                ranges;
 
+               syscon: syscon@1c00000 {
+                       compatible = "allwinner,sun50i-a64-system-controller",
+                               "syscon";
+                       reg = <0x01c00000 0x1000>;
+               };
+
+               dma: dma-controller@1c02000 {
+                       compatible = "allwinner,sun50i-a64-dma";
+                       reg = <0x01c02000 0x1000>;
+                       interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_DMA>;
+                       dma-channels = <8>;
+                       dma-requests = <27>;
+                       resets = <&ccu RST_BUS_DMA>;
+                       #dma-cells = <1>;
+               };
+
                mmc0: mmc@1c0f000 {
                        compatible = "allwinner,sun50i-a64-mmc";
                        reg = <0x01c0f000 0x1000>;
                        #size-cells = <0>;
                };
 
-               usb_otg: usb@01c19000 {
+               usb_otg: usb@1c19000 {
                        compatible = "allwinner,sun8i-a33-musb";
                        reg = <0x01c19000 0x0400>;
                        clocks = <&ccu CLK_BUS_OTG>;
                        status = "disabled";
                };
 
-               usbphy: phy@01c19400 {
+               usbphy: phy@1c19400 {
                        compatible = "allwinner,sun50i-a64-usb-phy";
                        reg = <0x01c19400 0x14>,
                              <0x01c1a800 0x4>,
                        #phy-cells = <1>;
                };
 
-               ehci0: usb@01c1a000 {
+               ehci0: usb@1c1a000 {
                        compatible = "allwinner,sun50i-a64-ehci", "generic-ehci";
                        reg = <0x01c1a000 0x100>;
                        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               ohci0: usb@01c1a400 {
+               ohci0: usb@1c1a400 {
                        compatible = "allwinner,sun50i-a64-ohci", "generic-ohci";
                        reg = <0x01c1a400 0x100>;
                        interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               ehci1: usb@01c1b000 {
+               ehci1: usb@1c1b000 {
                        compatible = "allwinner,sun50i-a64-ehci", "generic-ehci";
                        reg = <0x01c1b000 0x100>;
                        interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               ohci1: usb@01c1b400 {
+               ohci1: usb@1c1b400 {
                        compatible = "allwinner,sun50i-a64-ohci", "generic-ohci";
                        reg = <0x01c1b400 0x100>;
                        interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
 
-               ccu: clock@01c20000 {
+               ccu: clock@1c20000 {
                        compatible = "allwinner,sun50i-a64-ccu";
                        reg = <0x01c20000 0x400>;
                        clocks = <&osc24M>, <&osc32k>;
                        interrupt-controller;
                        #interrupt-cells = <3>;
 
+                       i2c0_pins: i2c0_pins {
+                               pins = "PH0", "PH1";
+                               function = "i2c0";
+                       };
+
                        i2c1_pins: i2c1_pins {
                                pins = "PH2", "PH3";
                                function = "i2c1";
                                bias-pull-up;
                        };
 
-                       uart0_pins_a: uart0@0 {
+                       rmii_pins: rmii_pins {
+                               pins = "PD10", "PD11", "PD13", "PD14", "PD17",
+                                      "PD18", "PD19", "PD20", "PD22", "PD23";
+                               function = "emac";
+                               drive-strength = <40>;
+                       };
+
+                       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>;
+                       };
+
+                       spdif_tx_pin: spdif {
+                               pins = "PH8";
+                               function = "spdif";
+                       };
+
+                       spi0_pins: spi0 {
+                               pins = "PC0", "PC1", "PC2", "PC3";
+                               function = "spi0";
+                       };
+
+                       spi1_pins: spi1 {
+                               pins = "PD0", "PD1", "PD2", "PD3";
+                               function = "spi1";
+                       };
+
+                       uart0_pins_a: uart0 {
                                pins = "PB8", "PB9";
                                function = "uart0";
                        };
                                pins = "PG8", "PG9";
                                function = "uart1";
                        };
+
+                       uart2_pins: uart2-pins {
+                               pins = "PB0", "PB1";
+                               function = "uart2";
+                       };
+
+                       uart3_pins: uart3-pins {
+                               pins = "PD0", "PD1";
+                               function = "uart3";
+                       };
+
+                       uart4_pins: uart4-pins {
+                               pins = "PD2", "PD3";
+                               function = "uart4";
+                       };
+
+                       uart4_rts_cts_pins: uart4-rts-cts-pins {
+                               pins = "PD4", "PD5";
+                               function = "uart4";
+                       };
+               };
+
+               spdif: spdif@1c21000 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun50i-a64-spdif",
+                                    "allwinner,sun8i-h3-spdif";
+                       reg = <0x01c21000 0x400>;
+                       interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
+                       resets = <&ccu RST_BUS_SPDIF>;
+                       clock-names = "apb", "spdif";
+                       dmas = <&dma 2>;
+                       dma-names = "tx";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spdif_tx_pin>;
+                       status = "disabled";
+               };
+
+               i2s0: i2s@1c22000 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun50i-a64-i2s",
+                                    "allwinner,sun8i-h3-i2s";
+                       reg = <0x01c22000 0x400>;
+                       interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2S0>, <&ccu CLK_I2S0>;
+                       clock-names = "apb", "mod";
+                       resets = <&ccu RST_BUS_I2S0>;
+                       dma-names = "rx", "tx";
+                       dmas = <&dma 3>, <&dma 3>;
+                       status = "disabled";
+               };
+
+               i2s1: i2s@1c22400 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun50i-a64-i2s",
+                                    "allwinner,sun8i-h3-i2s";
+                       reg = <0x01c22400 0x400>;
+                       interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2S1>, <&ccu CLK_I2S1>;
+                       clock-names = "apb", "mod";
+                       resets = <&ccu RST_BUS_I2S1>;
+                       dma-names = "rx", "tx";
+                       dmas = <&dma 4>, <&dma 4>;
+                       status = "disabled";
                };
 
-               pwm: pwm@01c21400 {
+               pwm: pwm@1c21400 {
                        compatible = "allwinner,sun50i-a64-pwm",
                                     "allwinner,sun5i-a13-pwm";
                        reg = <0x01c21400 0x8>;
                        interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&ccu 67>;
-                       resets = <&ccu 46>;
+                       clocks = <&ccu CLK_BUS_UART0>;
+                       resets = <&ccu RST_BUS_UART0>;
                        status = "disabled";
                };
 
                        interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&ccu 68>;
-                       resets = <&ccu 47>;
+                       clocks = <&ccu CLK_BUS_UART1>;
+                       resets = <&ccu RST_BUS_UART1>;
                        status = "disabled";
                };
 
                        interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&ccu 69>;
-                       resets = <&ccu 48>;
+                       clocks = <&ccu CLK_BUS_UART2>;
+                       resets = <&ccu RST_BUS_UART2>;
                        status = "disabled";
                };
 
                        interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&ccu 70>;
-                       resets = <&ccu 49>;
+                       clocks = <&ccu CLK_BUS_UART3>;
+                       resets = <&ccu RST_BUS_UART3>;
                        status = "disabled";
                };
 
                        interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
                        reg-shift = <2>;
                        reg-io-width = <4>;
-                       clocks = <&ccu 71>;
-                       resets = <&ccu 50>;
+                       clocks = <&ccu CLK_BUS_UART4>;
+                       resets = <&ccu RST_BUS_UART4>;
                        status = "disabled";
                };
 
                        compatible = "allwinner,sun6i-a31-i2c";
                        reg = <0x01c2ac00 0x400>;
                        interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu 63>;
-                       resets = <&ccu 42>;
+                       clocks = <&ccu CLK_BUS_I2C0>;
+                       resets = <&ccu RST_BUS_I2C0>;
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "allwinner,sun6i-a31-i2c";
                        reg = <0x01c2b000 0x400>;
                        interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu 64>;
-                       resets = <&ccu 43>;
+                       clocks = <&ccu CLK_BUS_I2C1>;
+                       resets = <&ccu RST_BUS_I2C1>;
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
                        compatible = "allwinner,sun6i-a31-i2c";
                        reg = <0x01c2b400 0x400>;
                        interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu 65>;
-                       resets = <&ccu 44>;
+                       clocks = <&ccu CLK_BUS_I2C2>;
+                       resets = <&ccu RST_BUS_I2C2>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+
+               spi0: spi@1c68000 {
+                       compatible = "allwinner,sun8i-h3-spi";
+                       reg = <0x01c68000 0x1000>;
+                       interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma 23>, <&dma 23>;
+                       dma-names = "rx", "tx";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi0_pins>;
+                       resets = <&ccu RST_BUS_SPI0>;
+                       status = "disabled";
+                       num-cs = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               spi1: spi@1c69000 {
+                       compatible = "allwinner,sun8i-h3-spi";
+                       reg = <0x01c69000 0x1000>;
+                       interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma 24>, <&dma 24>;
+                       dma-names = "rx", "tx";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi1_pins>;
+                       resets = <&ccu RST_BUS_SPI1>;
+                       status = "disabled";
+                       num-cs = <1>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               emac: ethernet@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";
                        status = "disabled";
                        #address-cells = <1>;
                        #size-cells = <0>;
+
+                       mdio: mdio {
+                               compatible = "snps,dwmac-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
                };
 
                gic: interrupt-controller@1c81000 {
                                     <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
                };
 
+               r_intc: interrupt-controller@1f00c00 {
+                       compatible = "allwinner,sun50i-a64-r-intc",
+                                    "allwinner,sun6i-a31-r-intc";
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       reg = <0x01f00c00 0x400>;
+                       interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
                r_ccu: clock@1f01400 {
                        compatible = "allwinner,sun50i-a64-r-ccu";
                        reg = <0x01f01400 0x100>;
-                       clocks = <&osc24M>, <&osc32k>, <&iosc>;
-                       clock-names = "hosc", "losc", "iosc";
+                       clocks = <&osc24M>, <&osc32k>, <&iosc>,
+                                <&ccu 11>;
+                       clock-names = "hosc", "losc", "iosc", "pll-periph";
                        #clock-cells = <1>;
                        #reset-cells = <1>;
                };
 
-               r_pio: pinctrl@01f02c00 {
+               r_pio: pinctrl@1f02c00 {
                        compatible = "allwinner,sun50i-a64-r-pinctrl";
                        reg = <0x01f02c00 0x400>;
                        interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&r_ccu 3>, <&osc24M>, <&osc32k>;
+                       clocks = <&r_ccu CLK_APB0_PIO>, <&osc24M>, <&osc32k>;
                        clock-names = "apb", "hosc", "losc";
                        gpio-controller;
                        #gpio-cells = <3>;
                        interrupt-controller;
                        #interrupt-cells = <3>;
+
+                       r_rsb_pins: rsb {
+                               pins = "PL0", "PL1";
+                               function = "s_rsb";
+                       };
+               };
+
+               r_rsb: rsb@1f03400 {
+                       compatible = "allwinner,sun8i-a23-rsb";
+                       reg = <0x01f03400 0x400>;
+                       interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&r_ccu 6>;
+                       clock-frequency = <3000000>;
+                       resets = <&r_ccu 2>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&r_rsb_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               wdt0: watchdog@1c20ca0 {
+                       compatible = "allwinner,sun50i-a64-wdt",
+                                    "allwinner,sun6i-a31-wdt";
+                       reg = <0x01c20ca0 0x20>;
+                       interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
                };
        };
 };
index a7e53c5c26b4159dd07d5092b9a66b9bb2d31ed3..a35f77de22d87162ab0f0c6801224f79e9f0aef2 100644 (file)
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
- * Copyright (C) 2018 Chen-Yu Tsai <wens@csie.org>
+ * Copyright (C) 2018 BayLibre, SAS
+ * Author: Neil Armstrong <narmstrong@baylibre.com>
  */
 
 /dts-v1/;
 #include "sun50i-h5.dtsi"
-#include "sunxi-libretech-all-h3-cc.dtsi"
+#include <sunxi-libretech-all-h3-cc.dtsi>
 
 / {
        model = "Libre Computer Board ALL-H3-CC H5";
index f1406c224b4526a5abbe95a707931d5eabffb5a3..506e25ba028abc9c0b3c73b67622a8be9bf0df96 100644 (file)
@@ -1,18 +1,18 @@
 /*
  * Copyright (C) 2017 Antony Antony <antony@phenome.org>
- * 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.
  */
 
 /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 {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
                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";
 };
 
-&mmc0 {
+&ehci0 {
+       status = "okay";
+};
+
+&ehci3 {
+       status = "okay";
+};
+
+&emac {
        pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
+       pinctrl-0 = <&emac_rgmii_pins>;
+       phy-supply = <&reg_gmac_3v3>;
+       phy-handle = <&ext_rgmii_phy>;
+       phy-mode = "rgmii";
+       status = "okay";
+};
+
+&external_mdio {
+       ext_rgmii_phy: ethernet-phy@7 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <7>;
+       };
+};
+
+&mmc0 {
        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 {
+       vmmc-supply = <&reg_vcc3v3>;
+       vqmmc-supply = <&reg_vcc3v3>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+       };
+};
+
 &mmc2 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc2_8bit_pins>;
        status = "okay";
 };
 
-&ohci1 {
+&ohci0 {
+       status = "okay";
+};
+
+&ohci3 {
        status = "okay";
 };
 
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usbphy {
+       /* USB Type-A ports' VBUS is always on */
        status = "okay";
 };
index c08af7881b9a7c1154a7213f904247d67836e50a..cc268a69786c532f46e9d8d1ae81e9eadc24c2d0 100644 (file)
@@ -1,18 +1,17 @@
 /*
  * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
- * Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
  *
  * 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,7 +41,6 @@
  */
 
 /dts-v1/;
-
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
@@ -52,6 +50,7 @@
        compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
                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:blue:status";
+                       gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       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>;
+       };
+
        reg_vcc3v3: vcc3v3 {
                compatible = "regulator-fixed";
                regulator-name = "vcc3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
        };
+
+       reg_usb0_vbus: usb0-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb0-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+               status = "okay";
+       };
 };
 
-&mmc0 {
-       compatible = "allwinner,sun50i-h5-mmc",
-                    "allwinner,sun50i-a64-mmc",
-                    "allwinner,sun5i-a13-mmc";
+&ehci0 {
+       status = "okay";
+};
+
+&ehci3 {
+       status = "okay";
+};
+
+&emac {
        pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
+       pinctrl-0 = <&emac_rgmii_pins>;
+       phy-supply = <&reg_gmac_3v3>;
+       phy-handle = <&ext_rgmii_phy>;
+       phy-mode = "rgmii";
+       status = "okay";
+};
+
+&external_mdio {
+       ext_rgmii_phy: ethernet-phy@7 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <7>;
+       };
+};
+
+&mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
        cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
        status = "okay";
 };
 
+&ohci0 {
+       status = "okay";
+};
+
+&ohci3 {
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usbphy {
+       /* USB Type-A port's VBUS is always on */
+       usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       status = "okay";
+};
index a65300d5aa5217d278e4c667014afca01c7ec6f2..98862c7c7258ebb6677bdbb856b707a7b1126a99 100644 (file)
@@ -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.
  */
 
 /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 = "OrangePi PC 2";
-       compatible = "xunlong,orangepi-pc-2", "allwinner,sun50i-h5";
+       model = "Xunlong Orange Pi PC 2";
+       compatible = "xunlong,orangepi-pc2", "allwinner,sun50i-h5";
+
+       reg_vcc3v3: vcc3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
 
        aliases {
-               serial0 = &uart0;
                ethernet0 = &emac;
+               serial0 = &uart0;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
-               reg = <0x40000000 0x40000000>;
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               pwr {
+                       label = "orangepi:green:pwr";
+                       gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+
+               status {
+                       label = "orangepi:red:status";
+                       gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
+               };
        };
 
-       soc {
-               reg_vcc3v3: vcc3v3 {
-                       compatible = "regulator-fixed";
-                       regulator-name = "vcc3v3";
-                       regulator-min-microvolt = <3300000>;
-                       regulator-max-microvolt = <3300000>;
+       r-gpio-keys {
+               compatible = "gpio-keys";
+
+               sw4 {
+                       label = "sw4";
+                       linux,code = <BTN_0>;
+                       gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
                };
        };
+
+       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>;
+       };
+
+       reg_usb0_vbus: usb0-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb0-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+               status = "okay";
+       };
+};
+
+&codec {
+       allwinner,audio-routing =
+               "Line Out", "LINEOUT",
+               "MIC1", "Mic",
+               "Mic",  "MBIAS";
+       status = "okay";
+};
+
+&de {
+       status = "okay";
 };
 
 &ehci0 {
        status = "okay";
 };
 
+&ehci2 {
+       status = "okay";
+};
+
+&ehci3 {
+       status = "okay";
+};
+
 &emac {
        pinctrl-names = "default";
        pinctrl-0 = <&emac_rgmii_pins>;
-       phy-mode = "rgmii";
+       phy-supply = <&reg_gmac_3v3>;
        phy-handle = <&ext_rgmii_phy>;
+       phy-mode = "rgmii";
        status = "okay";
 };
 
        };
 };
 
-&mmc0 {
-       compatible = "allwinner,sun50i-h5-mmc",
-                    "allwinner,sun50i-a64-mmc",
-                    "allwinner,sun5i-a13-mmc";
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&ir {
        pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
        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";
 };
 
        status = "okay";
 };
 
+&ohci2 {
+       status = "okay";
+};
+
+&ohci3 {
+       status = "okay";
+};
+
 &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 = "otg";
        status = "okay";
 };
 
 &usbphy {
+       /* USB Type-A ports' VBUS is always on */
+       usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        status = "okay";
 };
index 131d8058c47b673cb25bf6b06623afe41fe3695c..b75ca4d7d00199b7972718a6dd55306ecfc01933 100644 (file)
@@ -1,17 +1,20 @@
 /*
- * Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
+ * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * Based on sun50i-h5-orangepi-pc2.dts, which is:
+ *   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.
  */
 
 /dts-v1/;
-
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 / {
-       model = "OrangePi Prime";
+       model = "Xunlong Orange Pi Prime";
        compatible = "xunlong,orangepi-prime", "allwinner,sun50i-h5";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
                stdout-path = "serial0:115200n8";
        };
 
-       memory {
-               reg = <0x40000000 0x80000000>;
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
        };
 
-       soc {
-               reg_vcc3v3: vcc3v3 {
-                       compatible = "regulator-fixed";
-                       regulator-name = "vcc3v3";
-                       regulator-min-microvolt = <3300000>;
-                       regulator-max-microvolt = <3300000>;
+       leds {
+               compatible = "gpio-leds";
+
+               pwr {
+                       label = "orangepi:green:pwr";
+                       gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
                };
+
+               status {
+                       label = "orangepi:red:status";
+                       gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       r-gpio-keys {
+               compatible = "gpio-keys";
+
+               sw4 {
+                       label = "sw4";
+                       linux,code = <BTN_0>;
+                       gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       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>;
+       };
+
+       reg_vcc3v3: vcc3v3 {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc3v3";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+       };
+
+       reg_usb0_vbus: usb0-vbus {
+               compatible = "regulator-fixed";
+               regulator-name = "usb0-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+               status = "okay";
        };
+
+       wifi_pwrseq: wifi_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&pio 2 14 GPIO_ACTIVE_LOW>; /* PC14 */
+       };
+};
+
+&codec {
+       allwinner,audio-routing =
+               "Line Out", "LINEOUT",
+               "MIC1", "Mic",
+               "Mic",  "MBIAS";
+       status = "okay";
+};
+
+&de {
+       status = "okay";
 };
 
 &ehci0 {
        status = "okay";
 };
 
-&mmc0 {
-       compatible = "allwinner,sun50i-h5-mmc",
-                    "allwinner,sun50i-a64-mmc",
-                    "allwinner,sun5i-a13-mmc";
+&ehci2 {
+       status = "okay";
+};
+
+&ehci3 {
+       status = "okay";
+};
+
+&emac {
+       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 {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
+
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&ir {
        pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
+
+&mmc0 {
        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 {
+       vmmc-supply = <&reg_vcc3v3>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
        status = "okay";
 };
 
        status = "okay";
 };
 
+&ohci2 {
+       status = "okay";
+};
+
+&ohci3 {
+       status = "okay";
+};
+
 &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 = "otg";
        status = "okay";
 };
 
 &usbphy {
+       /* USB Type-A ports' VBUS is always on */
+       usb0_id_det-gpios = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        status = "okay";
 };
index 3f4baba3102cc5874c482e54b24c74c428f8a8be..53c8c11620e0e32cae0642990f2c6a4e314a8683 100644 (file)
@@ -46,7 +46,6 @@
 
 #include <dt-bindings/gpio/gpio.h>
 
-
 / {
        model = "OrangePi Zero Plus2";
        compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
                stdout-path = "serial0:115200n8";
        };
 
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        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";
+               pinctrl-names = "default";
+               reset-gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
+               post-power-on-delay-ms = <200>;
+       };
+};
+
+&de {
+       status = "okay";
+};
+
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
 };
 
 &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";
+};
+
+&mmc1 {
+       vmmc-supply = <&reg_vcc3v3>;
+       vqmmc-supply = <&reg_vcc3v3>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
        status = "okay";
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&r_pio>;
+               interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>;  /* PL7 */
+               interrupt-names = "host-wake";
+       };
 };
 
 &mmc2 {
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+       status = "okay";
+};
index c052f311314e909321642d828e4234a1af3498ee..4e4738cab0013b05e11295f8c436f4b30656f82c 100644 (file)
@@ -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.
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "sun8i-h3.dtsi"
+#include <sunxi-h3-h5.dtsi>
 
 / {
        cpus {
-               cpu@0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu@0 {
                        compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <0>;
                        enable-method = "psci";
                };
+
                cpu@1 {
                        compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <1>;
                        enable-method = "psci";
                };
+
                cpu@2 {
                        compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <2>;
                        enable-method = "psci";
                };
+
                cpu@3 {
                        compatible = "arm,cortex-a53", "arm,armv8";
+                       device_type = "cpu";
+                       reg = <3>;
                        enable-method = "psci";
                };
        };
 
        timer {
                compatible = "arm,armv8-timer";
+               interrupts = <GIC_PPI 13
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 14
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 11
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+                            <GIC_PPI 10
+                               (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
        };
 };
 
@@ -76,8 +98,8 @@
        compatible = "allwinner,sun50i-h5-ccu";
 };
 
-&gic {
-       compatible = "arm,gic-400";
+&display_clocks {
+       compatible = "allwinner,sun50i-h5-de2-clk";
 };
 
 &mmc0 {
 &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";
 };
index e0efcb3ba3edc5a4c630b386735fc5b06223185e..0bc031fe4c56b5a234f73bafd1919ef81d613f54 100644 (file)
@@ -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;
        };
 
        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";
 };
 };
 
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-       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_vcc_wifi>;
        mmc-pwrseq = <&wifi_pwrseq>;
        bus-width = <4>;
        };
 };
 
+&ohci0 {
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
 
+&spi0 {
+       /* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
+       status = "disabled";
+
+       flash@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 */
 };
index e766aa3e2fe9a00f218c36759af642d14972a4aa..30540dc8e0c5fd5c5657ca7ad725769e316bd185 100644 (file)
 
 #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;
        };
                stdout-path = "serial0:115200n8";
        };
 
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
-               pinctrl-0 = <&pwr_led_bpi_m2p>;
 
                pwr_led {
                        label = "bananapi-m2-plus:red:pwr";
@@ -76,7 +86,6 @@
        gpio_keys {
                compatible = "gpio-keys";
                pinctrl-names = "default";
-               pinctrl-0 = <&sw_r_bpi_m2p>;
 
                sw4 {
                        label = "power";
                };
        };
 
+       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 */
        };
 };
 
+&de {
+       status = "okay";
+};
+
 &ehci0 {
        status = "okay";
 };
        status = "okay";
 };
 
+&emac {
+       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 {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <0>;
+       };
+};
+
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
 &ir {
        pinctrl-names = "default";
        pinctrl-0 = <&ir_pins_a>;
 };
 
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-       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>;
        non-removable;
        status = "okay";
 
-       brcmf: bcrmf@1 {
+       brcmf: wifi@1 {
                reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&pio>;
        status = "okay";
 };
 
-&r_pio {
-       pwr_led_bpi_m2p: led_pins@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@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 {
 
 &uart1 {
        pinctrl-names = "default";
-       pinctrl-0 = <&uart1_pins_a>;
+       pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
        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";
 };
index 50f2fb30d2d44191194ddfa1cdf3f8b5f0f03fd6..a8b2f0f1c11d6407ef0f5251e6b9ea9d53085f66 100644 (file)
@@ -1,6 +1,7 @@
-// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
  * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
+ *
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  */
 
 /dts-v1/;
index 8ddd1b2cc0970f6bed86f7eb1e5eb433dd7358f0..65cba1050802586aeec186a351ba7304006c8a73 100644 (file)
 / {
        model = "FriendlyArm NanoPi M1 Plus";
        compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3";
+
+       aliases {
+               serial1 = &uart3;
+               ethernet0 = &emac;
+               ethernet1 = &sdio_wifi;
+       };
+
+       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";
+               reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+       };
 };
 
 &ehci1 {
        status = "okay";
 };
 
+&emac {
+       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 {
+       ext_rgmii_phy: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <7>;
+       };
+};
+
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
+
+&mmc1 {
+       vmmc-supply = <&reg_vcc3v3>;
+       vqmmc-supply = <&reg_vcc3v3>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
+       status = "okay";
+
+       sdio_wifi: sdio_wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&pio>;
+               interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
+               interrupt-names = "host-wake";
+       };
+};
+
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_8bit_pins>;
+       vmmc-supply = <&reg_vcc3v3>;
+       vqmmc-supply = <&reg_vcc3v3>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
 &ohci2 {
        status = "okay";
 };
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>, <&uart3_rts_cts_pins>;
+       status = "okay";
+};
index ec63d104b404b012b943ad76d256a857402afda1..9412668bb8881cf4e4f5aa700e209da1aa1a6eac 100644 (file)
 / {
        model = "FriendlyArm NanoPi M1";
        compatible = "friendlyarm,nanopi-m1", "allwinner,sun8i-h3";
+
+       aliases {
+               ethernet0 = &emac;
+       };
+
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+};
+
+&de {
+       status = "okay";
 };
 
 &ehci1 {
        status = "okay";
 };
 
+&emac {
+       phy-handle = <&int_mii_phy>;
+       phy-mode = "mii";
+       allwinner,leds-active-low;
+       status = "okay";
+};
+
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
+&ir {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir_pins_a>;
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
index 3ba081c1f5550685fee6440e76a8ded53b0eb078..6246d3eff39dec1a149d45455b2b41604b3a463b 100644 (file)
@@ -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";
                        gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
                };
        };
+
+       wifi_pwrseq: wifi_pwrseq {
+               compatible = "mmc-pwrseq-simple";
+               reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
+       };
 };
 
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-       cd-inverted;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+       status = "okay";
+};
+
+&mmc1 {
+       vmmc-supply = <&reg_vcc3v3>;
+       vqmmc-supply = <&reg_vcc3v3>;
+       mmc-pwrseq = <&wifi_pwrseq>;
+       bus-width = <4>;
+       non-removable;
        status = "okay";
+
+       brcmf: bcrmf@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+               interrupt-parent = <&pio>;
+               interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */
+               interrupt-names = "host-wake";
+       };
 };
 
 &uart0 {
index 78f6c24952dd128249fd3010d212222832bb060a..9f33f6fae5958e4ca37ffde4f513ed41868bec3a 100644 (file)
        compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
 };
 
+&ehci0 {
+       status = "okay";
+};
+
 &emac {
        phy-handle = <&int_mii_phy>;
        phy-mode = "mii";
        allwinner,leds-active-low;
        status = "okay";
 };
+
+&ohci0 {
+       status = "okay";
+};
+
+&usb_otg {
+       status = "okay";
+       dr_mode = "peripheral";
+};
+
+&usbphy {
+       usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+};
index c6decee41a275e4970cf0c538386314f449f914f..f110ee3822398eae337c2e435e9a06375163754e 100644 (file)
@@ -81,7 +81,7 @@
                pinctrl-names = "default";
                pinctrl-0 = <&sw_r_npi>;
 
-               k1@0 {
+               k1 {
                        label = "k1";
                        linux,code = <KEY_POWER>;
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
 
 &mmc0 {
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>;
-       cd-inverted;
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
        status = "okay";
        vmmc-supply = <&reg_vcc3v3>;
 };
 };
 
 &pio {
-       leds_npi: led_pins@0 {
+       leds_npi: led_pins {
                pins = "PA10";
                function = "gpio_out";
        };
 };
 
 &r_pio {
-       leds_r_npi: led_pins@0 {
+       leds_r_npi: led_pins {
                pins = "PL10";
                function = "gpio_out";
        };
 
-       sw_r_npi: key_pins@0 {
+       sw_r_npi: key_pins {
                pins = "PL3";
                function = "gpio_in";
        };
index d97fdacb35afacbfeaffc9c49530409dd4b2a96c..f1fc6bdca8be711d0ba0b03fc22c551754db1f92 100644 (file)
@@ -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 2";
                stdout-path = "serial0:115200n8";
        };
 
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
        };
 };
 
+&codec {
+       allwinner,pa-gpios = <&pio 0 16 GPIO_ACTIVE_HIGH>; /* PA16 */
+       allwinner,audio-routing =
+               "Speaker", "LINEOUT",
+               "MIC1", "Mic",
+               "Mic",  "MBIAS";
+       status = "okay";
+};
+
+&de {
+       status = "okay";
+};
+
 &ehci1 {
        status = "okay";
 };
        status = "okay";
 };
 
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
 &ir {
        pinctrl-names = "default";
        pinctrl-0 = <&ir_pins_a>;
 };
 
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-       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>;
        mmc-pwrseq = <&wifi_pwrseq>;
        bus-width = <4>;
 };
 
 &pio {
-       leds_opc: led_pins@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@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@0 {
-               allwinner,pins = "PL3", "PL4";
-               allwinner,function = "gpio_in";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       sw_r_opc: key_pins {
+               pins = "PL3", "PL4";
+               function = "gpio_in";
        };
 
-       wifi_pwrseq_pin_orangepi: wifi_pwrseq_pin@0 {
-               allwinner,pins = "PL7";
-               allwinner,function = "gpio_out";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       wifi_pwrseq_pin_orangepi: wifi_pwrseq_pin {
+               pins = "PL7";
+               function = "gpio_out";
        };
 };
 
        status = "okay";
 };
 
-&usb1_vbus_pin_a {
-       allwinner,pins = "PG13";
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
+       status = "disabled";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins>;
+       status = "disabled";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
+       status = "disabled";
 };
 
 &usbphy {
index 1550fee1ec68044d7f6391f163490a3ed7378b75..476ae8e387ca2ba3f7223213ffa1f4adbae88203 100644 (file)
@@ -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";
                stdout-path = "serial0:115200n8";
        };
 
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
        };
 };
 
+&de {
+       status = "okay";
+};
+
 &ehci1 {
        status = "okay";
 };
        status = "okay";
 };
 
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
 &ir {
        pinctrl-names = "default";
        pinctrl-0 = <&ir_pins_a>;
 };
 
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-       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>;
        bus-width = <4>;
        non-removable;
 };
 
 &pio {
-       leds_opc: led_pins@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@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@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";
        };
 };
 
index adab1cbfc921e6a13cbe21dbcaf4d6423b8fd46e..245fd658defbc698bf5f77fe96d8e946c37851b3 100644 (file)
@@ -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 One";
                stdout-path = "serial0:115200n8";
        };
 
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
                        gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
                };
        };
+
+       reg_vdd_cpux: vdd-cpux-regulator {
+               compatible = "regulator-gpio";
+               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>; /* PL6 */
+               enable-active-high;
+               gpios-states = <0x1>;
+               states = <1100000 0x0
+                         1300000 0x1>;
+       };
+};
+
+&cpu0 {
+       cpu-supply = <&reg_vdd_cpux>;
+};
+
+&de {
+       status = "okay";
+};
+
+&ehci0 {
+       status = "okay";
 };
 
 &ehci1 {
        status = "okay";
 };
 
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-       cd-inverted;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+       status = "okay";
+};
+
+&ohci0 {
        status = "okay";
 };
 
 };
 
 &pio {
-       leds_opc: led_pins@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@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@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";
        };
 };
 
+&reg_usb0_vbus {
+       gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+       status = "okay";
+};
+
 &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";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
+       status = "disabled";
+};
+
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
-       /* USB VBUS is always on */
+       /* USB Type-A port's VBUS is always on */
+       usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        status = "okay";
 };
index 851fd2c2cc8cc3d671163af5a41bd37590159a8f..71fb7320893971336edf1ec145d2f213bb61d34f 100644 (file)
        };
 };
 
+&emac {
+       /* LEDs changed to active high on the plus */
+       /delete-property/ allwinner,leds-active-low;
+};
+
 &mmc1 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc1_pins_a>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
        non-removable;
@@ -82,7 +85,7 @@
 
 &mmc2_8bit_pins {
        /* Increase drive strength for DDR modes */
-       allwinner,drive = <SUN4I_PINCTRL_40_MA>;
+       drive-strength = <40>;
        /* eMMC is missing pull-ups */
-       allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       bias-pull-up;
 };
index afba264ea53c1e14663d3ac9318b649a34555daa..46240334128f29bf24e79650d514ad8e1b27c1af 100644 (file)
@@ -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 PC";
                stdout-path = "serial0:115200n8";
        };
 
+       connector {
+               compatible = "hdmi-connector";
+               type = "a";
+
+               port {
+                       hdmi_con_in: endpoint {
+                               remote-endpoint = <&hdmi_out_con>;
+                       };
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
                pinctrl-names = "default";
        };
 };
 
+&codec {
+       allwinner,audio-routing =
+               "Line Out", "LINEOUT",
+               "MIC1", "Mic",
+               "Mic",  "MBIAS";
+       status = "okay";
+};
+
+&de {
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_vdd_cpux>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
 &ehci1 {
        status = "okay";
 };
        status = "okay";
 };
 
+&emac {
+       phy-handle = <&int_mii_phy>;
+       phy-mode = "mii";
+       allwinner,leds-active-low;
+       status = "okay";
+};
+
+&hdmi {
+       status = "okay";
+};
+
+&hdmi_out {
+       hdmi_out_con: endpoint {
+               remote-endpoint = <&hdmi_con_in>;
+       };
+};
+
 &ir {
        pinctrl-names = "default";
        pinctrl-0 = <&ir_pins_a>;
 };
 
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
-       cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
-       cd-inverted;
+       cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
+       status = "okay";
+};
+
+&ohci0 {
        status = "okay";
 };
 
 };
 
 &pio {
-       leds_opc: led_pins@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_i2c {
+       status = "okay";
+
+       reg_vdd_cpux: regulator@65 {
+               compatible = "silergy,sy8106a";
+               reg = <0x65>;
+               regulator-name = "vdd-cpux";
+               silergy,fixed-microvolt = <1200000>;
+               /*
+                * The datasheet uses 1.1V as the minimum value of VDD-CPUX,
+                * however both the Armbian DVFS table and the official one
+                * have operating points with voltage under 1.1V, and both
+                * DVFS table are known to work properly at the lowest
+                * operating point.
+                *
+                * Use 1.0V as the minimum voltage instead.
+                */
+               regulator-min-microvolt = <1000000>;
+               regulator-max-microvolt = <1300000>;
+               regulator-boot-on;
+               regulator-always-on;
        };
 };
 
 &r_pio {
-       leds_r_opc: led_pins@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@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";
        };
 };
 
+&reg_usb0_vbus {
+       gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
 
-&usbphy {
-       /* USB VBUS is always on */
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>;
+       status = "disabled";
+};
+
+&uart2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart2_pins>;
+       status = "disabled";
+};
+
+&uart3 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart3_pins>;
+       status = "disabled";
+};
+
+&usb_otg {
+       dr_mode = "otg";
        status = "okay";
 };
 
-&emac {
-       phy-handle = <&int_mii_phy>;
-       phy-mode = "mii";
-       allwinner,leds-active-low;
+&usbphy {
+       usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       /* VBUS on USB host ports are always on */
        status = "okay";
 };
index 136e4414a4fdb4badba401d90bf0e1bece351ab3..b403e5d787cb041350e5ad7c40c63235676b9032 100644 (file)
        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>;
 };
 
 &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 {
 
 &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@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@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";
        };
 };
 
index 51aaf49b6dc69fe60d67d580f19662eb66017ace..6dbf7b2e0c13c44f06e7970c006f3357f0d0493e 100644 (file)
 
        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 {
                reg = <1>;
        };
 };
-
-&pio {
-       gmac_power_pin_orangepi: gmac_power_pin@0 {
-               allwinner,pins = "PD6";
-               allwinner,function = "gpio_out";
-               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-       };
-};
index 1df6ca4f31b2b32f16eb403adb03a4f98912f237..41d57c76f29052c4bb1724810bc0c5c9a50c09b1 100644 (file)
  *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include "skeleton.dtsi"
-
-#include <dt-bindings/clock/sun8i-h3-ccu.h>
-#include <dt-bindings/interrupt-controller/arm-gic.h>
-#include <dt-bindings/pinctrl/sun4i-a10.h>
-#include <dt-bindings/reset/sun8i-h3-ccu.h>
+#include "sunxi-h3-h5.dtsi"
 
 / {
-       interrupt-parent = <&gic>;
+       cpu0_opp_table: opp_table0 {
+               compatible = "operating-points-v2";
+               opp-shared;
+
+               opp@648000000 {
+                       opp-hz = /bits/ 64 <648000000>;
+                       opp-microvolt = <1040000 1040000 1300000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
 
-       aliases {
-               ethernet0 = &emac;
+               opp@816000000 {
+                       opp-hz = /bits/ 64 <816000000>;
+                       opp-microvolt = <1100000 1100000 1300000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
+
+               opp@1008000000 {
+                       opp-hz = /bits/ 64 <1008000000>;
+                       opp-microvolt = <1200000 1200000 1300000>;
+                       clock-latency-ns = <244144>; /* 8 32k periods */
+               };
        };
 
        cpus {
                #address-cells = <1>;
                #size-cells = <0>;
 
-               cpu@0 {
+               cpu0: cpu@0 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <0>;
+                       clocks = <&ccu CLK_CPUX>;
+                       clock-names = "cpu";
+                       operating-points-v2 = <&cpu0_opp_table>;
+                       #cooling-cells = <2>;
                };
 
                cpu@1 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <1>;
+                       operating-points-v2 = <&cpu0_opp_table>;
                };
 
                cpu@2 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <2>;
+                       operating-points-v2 = <&cpu0_opp_table>;
                };
 
                cpu@3 {
                        compatible = "arm,cortex-a7";
                        device_type = "cpu";
                        reg = <3>;
+                       operating-points-v2 = <&cpu0_opp_table>;
                };
        };
 
                             <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
        };
 
-       clocks {
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               osc24M: osc24M_clk {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <24000000>;
-                       clock-output-names = "osc24M";
-               };
-
-               osc32k: osc32k_clk {
-                       #clock-cells = <0>;
-                       compatible = "fixed-clock";
-                       clock-frequency = <32768>;
-                       clock-output-names = "osc32k";
-               };
-
-               apb0: apb0_clk {
-                       compatible = "fixed-factor-clock";
-                       #clock-cells = <0>;
-                       clock-div = <1>;
-                       clock-mult = <1>;
-                       clocks = <&osc24M>;
-                       clock-output-names = "apb0";
-               };
-
-               apb0_gates: clk@01f01428 {
-                       compatible = "allwinner,sun8i-h3-apb0-gates-clk",
-                                    "allwinner,sun4i-a10-gates-clk";
-                       reg = <0x01f01428 0x4>;
-                       #clock-cells = <1>;
-                       clocks = <&apb0>;
-                       clock-indices = <0>, <1>;
-                       clock-output-names = "apb0_pio", "apb0_ir";
-               };
-
-               ir_clk: ir_clk@01f01454 {
-                       compatible = "allwinner,sun4i-a10-mod0-clk";
-                       reg = <0x01f01454 0x4>;
-                       #clock-cells = <0>;
-                       clocks = <&osc32k>, <&osc24M>;
-                       clock-output-names = "ir";
-               };
-       };
-
        soc {
-               compatible = "simple-bus";
-               #address-cells = <1>;
-               #size-cells = <1>;
-               ranges;
-
-               syscon: syscon@1c00000 {
-                       compatible = "allwinner,sun8i-h3-system-controller",
-                                    "syscon";
-                       reg = <0x01c00000 0x1000>;
-               };
-
-               dma: dma-controller@01c02000 {
-                       compatible = "allwinner,sun8i-h3-dma";
-                       reg = <0x01c02000 0x1000>;
-                       interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_DMA>;
-                       resets = <&ccu RST_BUS_DMA>;
-                       #dma-cells = <1>;
-               };
-
-               mmc0: mmc@01c0f000 {
-                       compatible = "allwinner,sun7i-a20-mmc",
-                                    "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c0f000 0x1000>;
-                       clocks = <&ccu CLK_BUS_MMC0>,
-                                <&ccu CLK_MMC0>,
-                                <&ccu CLK_MMC0_OUTPUT>,
-                                <&ccu CLK_MMC0_SAMPLE>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       resets = <&ccu RST_BUS_MMC0>;
-                       reset-names = "ahb";
-                       interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               mmc1: mmc@01c10000 {
-                       compatible = "allwinner,sun7i-a20-mmc",
-                                    "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c10000 0x1000>;
-                       clocks = <&ccu CLK_BUS_MMC1>,
-                                <&ccu CLK_MMC1>,
-                                <&ccu CLK_MMC1_OUTPUT>,
-                                <&ccu CLK_MMC1_SAMPLE>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       resets = <&ccu RST_BUS_MMC1>;
-                       reset-names = "ahb";
-                       interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               mmc2: mmc@01c11000 {
-                       compatible = "allwinner,sun7i-a20-mmc",
-                                    "allwinner,sun5i-a13-mmc";
-                       reg = <0x01c11000 0x1000>;
-                       clocks = <&ccu CLK_BUS_MMC2>,
-                                <&ccu CLK_MMC2>,
-                                <&ccu CLK_MMC2_OUTPUT>,
-                                <&ccu CLK_MMC2_SAMPLE>;
-                       clock-names = "ahb",
-                                     "mmc",
-                                     "output",
-                                     "sample";
-                       resets = <&ccu RST_BUS_MMC2>;
-                       reset-names = "ahb";
-                       interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
-                       status = "disabled";
-                       #address-cells = <1>;
-                       #size-cells = <0>;
-               };
-
-               usb_otg: usb@1c19000 {
-                       compatible = "allwinner,sun8i-h3-musb";
-                       reg = <0x01c19000 0x400>;
-                       clocks = <&ccu CLK_BUS_OTG>;
-                       resets = <&ccu RST_BUS_OTG>;
-                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
-                       interrupt-names = "mc";
-                       phys = <&usbphy 0>;
-                       phy-names = "usb";
-                       extcon = <&usbphy 0>;
-                       status = "disabled";
-               };
-
-               usbphy: phy@01c19400 {
-                       compatible = "allwinner,sun8i-h3-usb-phy";
-                       reg = <0x01c19400 0x2c>,
-                             <0x01c1a800 0x4>,
-                             <0x01c1b800 0x4>,
-                             <0x01c1c800 0x4>,
-                             <0x01c1d800 0x4>;
-                       reg-names = "phy_ctrl",
-                                   "pmu0",
-                                   "pmu1",
-                                   "pmu2",
-                                   "pmu3";
-                       clocks = <&ccu CLK_USB_PHY0>,
-                                <&ccu CLK_USB_PHY1>,
-                                <&ccu CLK_USB_PHY2>,
-                                <&ccu CLK_USB_PHY3>;
-                       clock-names = "usb0_phy",
-                                     "usb1_phy",
-                                     "usb2_phy",
-                                     "usb3_phy";
-                       resets = <&ccu RST_USB_PHY0>,
-                                <&ccu RST_USB_PHY1>,
-                                <&ccu RST_USB_PHY2>,
-                                <&ccu RST_USB_PHY3>;
-                       reset-names = "usb0_reset",
-                                     "usb1_reset",
-                                     "usb2_reset",
-                                     "usb3_reset";
-                       status = "disabled";
-                       #phy-cells = <1>;
-               };
-
-               ehci0: usb@1c1a000 {
-                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
-                       reg = <0x01c1a000 0x100>;
-                       interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;
-                       resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
-                       status = "disabled";
-               };
-
-               ohci0: usb@1c1a400 {
-                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
-                       reg = <0x01c1a400 0x100>;
-                       interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,
-                                <&ccu CLK_USB_OHCI0>;
-                       resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
-                       status = "disabled";
-               };
-
-               ehci1: usb@01c1b000 {
-                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
-                       reg = <0x01c1b000 0x100>;
-                       interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>;
-                       resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
-                       phys = <&usbphy 1>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ohci1: usb@01c1b400 {
-                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
-                       reg = <0x01c1b400 0x100>;
-                       interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>,
-                                <&ccu CLK_USB_OHCI1>;
-                       resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
-                       phys = <&usbphy 1>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ehci2: usb@01c1c000 {
-                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
-                       reg = <0x01c1c000 0x100>;
-                       interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>;
-                       resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
-                       phys = <&usbphy 2>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ohci2: usb@01c1c400 {
-                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
-                       reg = <0x01c1c400 0x100>;
-                       interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>,
-                                <&ccu CLK_USB_OHCI2>;
-                       resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
-                       phys = <&usbphy 2>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ehci3: usb@01c1d000 {
-                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
-                       reg = <0x01c1d000 0x100>;
-                       interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>;
-                       resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
-                       phys = <&usbphy 3>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ohci3: usb@01c1d400 {
-                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
-                       reg = <0x01c1d400 0x100>;
-                       interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>,
-                                <&ccu CLK_USB_OHCI3>;
-                       resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
-                       phys = <&usbphy 3>;
-                       phy-names = "usb";
-                       status = "disabled";
-               };
-
-               ccu: clock@01c20000 {
-                       compatible = "allwinner,sun8i-h3-ccu";
-                       reg = <0x01c20000 0x400>;
-                       clocks = <&osc24M>, <&osc32k>;
-                       clock-names = "hosc", "losc";
-                       #clock-cells = <1>;
-                       #reset-cells = <1>;
-               };
-
-               pio: pinctrl@01c20800 {
-                       compatible = "allwinner,sun8i-h3-pinctrl";
-                       reg = <0x01c20800 0x400>;
-                       interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&ccu CLK_BUS_PIO>;
-                       gpio-controller;
-                       #gpio-cells = <3>;
-                       interrupt-controller;
-                       #interrupt-cells = <3>;
-
-                       emac_rgmii_pins: emac0 {
-                               pins = "PD0", "PD1", "PD2", "PD3", "PD4",
-                                      "PD5", "PD7", "PD8", "PD9", "PD10",
-                                      "PD12", "PD13", "PD15", "PD16", "PD17";
-                               function = "emac";
-                               drive-strength = <40>;
-                       };
-
-                       mmc0_pins_a: mmc0@0 {
-                               allwinner,pins = "PF0", "PF1", "PF2", "PF3",
-                                                "PF4", "PF5";
-                               allwinner,function = "mmc0";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc0_cd_pin: mmc0_cd_pin@0 {
-                               allwinner,pins = "PF6";
-                               allwinner,function = "gpio_in";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
-                       };
-
-                       mmc1_pins_a: mmc1@0 {
-                               allwinner,pins = "PG0", "PG1", "PG2", "PG3",
-                                                "PG4", "PG5";
-                               allwinner,function = "mmc1";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       mmc2_8bit_pins: mmc2_8bit {
-                               allwinner,pins = "PC5", "PC6", "PC8",
-                                                "PC9", "PC10", "PC11",
-                                                "PC12", "PC13", "PC14",
-                                                "PC15", "PC16";
-                               allwinner,function = "mmc2";
-                               allwinner,drive = <SUN4I_PINCTRL_30_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       uart0_pins_a: uart0@0 {
-                               allwinner,pins = "PA4", "PA5";
-                               allwinner,function = "uart0";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-
-                       uart1_pins_a: uart1@0 {
-                               allwinner,pins = "PG6", "PG7", "PG8", "PG9";
-                               allwinner,function = "uart1";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-
-               timer@01c20c00 {
-                       compatible = "allwinner,sun4i-a10-timer";
-                       reg = <0x01c20c00 0xa0>;
-                       interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&osc24M>;
-               };
-
-               wdt0: watchdog@01c20ca0 {
-                       compatible = "allwinner,sun6i-a31-wdt";
-                       reg = <0x01c20ca0 0x20>;
-                       interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
-               };
-
-               uart0: serial@01c28000 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28000 0x400>;
-                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&ccu CLK_BUS_UART0>;
-                       resets = <&ccu RST_BUS_UART0>;
-                       dmas = <&dma 6>, <&dma 6>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               uart1: serial@01c28400 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28400 0x400>;
-                       interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&ccu CLK_BUS_UART1>;
-                       resets = <&ccu RST_BUS_UART1>;
-                       dmas = <&dma 7>, <&dma 7>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               uart2: serial@01c28800 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28800 0x400>;
-                       interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&ccu CLK_BUS_UART2>;
-                       resets = <&ccu RST_BUS_UART2>;
-                       dmas = <&dma 8>, <&dma 8>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               uart3: serial@01c28c00 {
-                       compatible = "snps,dw-apb-uart";
-                       reg = <0x01c28c00 0x400>;
-                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
-                       reg-shift = <2>;
-                       reg-io-width = <4>;
-                       clocks = <&ccu CLK_BUS_UART3>;
-                       resets = <&ccu RST_BUS_UART3>;
-                       dmas = <&dma 9>, <&dma 9>;
-                       dma-names = "rx", "tx";
-                       status = "disabled";
-               };
-
-               emac: ethernet@1c30000 {
-                       compatible = "allwinner,sun8i-h3-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>;
-                       status = "disabled";
-
-                       mdio: mdio {
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-                               compatible = "snps,dwmac-mdio";
-                       };
-
-                       mdio-mux {
-                               compatible = "allwinner,sun8i-h3-mdio-mux";
-                               #address-cells = <1>;
-                               #size-cells = <0>;
-
-                               mdio-parent-bus = <&mdio>;
-                               /* Only one MDIO is usable at the time */
-                               internal_mdio: mdio@1 {
-                                       compatible = "allwinner,sun8i-h3-mdio-internal";
-                                       reg = <1>;
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-
-                                       int_mii_phy: ethernet-phy@1 {
-                                               compatible = "ethernet-phy-ieee802.3-c22";
-                                               reg = <1>;
-                                               clocks = <&ccu CLK_BUS_EPHY>;
-                                               resets = <&ccu RST_BUS_EPHY>;
-                                       };
-                               };
-
-                               external_mdio: mdio@2 {
-                                       reg = <2>;
-                                       #address-cells = <1>;
-                                       #size-cells = <0>;
-                               };
-                       };
+               mali: gpu@1c40000 {
+                       compatible = "allwinner,sun8i-h3-mali", "arm,mali-400";
+                       reg = <0x01c40000 0x10000>;
+                       interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "gp",
+                                         "gpmmu",
+                                         "pp0",
+                                         "ppmmu0",
+                                         "pp1",
+                                         "ppmmu1",
+                                         "pmu";
+                       clocks = <&ccu CLK_BUS_GPU>, <&ccu CLK_GPU>;
+                       clock-names = "bus", "core";
+                       resets = <&ccu RST_BUS_GPU>;
+
+                       assigned-clocks = <&ccu CLK_GPU>;
+                       assigned-clock-rates = <384000000>;
                };
+       };
+};
 
-               gic: interrupt-controller@01c81000 {
-                       compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
-                       reg = <0x01c81000 0x1000>,
-                             <0x01c82000 0x1000>,
-                             <0x01c84000 0x2000>,
-                             <0x01c86000 0x2000>;
-                       interrupt-controller;
-                       #interrupt-cells = <3>;
-                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
-               };
+&ccu {
+       compatible = "allwinner,sun8i-h3-ccu";
+};
 
-               rtc: rtc@01f00000 {
-                       compatible = "allwinner,sun6i-a31-rtc";
-                       reg = <0x01f00000 0x54>;
-                       interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
-                                    <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
-               };
+&display_clocks {
+       compatible = "allwinner,sun8i-h3-de2-clk";
+};
 
-               apb0_reset: reset@01f014b0 {
-                       reg = <0x01f014b0 0x4>;
-                       compatible = "allwinner,sun6i-a31-clock-reset";
-                       #reset-cells = <1>;
-               };
+&mmc0 {
+       compatible = "allwinner,sun7i-a20-mmc";
+       clocks = <&ccu CLK_BUS_MMC0>,
+                <&ccu CLK_MMC0>,
+                <&ccu CLK_MMC0_OUTPUT>,
+                <&ccu CLK_MMC0_SAMPLE>;
+       clock-names = "ahb",
+                     "mmc",
+                     "output",
+                     "sample";
+};
 
-               ir: ir@01f02000 {
-                       compatible = "allwinner,sun5i-a13-ir";
-                       clocks = <&apb0_gates 1>, <&ir_clk>;
-                       clock-names = "apb", "ir";
-                       resets = <&apb0_reset 1>;
-                       interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
-                       reg = <0x01f02000 0x40>;
-                       status = "disabled";
-               };
+&mmc1 {
+       compatible = "allwinner,sun7i-a20-mmc";
+       clocks = <&ccu CLK_BUS_MMC1>,
+                <&ccu CLK_MMC1>,
+                <&ccu CLK_MMC1_OUTPUT>,
+                <&ccu CLK_MMC1_SAMPLE>;
+       clock-names = "ahb",
+                     "mmc",
+                     "output",
+                     "sample";
+};
 
-               r_pio: pinctrl@01f02c00 {
-                       compatible = "allwinner,sun8i-h3-r-pinctrl";
-                       reg = <0x01f02c00 0x400>;
-                       interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
-                       clocks = <&apb0_gates 0>;
-                       resets = <&apb0_reset 0>;
-                       gpio-controller;
-                       #gpio-cells = <3>;
-                       interrupt-controller;
-                       #interrupt-cells = <3>;
+&mmc2 {
+       compatible = "allwinner,sun7i-a20-mmc";
+       clocks = <&ccu CLK_BUS_MMC2>,
+                <&ccu CLK_MMC2>,
+                <&ccu CLK_MMC2_OUTPUT>,
+                <&ccu CLK_MMC2_SAMPLE>;
+       clock-names = "ahb",
+                     "mmc",
+                     "output",
+                     "sample";
+};
 
-                       ir_pins_a: ir@0 {
-                               allwinner,pins = "PL11";
-                               allwinner,function = "s_cir_rx";
-                               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
-                               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
-                       };
-               };
-       };
+&pio {
+       compatible = "allwinner,sun8i-h3-pinctrl";
 };
index ab471ab0bffb9447a1da0e4591b416dfa5182b27..28c915830280aa931df1a67d8952008e3c47a93c 100644 (file)
@@ -48,6 +48,7 @@
        compatible = "sinovoip,bpi-m2-ultra", "allwinner,sun8i-r40";
 
        aliases {
+               ethernet0 = &gmac;
                serial0 = &uart0;
        };
 
        pinctrl-0 = <&uart0_pb_pins>;
        status = "okay";
 };
+
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_rgmii_pins>;
+       phy-handle = <&phy1>;
+       phy-mode = "rgmii";
+       status = "okay";
+};
+
+&gmac_mdio {
+       phy1: ethernet-phy@1 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <1>;
+       };
+};
index 0aa76a2f10a3c7438f6a35bdda9736121f60594b..2cdfb54282ca5b8ff0f7da329f5ef7b664155074 100644 (file)
                        #interrupt-cells = <3>;
                        #gpio-cells = <3>;
 
+                       gmac_rgmii_pins: gmac-rgmii-pins {
+                               pins = "PA0", "PA1", "PA2", "PA3",
+                                      "PA4", "PA5", "PA6", "PA7",
+                                      "PA8", "PA10", "PA11", "PA12",
+                                      "PA13", "PA15", "PA16";
+                               function = "gmac";
+                               /*
+                                * data lines in RGMII mode use DDR mode
+                                * and need a higher signal drive strength
+                                */
+                               drive-strength = <40>;
+                       };
+
                        i2c0_pins: i2c0_pins {
                                pins = "PB0", "PB1";
                                function = "i2c0";
                        #size-cells = <0>;
                };
 
+               gmac: ethernet@1c50000 {
+                       compatible = "allwinner,sun8i-r40-gmac";
+                       syscon = <&ccu>;
+                       reg = <0x01c50000 0x10000>;
+                       interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "macirq";
+                       resets = <&ccu RST_BUS_GMAC>;
+                       reset-names = "stmmaceth";
+                       clocks = <&ccu CLK_BUS_GMAC>;
+                       clock-names = "stmmaceth";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       status = "disabled";
+
+                       gmac_mdio: mdio {
+                               compatible = "snps,dwmac-mdio";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                       };
+               };
+
                gic: interrupt-controller@1c81000 {
                        compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
                        reg = <0x01c81000 0x1000>,
diff --git a/arch/arm/dts/sunxi-h3-h5.dtsi b/arch/arm/dts/sunxi-h3-h5.dtsi
new file mode 100644 (file)
index 0000000..c3bff11
--- /dev/null
@@ -0,0 +1,860 @@
+/*
+ * Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com>
+ *
+ * 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.
+ */
+
+#include <dt-bindings/clock/sun8i-de2.h>
+#include <dt-bindings/clock/sun8i-h3-ccu.h>
+#include <dt-bindings/clock/sun8i-r-ccu.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/reset/sun8i-de2.h>
+#include <dt-bindings/reset/sun8i-h3-ccu.h>
+#include <dt-bindings/reset/sun8i-r-ccu.h>
+
+/ {
+       interrupt-parent = <&gic>;
+       #address-cells = <1>;
+       #size-cells = <1>;
+
+       chosen {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               framebuffer-hdmi {
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
+                       allwinner,pipeline = "mixer0-lcd0-hdmi";
+                       clocks = <&display_clocks CLK_MIXER0>,
+                                <&ccu CLK_TCON0>, <&ccu CLK_HDMI>;
+                       status = "disabled";
+               };
+
+               framebuffer-tve {
+                       compatible = "allwinner,simple-framebuffer",
+                                    "simple-framebuffer";
+                       allwinner,pipeline = "mixer1-lcd1-tve";
+                       clocks = <&display_clocks CLK_MIXER1>,
+                                <&ccu CLK_TVE>;
+                       status = "disabled";
+               };
+       };
+
+       clocks {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               osc24M: osc24M_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <24000000>;
+                       clock-output-names = "osc24M";
+               };
+
+               osc32k: osc32k_clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <32768>;
+                       clock-output-names = "osc32k";
+               };
+
+               iosc: internal-osc-clk {
+                       #clock-cells = <0>;
+                       compatible = "fixed-clock";
+                       clock-frequency = <16000000>;
+                       clock-accuracy = <300000000>;
+                       clock-output-names = "iosc";
+               };
+       };
+
+       de: display-engine {
+               compatible = "allwinner,sun8i-h3-display-engine";
+               allwinner,pipelines = <&mixer0>;
+               status = "disabled";
+       };
+
+       soc {
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               ranges;
+
+               display_clocks: clock@1000000 {
+                       /* compatible is in per SoC .dtsi file */
+                       reg = <0x01000000 0x100000>;
+                       clocks = <&ccu CLK_DE>,
+                                <&ccu CLK_BUS_DE>;
+                       clock-names = "mod",
+                                     "bus";
+                       resets = <&ccu RST_BUS_DE>;
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+               };
+
+               mixer0: mixer@1100000 {
+                       compatible = "allwinner,sun8i-h3-de2-mixer-0";
+                       reg = <0x01100000 0x100000>;
+                       clocks = <&display_clocks CLK_BUS_MIXER0>,
+                                <&display_clocks CLK_MIXER0>;
+                       clock-names = "bus",
+                                     "mod";
+                       resets = <&display_clocks RST_MIXER0>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               mixer0_out: port@1 {
+                                       reg = <1>;
+
+                                       mixer0_out_tcon0: endpoint {
+                                               remote-endpoint = <&tcon0_in_mixer0>;
+                                       };
+                               };
+                       };
+               };
+
+               syscon: syscon@1c00000 {
+                       compatible = "allwinner,sun8i-h3-system-controller",
+                               "syscon";
+                       reg = <0x01c00000 0x1000>;
+               };
+
+               dma: dma-controller@1c02000 {
+                       compatible = "allwinner,sun8i-h3-dma";
+                       reg = <0x01c02000 0x1000>;
+                       interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_DMA>;
+                       resets = <&ccu RST_BUS_DMA>;
+                       #dma-cells = <1>;
+               };
+
+               tcon0: lcd-controller@1c0c000 {
+                       compatible = "allwinner,sun8i-h3-tcon-tv",
+                                    "allwinner,sun8i-a83t-tcon-tv";
+                       reg = <0x01c0c000 0x1000>;
+                       interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_TCON0>, <&ccu CLK_TCON0>;
+                       clock-names = "ahb", "tcon-ch1";
+                       resets = <&ccu RST_BUS_TCON0>;
+                       reset-names = "lcd";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               tcon0_in: port@0 {
+                                       reg = <0>;
+
+                                       tcon0_in_mixer0: endpoint {
+                                               remote-endpoint = <&mixer0_out_tcon0>;
+                                       };
+                               };
+
+                               tcon0_out: port@1 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <1>;
+
+                                       tcon0_out_hdmi: endpoint@1 {
+                                               reg = <1>;
+                                               remote-endpoint = <&hdmi_in_tcon0>;
+                                       };
+                               };
+                       };
+               };
+
+               mmc0: mmc@1c0f000 {
+                       /* compatible and clocks are in per SoC .dtsi file */
+                       reg = <0x01c0f000 0x1000>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mmc0_pins>;
+                       resets = <&ccu RST_BUS_MMC0>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc1: mmc@1c10000 {
+                       /* compatible and clocks are in per SoC .dtsi file */
+                       reg = <0x01c10000 0x1000>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&mmc1_pins>;
+                       resets = <&ccu RST_BUS_MMC1>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               mmc2: mmc@1c11000 {
+                       /* compatible and clocks are in per SoC .dtsi file */
+                       reg = <0x01c11000 0x1000>;
+                       resets = <&ccu RST_BUS_MMC2>;
+                       reset-names = "ahb";
+                       interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               usb_otg: usb@1c19000 {
+                       compatible = "allwinner,sun8i-h3-musb";
+                       reg = <0x01c19000 0x400>;
+                       clocks = <&ccu CLK_BUS_OTG>;
+                       resets = <&ccu RST_BUS_OTG>;
+                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       status = "disabled";
+               };
+
+               usbphy: phy@1c19400 {
+                       compatible = "allwinner,sun8i-h3-usb-phy";
+                       reg = <0x01c19400 0x2c>,
+                             <0x01c1a800 0x4>,
+                             <0x01c1b800 0x4>,
+                             <0x01c1c800 0x4>,
+                             <0x01c1d800 0x4>;
+                       reg-names = "phy_ctrl",
+                                   "pmu0",
+                                   "pmu1",
+                                   "pmu2",
+                                   "pmu3";
+                       clocks = <&ccu CLK_USB_PHY0>,
+                                <&ccu CLK_USB_PHY1>,
+                                <&ccu CLK_USB_PHY2>,
+                                <&ccu CLK_USB_PHY3>;
+                       clock-names = "usb0_phy",
+                                     "usb1_phy",
+                                     "usb2_phy",
+                                     "usb3_phy";
+                       resets = <&ccu RST_USB_PHY0>,
+                                <&ccu RST_USB_PHY1>,
+                                <&ccu RST_USB_PHY2>,
+                                <&ccu RST_USB_PHY3>;
+                       reset-names = "usb0_reset",
+                                     "usb1_reset",
+                                     "usb2_reset",
+                                     "usb3_reset";
+                       status = "disabled";
+                       #phy-cells = <1>;
+               };
+
+               ehci0: usb@1c1a000 {
+                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
+                       reg = <0x01c1a000 0x100>;
+                       interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>;
+                       resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
+                       status = "disabled";
+               };
+
+               ohci0: usb@1c1a400 {
+                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
+                       reg = <0x01c1a400 0x100>;
+                       interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI0>, <&ccu CLK_BUS_OHCI0>,
+                                <&ccu CLK_USB_OHCI0>;
+                       resets = <&ccu RST_BUS_EHCI0>, <&ccu RST_BUS_OHCI0>;
+                       status = "disabled";
+               };
+
+               ehci1: usb@1c1b000 {
+                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
+                       reg = <0x01c1b000 0x100>;
+                       interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>;
+                       resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
+                       phys = <&usbphy 1>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ohci1: usb@1c1b400 {
+                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
+                       reg = <0x01c1b400 0x100>;
+                       interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>,
+                                <&ccu CLK_USB_OHCI1>;
+                       resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
+                       phys = <&usbphy 1>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ehci2: usb@1c1c000 {
+                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
+                       reg = <0x01c1c000 0x100>;
+                       interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>;
+                       resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
+                       phys = <&usbphy 2>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ohci2: usb@1c1c400 {
+                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
+                       reg = <0x01c1c400 0x100>;
+                       interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>,
+                                <&ccu CLK_USB_OHCI2>;
+                       resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
+                       phys = <&usbphy 2>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ehci3: usb@1c1d000 {
+                       compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
+                       reg = <0x01c1d000 0x100>;
+                       interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>;
+                       resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
+                       phys = <&usbphy 3>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ohci3: usb@1c1d400 {
+                       compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
+                       reg = <0x01c1d400 0x100>;
+                       interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>,
+                                <&ccu CLK_USB_OHCI3>;
+                       resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
+                       phys = <&usbphy 3>;
+                       phy-names = "usb";
+                       status = "disabled";
+               };
+
+               ccu: clock@1c20000 {
+                       /* compatible is in per SoC .dtsi file */
+                       reg = <0x01c20000 0x400>;
+                       clocks = <&osc24M>, <&osc32k>;
+                       clock-names = "hosc", "losc";
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+               };
+
+               pio: pinctrl@1c20800 {
+                       /* compatible is in per SoC .dtsi file */
+                       reg = <0x01c20800 0x400>;
+                       interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_PIO>, <&osc24M>, <&osc32k>;
+                       clock-names = "apb", "hosc", "losc";
+                       gpio-controller;
+                       #gpio-cells = <3>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+
+                       emac_rgmii_pins: emac0 {
+                               pins = "PD0", "PD1", "PD2", "PD3", "PD4",
+                                      "PD5", "PD7", "PD8", "PD9", "PD10",
+                                      "PD12", "PD13", "PD15", "PD16", "PD17";
+                               function = "emac";
+                               drive-strength = <40>;
+                       };
+
+                       i2c0_pins: i2c0 {
+                               pins = "PA11", "PA12";
+                               function = "i2c0";
+                       };
+
+                       i2c1_pins: i2c1 {
+                               pins = "PA18", "PA19";
+                               function = "i2c1";
+                       };
+
+                       i2c2_pins: i2c2 {
+                               pins = "PE12", "PE13";
+                               function = "i2c2";
+                       };
+
+                       mmc0_pins: mmc0 {
+                               pins = "PF0", "PF1", "PF2", "PF3",
+                                      "PF4", "PF5";
+                               function = "mmc0";
+                               drive-strength = <30>;
+                               bias-pull-up;
+                       };
+
+                       mmc1_pins: mmc1 {
+                               pins = "PG0", "PG1", "PG2", "PG3",
+                                      "PG4", "PG5";
+                               function = "mmc1";
+                               drive-strength = <30>;
+                               bias-pull-up;
+                       };
+
+                       mmc2_8bit_pins: mmc2_8bit {
+                               pins = "PC5", "PC6", "PC8",
+                                      "PC9", "PC10", "PC11",
+                                      "PC12", "PC13", "PC14",
+                                      "PC15", "PC16";
+                               function = "mmc2";
+                               drive-strength = <30>;
+                               bias-pull-up;
+                       };
+
+                       spdif_tx_pins_a: spdif {
+                               pins = "PA17";
+                               function = "spdif";
+                       };
+
+                       spi0_pins: spi0 {
+                               pins = "PC0", "PC1", "PC2", "PC3";
+                               function = "spi0";
+                       };
+
+                       spi1_pins: spi1 {
+                               pins = "PA15", "PA16", "PA14", "PA13";
+                               function = "spi1";
+                       };
+
+                       uart0_pins_a: uart0 {
+                               pins = "PA4", "PA5";
+                               function = "uart0";
+                       };
+
+                       uart1_pins: uart1 {
+                               pins = "PG6", "PG7";
+                               function = "uart1";
+                       };
+
+                       uart1_rts_cts_pins: uart1_rts_cts {
+                               pins = "PG8", "PG9";
+                               function = "uart1";
+                       };
+
+                       uart2_pins: uart2 {
+                               pins = "PA0", "PA1";
+                               function = "uart2";
+                       };
+
+                       uart3_pins: uart3 {
+                               pins = "PA13", "PA14";
+                               function = "uart3";
+                       };
+
+                       uart3_rts_cts_pins: uart3_rts_cts {
+                               pins = "PA15", "PA16";
+                               function = "uart3";
+                       };
+               };
+
+               timer@1c20c00 {
+                       compatible = "allwinner,sun4i-a10-timer";
+                       reg = <0x01c20c00 0xa0>;
+                       interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&osc24M>;
+               };
+
+               emac: ethernet@1c30000 {
+                       compatible = "allwinner,sun8i-h3-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>;
+                       status = "disabled";
+
+                       mdio: mdio {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               compatible = "snps,dwmac-mdio";
+                       };
+
+                       mdio-mux {
+                               compatible = "allwinner,sun8i-h3-mdio-mux";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               mdio-parent-bus = <&mdio>;
+                               /* Only one MDIO is usable at the time */
+                               internal_mdio: mdio@1 {
+                                       compatible = "allwinner,sun8i-h3-mdio-internal";
+                                       reg = <1>;
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       int_mii_phy: ethernet-phy@1 {
+                                               compatible = "ethernet-phy-ieee802.3-c22";
+                                               reg = <1>;
+                                               clocks = <&ccu CLK_BUS_EPHY>;
+                                               resets = <&ccu RST_BUS_EPHY>;
+                                       };
+                               };
+
+                               external_mdio: mdio@2 {
+                                       reg = <2>;
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                               };
+                       };
+               };
+
+               spi0: spi@1c68000 {
+                       compatible = "allwinner,sun8i-h3-spi";
+                       reg = <0x01c68000 0x1000>;
+                       interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma 23>, <&dma 23>;
+                       dma-names = "rx", "tx";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi0_pins>;
+                       resets = <&ccu RST_BUS_SPI0>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               spi1: spi@1c69000 {
+                       compatible = "allwinner,sun8i-h3-spi";
+                       reg = <0x01c69000 0x1000>;
+                       interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
+                       clock-names = "ahb", "mod";
+                       dmas = <&dma 24>, <&dma 24>;
+                       dma-names = "rx", "tx";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi1_pins>;
+                       resets = <&ccu RST_BUS_SPI1>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               wdt0: watchdog@1c20ca0 {
+                       compatible = "allwinner,sun6i-a31-wdt";
+                       reg = <0x01c20ca0 0x20>;
+                       interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               spdif: spdif@1c21000 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun8i-h3-spdif";
+                       reg = <0x01c21000 0x400>;
+                       interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
+                       resets = <&ccu RST_BUS_SPDIF>;
+                       clock-names = "apb", "spdif";
+                       dmas = <&dma 2>;
+                       dma-names = "tx";
+                       status = "disabled";
+               };
+
+               pwm: pwm@1c21400 {
+                       compatible = "allwinner,sun8i-h3-pwm";
+                       reg = <0x01c21400 0x8>;
+                       clocks = <&osc24M>;
+                       #pwm-cells = <3>;
+                       status = "disabled";
+               };
+
+               i2s0: i2s@1c22000 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun8i-h3-i2s";
+                       reg = <0x01c22000 0x400>;
+                       interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2S0>, <&ccu CLK_I2S0>;
+                       clock-names = "apb", "mod";
+                       dmas = <&dma 3>, <&dma 3>;
+                       resets = <&ccu RST_BUS_I2S0>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               i2s1: i2s@1c22400 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun8i-h3-i2s";
+                       reg = <0x01c22400 0x400>;
+                       interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2S1>, <&ccu CLK_I2S1>;
+                       clock-names = "apb", "mod";
+                       dmas = <&dma 4>, <&dma 4>;
+                       resets = <&ccu RST_BUS_I2S1>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               codec: codec@1c22c00 {
+                       #sound-dai-cells = <0>;
+                       compatible = "allwinner,sun8i-h3-codec";
+                       reg = <0x01c22c00 0x400>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
+                       clock-names = "apb", "codec";
+                       resets = <&ccu RST_BUS_CODEC>;
+                       dmas = <&dma 15>, <&dma 15>;
+                       dma-names = "rx", "tx";
+                       allwinner,codec-analog-controls = <&codec_analog>;
+                       status = "disabled";
+               };
+
+               uart0: serial@1c28000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28000 0x400>;
+                       interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART0>;
+                       resets = <&ccu RST_BUS_UART0>;
+                       dmas = <&dma 6>, <&dma 6>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               uart1: serial@1c28400 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28400 0x400>;
+                       interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART1>;
+                       resets = <&ccu RST_BUS_UART1>;
+                       dmas = <&dma 7>, <&dma 7>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               uart2: serial@1c28800 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28800 0x400>;
+                       interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART2>;
+                       resets = <&ccu RST_BUS_UART2>;
+                       dmas = <&dma 8>, <&dma 8>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               uart3: serial@1c28c00 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0x01c28c00 0x400>;
+                       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       clocks = <&ccu CLK_BUS_UART3>;
+                       resets = <&ccu RST_BUS_UART3>;
+                       dmas = <&dma 9>, <&dma 9>;
+                       dma-names = "rx", "tx";
+                       status = "disabled";
+               };
+
+               i2c0: i2c@1c2ac00 {
+                       compatible = "allwinner,sun6i-a31-i2c";
+                       reg = <0x01c2ac00 0x400>;
+                       interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C0>;
+                       resets = <&ccu RST_BUS_I2C0>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c0_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c1: i2c@1c2b000 {
+                       compatible = "allwinner,sun6i-a31-i2c";
+                       reg = <0x01c2b000 0x400>;
+                       interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C1>;
+                       resets = <&ccu RST_BUS_I2C1>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c1_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               i2c2: i2c@1c2b400 {
+                       compatible = "allwinner,sun6i-a31-i2c";
+                       reg = <0x01c2b400 0x400>;
+                       interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_I2C2>;
+                       resets = <&ccu RST_BUS_I2C2>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&i2c2_pins>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               gic: interrupt-controller@1c81000 {
+                       compatible = "arm,gic-400";
+                       reg = <0x01c81000 0x1000>,
+                             <0x01c82000 0x2000>,
+                             <0x01c84000 0x2000>,
+                             <0x01c86000 0x2000>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+                       interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+               };
+
+               hdmi: hdmi@1ee0000 {
+                       compatible = "allwinner,sun8i-h3-dw-hdmi",
+                                    "allwinner,sun8i-a83t-dw-hdmi";
+                       reg = <0x01ee0000 0x10000>;
+                       reg-io-width = <1>;
+                       interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+                                <&ccu CLK_HDMI>;
+                       clock-names = "iahb", "isfr", "tmds";
+                       resets = <&ccu RST_BUS_HDMI1>;
+                       reset-names = "ctrl";
+                       phys = <&hdmi_phy>;
+                       phy-names = "hdmi-phy";
+                       status = "disabled";
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               hdmi_in: port@0 {
+                                       reg = <0>;
+
+                                       hdmi_in_tcon0: endpoint {
+                                               remote-endpoint = <&tcon0_out_hdmi>;
+                                       };
+                               };
+
+                               hdmi_out: port@1 {
+                                       reg = <1>;
+                               };
+                       };
+               };
+
+               hdmi_phy: hdmi-phy@1ef0000 {
+                       compatible = "allwinner,sun8i-h3-hdmi-phy";
+                       reg = <0x01ef0000 0x10000>;
+                       clocks = <&ccu CLK_BUS_HDMI>, <&ccu CLK_HDMI_DDC>,
+                                <&ccu 6>;
+                       clock-names = "bus", "mod", "pll-0";
+                       resets = <&ccu RST_BUS_HDMI0>;
+                       reset-names = "phy";
+                       #phy-cells = <0>;
+               };
+
+               rtc: rtc@1f00000 {
+                       compatible = "allwinner,sun6i-a31-rtc";
+                       reg = <0x01f00000 0x54>;
+                       interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>,
+                                    <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
+               };
+
+               r_ccu: clock@1f01400 {
+                       compatible = "allwinner,sun8i-h3-r-ccu";
+                       reg = <0x01f01400 0x100>;
+                       clocks = <&osc24M>, <&osc32k>, <&iosc>,
+                                <&ccu 9>;
+                       clock-names = "hosc", "losc", "iosc", "pll-periph";
+                       #clock-cells = <1>;
+                       #reset-cells = <1>;
+               };
+
+               codec_analog: codec-analog@1f015c0 {
+                       compatible = "allwinner,sun8i-h3-codec-analog";
+                       reg = <0x01f015c0 0x4>;
+               };
+
+               ir: ir@1f02000 {
+                       compatible = "allwinner,sun5i-a13-ir";
+                       clocks = <&r_ccu CLK_APB0_IR>, <&r_ccu CLK_IR>;
+                       clock-names = "apb", "ir";
+                       resets = <&r_ccu RST_APB0_IR>;
+                       interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
+                       reg = <0x01f02000 0x40>;
+                       status = "disabled";
+               };
+
+               r_i2c: i2c@1f02400 {
+                       compatible = "allwinner,sun6i-a31-i2c";
+                       reg = <0x01f02400 0x400>;
+                       interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&r_i2c_pins>;
+                       clocks = <&r_ccu CLK_APB0_I2C>;
+                       resets = <&r_ccu RST_APB0_I2C>;
+                       status = "disabled";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+               };
+
+               r_pio: pinctrl@1f02c00 {
+                       compatible = "allwinner,sun8i-h3-r-pinctrl";
+                       reg = <0x01f02c00 0x400>;
+                       interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&r_ccu CLK_APB0_PIO>, <&osc24M>, <&osc32k>;
+                       clock-names = "apb", "hosc", "losc";
+                       gpio-controller;
+                       #gpio-cells = <3>;
+                       interrupt-controller;
+                       #interrupt-cells = <3>;
+
+                       ir_pins_a: ir {
+                               pins = "PL11";
+                               function = "s_cir_rx";
+                       };
+
+                       r_i2c_pins: r-i2c {
+                               pins = "PL0", "PL1";
+                               function = "s_i2c";
+                       };
+               };
+       };
+};
index 5d01bba180e4a7115d8494338880c6003e14e90d..14c8ec16d47ea1b505460cb1f141de21b56b9e52 100644 (file)
 };
 
 &mmc0 {
-       pinctrl-names = "default";
-       pinctrl-0 = <&mmc0_pins_a>;
        vmmc-supply = <&reg_vcc_io>;
        bus-width = <4>;
        cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
        status = "okay";
 };
 
+&mmc2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc2_8bit_pins>;
+       vmmc-supply = <&reg_vcc_io>;
+       bus-width = <8>;
+       non-removable;
+       status = "okay";
+};
+
 &ohci1 {
        status = "okay";
 };
index 3a59016955c51cf25d8c32d6ac16e338eed24606..ee387127f37ec058053cc9b401119fa75fa58ce2 100644 (file)
@@ -60,7 +60,11 @@ struct sunxi_ccm_reg {
        u32 reserved11;
        u32 sata_clk_cfg;       /* 0xc8 SATA clock control (R40 only) */
        u32 usb_clk_cfg;        /* 0xcc USB clock control */
-       u32 gmac_clk_cfg;       /* 0xd0 GMAC clock control */
+#ifdef CONFIG_MACH_SUN8I_R40
+       u32 cir0_clk_cfg;       /* 0xd0 CIR0 clock control (R40 only) */
+#else
+       u32 gmac_clk_cfg;       /* 0xd0 GMAC clock control (not for R40) */
+#endif
        u32 reserved12[7];
        u32 mdfs_clk_cfg;       /* 0xf0 MDFS clock control */
        u32 dram_clk_cfg;       /* 0xf4 DRAM configuration clock control */
@@ -103,7 +107,11 @@ struct sunxi_ccm_reg {
        u32 mtc_clk_cfg;        /* 0x158 MTC module clock */
        u32 mbus0_clk_cfg;      /* 0x15c MBUS0 module clock */
        u32 mbus1_clk_cfg;      /* 0x160 MBUS1 module clock */
+#ifdef CONFIG_MACH_SUN8I_R40
+       u32 gmac_clk_cfg;       /* 0x164 GMAC clock control (R40 only) */
+#else
        u32 reserved16;
+#endif
        u32 mipi_dsi_clk_cfg;   /* 0x168 MIPI DSI clock control */
        u32 mipi_csi_clk_cfg;   /* 0x16c MIPI CSI clock control */
        u32 reserved17[4];
index 3624a03947f6a9157de69744b90a0a9413aa32b4..678e33dd40e8bb6501960fd47a9d4546562cbb67 100644 (file)
@@ -142,6 +142,8 @@ config MACH_SUN4I
        bool "sun4i (Allwinner A10)"
        select CPU_V7A
        select ARM_CORTEX_CPU_IS_UP
+       select DM_MMC if MMC
+       select DM_SCSI if SCSI
        select PHY_SUN4I_USB
        select DRAM_SUN4I
        select SUNXI_GEN_SUN4I
index 37cc2df5dcbe5f65057c070fea4562b39957ed5c..edcbb16cf693084879341a5f0de0cf14aa7b84f5 100644 (file)
@@ -14,6 +14,10 @@ CONFIG_SPL_I2C_SUPPORT=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_SCSI_AHCI=y
 CONFIG_AXP_DLDO4_VOLT=2500
+CONFIG_AXP_ALDO2_VOLT=2500
 CONFIG_AXP_ELDO3_VOLT=1200
 CONFIG_SCSI=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
+CONFIG_SUN8I_EMAC=y
+CONFIG_RGMII=y
+CONFIG_MACPWR="PA17"
index 0cbcd48aadb8f1092a586d71bb8389bcf8dc55fe..071be93697cbd3bb895244bf994c719dffff1c92 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_MACH_SUN8I_H3=y
 CONFIG_DRAM_CLK=672
 CONFIG_DRAM_ZQ=3881979
 CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-libretech-all-h3-cc"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 # CONFIG_CMD_FLASH is not set
index 185facdf3eab8b0190aa068619a344837bbff1a6..c20ad9f3a2490f14eb67c68321e26245a6f5ef8e 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_MACH_SUN8I_H3=y
 CONFIG_DRAM_CLK=672
 CONFIG_DRAM_ZQ=3881979
 CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-libretech-all-h3-cc"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 # CONFIG_CMD_FLASH is not set
index 061bddc8fd5e554cf0e058c2e49edd5744f7ceba..5db8dfcd4f985f794073b401c3002c7e1bc63740 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_MACH_SUN50I_H5=y
 CONFIG_DRAM_CLK=672
 CONFIG_DRAM_ZQ=3881979
 CONFIG_DRAM_ODT_EN=y
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-libretech-all-h3-cc"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 # CONFIG_CMD_FLASH is not set
index 05436a1b43fa7bdf07dc615db9721e1d145edc85..c79c111b5d6707e465b5a700d1b7224743add8a9 100644 (file)
@@ -10,7 +10,7 @@ CONFIG_DRAM_ODT_EN=y
 CONFIG_MMC0_CD_PIN=""
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 CONFIG_SPL_SPI_SUNXI=y
-CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-sopine-baseboard"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_SPL_DOS_PARTITION is not set
index fe6d82c7b4eb4a3f2aac900b15eef3296008b805..7fa1ae8b162f61a755e4d783755e6eda57757647 100644 (file)
@@ -637,7 +637,9 @@ static int sunxi_mmc_bind(struct udevice *dev)
 }
 
 static const struct udevice_id sunxi_mmc_ids[] = {
+       { .compatible = "allwinner,sun4i-a10-mmc" },
        { .compatible = "allwinner,sun5i-a13-mmc" },
+       { .compatible = "allwinner,sun7i-a20-mmc" },
        { }
 };
 
index 1f5c630e0232f9faaca3d481087338888bd7708a..3ba3a1ff8be2df98f3811908e1f8f5f3416aa624 100644 (file)
 
 #define AHB_GATE_OFFSET_EPHY   0
 
-#if defined(CONFIG_MACH_SUNXI_H3_H5)
-#define SUN8I_GPD8_GMAC                2
-#else
-#define SUN8I_GPD8_GMAC                4
-#endif
+/* IO mux settings */
+#define SUN8I_IOMUX_H3         2
+#define SUN8I_IOMUX_R40        5
+#define SUN8I_IOMUX            4
 
 /* H3/A64 EMAC Register's offset */
 #define EMAC_CTL0              0x00
@@ -99,6 +98,7 @@ enum emac_variant {
        A83T_EMAC = 1,
        H3_EMAC,
        A64_EMAC,
+       R40_GMAC,
 };
 
 struct emac_dma_desc {
@@ -280,6 +280,9 @@ static int sun8i_emac_set_syscon(struct emac_eth_dev *priv)
 
        reg = readl(priv->sysctl_reg + 0x30);
 
+       if (priv->variant == R40_GMAC)
+               return 0;
+
        if (priv->variant == H3_EMAC) {
                ret = sun8i_emac_set_syscon_ephy(priv, &reg);
                if (ret)
@@ -453,6 +456,7 @@ static int _sun8i_emac_eth_init(struct emac_eth_dev *priv, u8 *enetaddr)
 
 static int parse_phy_pins(struct udevice *dev)
 {
+       struct emac_eth_dev *priv = dev_get_priv(dev);
        int offset;
        const char *pin_name;
        int drive, pull = SUN4I_PINCTRL_NO_PULL, i;
@@ -494,7 +498,13 @@ static int parse_phy_pins(struct udevice *dev)
                if (pin < 0)
                        continue;
 
-               sunxi_gpio_set_cfgpin(pin, SUN8I_GPD8_GMAC);
+               if (priv->variant == H3_EMAC)
+                       sunxi_gpio_set_cfgpin(pin, SUN8I_IOMUX_H3);
+               else if (priv->variant == R40_GMAC)
+                       sunxi_gpio_set_cfgpin(pin, SUN8I_IOMUX_R40);
+               else
+                       sunxi_gpio_set_cfgpin(pin, SUN8I_IOMUX);
+
                if (drive != ~0)
                        sunxi_gpio_set_drv(pin, drive);
                if (pull != ~0)
@@ -618,22 +628,39 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv)
 {
        struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
 
-#ifdef CONFIG_MACH_SUNXI_H3_H5
-       /* Only H3/H5 have clock controls for internal EPHY */
-       if (priv->use_internal_phy) {
-               /* Set clock gating for ephy */
-               setbits_le32(&ccm->bus_gate4, BIT(AHB_GATE_OFFSET_EPHY));
-
-               /* Deassert EPHY */
-               setbits_le32(&ccm->ahb_reset2_cfg, BIT(AHB_RESET_OFFSET_EPHY));
+       if (priv->variant == H3_EMAC) {
+               /* Only H3/H5 have clock controls for internal EPHY */
+               if (priv->use_internal_phy) {
+                       /* Set clock gating for ephy */
+                       setbits_le32(&ccm->bus_gate4,
+                                    BIT(AHB_GATE_OFFSET_EPHY));
+
+                       /* Deassert EPHY */
+                       setbits_le32(&ccm->ahb_reset2_cfg,
+                                    BIT(AHB_RESET_OFFSET_EPHY));
+               }
        }
-#endif
-
-       /* Set clock gating for emac */
-       setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_GMAC));
 
-       /* De-assert EMAC */
-       setbits_le32(&ccm->ahb_reset0_cfg, BIT(AHB_RESET_OFFSET_GMAC));
+       if (priv->variant == R40_GMAC) {
+               /* Set clock gating for emac */
+               setbits_le32(&ccm->ahb_reset1_cfg, BIT(AHB_RESET_OFFSET_GMAC));
+
+               /* De-assert EMAC */
+               setbits_le32(&ccm->ahb_gate1, BIT(AHB_GATE_OFFSET_GMAC));
+
+               /* Select RGMII for R40 */
+               setbits_le32(&ccm->gmac_clk_cfg,
+                            CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII |
+                            CCM_GMAC_CTRL_GPIT_RGMII);
+               setbits_le32(&ccm->gmac_clk_cfg,
+                            CCM_GMAC_CTRL_TX_CLK_DELAY(CONFIG_GMAC_TX_DELAY));
+       } else {
+               /* Set clock gating for emac */
+               setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_GMAC));
+
+               /* De-assert EMAC */
+               setbits_le32(&ccm->ahb_reset0_cfg, BIT(AHB_RESET_OFFSET_GMAC));
+       }
 }
 
 #if defined(CONFIG_DM_GPIO)
@@ -800,22 +827,32 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
                return -EINVAL;
        }
 
-       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__);
+       priv->variant = dev_get_driver_data(dev);
+
+       if (!priv->variant) {
+               printf("%s: Missing variant\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;
+
+       if (priv->variant != R40_GMAC) {
+               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;
+               }
        }
 
        pdata->phy_interface = -1;
@@ -840,14 +877,6 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
                return -EINVAL;
        }
 
-       priv->variant = dev_get_driver_data(dev);
-
-       if (!priv->variant) {
-               printf("%s: Missing variant '%s'\n", __func__,
-                      (char *)priv->variant);
-               return -EINVAL;
-       }
-
        if (priv->variant == H3_EMAC) {
                int parent = fdt_parent_offset(gd->fdt_blob, offset);
 
@@ -888,6 +917,8 @@ static const struct udevice_id sun8i_emac_eth_ids[] = {
                .data = (uintptr_t)A64_EMAC },
        {.compatible = "allwinner,sun8i-a83t-emac",
                .data = (uintptr_t)A83T_EMAC },
+       {.compatible = "allwinner,sun8i-r40-gmac",
+               .data = (uintptr_t)R40_GMAC },
        { }
 };
 
diff --git a/include/dt-bindings/clock/sun8i-de2.h b/include/dt-bindings/clock/sun8i-de2.h
new file mode 100644 (file)
index 0000000..3bed63b
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.io>
+ *
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_SUN8I_DE2_H_
+#define _DT_BINDINGS_CLOCK_SUN8I_DE2_H_
+
+#define CLK_BUS_MIXER0         0
+#define CLK_BUS_MIXER1         1
+#define CLK_BUS_WB             2
+
+#define CLK_MIXER0             6
+#define CLK_MIXER1             7
+#define CLK_WB                 8
+
+#endif /* _DT_BINDINGS_CLOCK_SUN8I_DE2_H_ */
diff --git a/include/dt-bindings/clock/sun8i-r-ccu.h b/include/dt-bindings/clock/sun8i-r-ccu.h
new file mode 100644 (file)
index 0000000..779d20a
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * 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.
+ */
+
+#ifndef _DT_BINDINGS_CLK_SUN8I_R_CCU_H_
+#define _DT_BINDINGS_CLK_SUN8I_R_CCU_H_
+
+#define CLK_AR100              0
+
+#define CLK_APB0_PIO           3
+#define CLK_APB0_IR            4
+#define CLK_APB0_TIMER         5
+#define CLK_APB0_RSB           6
+#define CLK_APB0_UART          7
+/* 8 is reserved for CLK_APB0_W1 on A31 */
+#define CLK_APB0_I2C           9
+#define CLK_APB0_TWD           10
+
+#define CLK_IR                 11
+
+#endif /* _DT_BINDINGS_CLK_SUN8I_R_CCU_H_ */
diff --git a/include/dt-bindings/reset/sun8i-de2.h b/include/dt-bindings/reset/sun8i-de2.h
new file mode 100644 (file)
index 0000000..9526017
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.io>
+ *
+ * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+ */
+
+#ifndef _DT_BINDINGS_RESET_SUN8I_DE2_H_
+#define _DT_BINDINGS_RESET_SUN8I_DE2_H_
+
+#define RST_MIXER0     0
+#define RST_MIXER1     1
+#define RST_WB         2
+
+#endif /* _DT_BINDINGS_RESET_SUN8I_DE2_H_ */
diff --git a/include/dt-bindings/reset/sun8i-r-ccu.h b/include/dt-bindings/reset/sun8i-r-ccu.h
new file mode 100644 (file)
index 0000000..4ba64f3
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz>
+ *
+ * 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.
+ */
+
+#ifndef _DT_BINDINGS_RST_SUN8I_R_CCU_H_
+#define _DT_BINDINGS_RST_SUN8I_R_CCU_H_
+
+#define RST_APB0_IR            0
+#define RST_APB0_TIMER         1
+#define RST_APB0_RSB           2
+#define RST_APB0_UART          3
+/* 4 is reserved for RST_APB0_W1 on A31 */
+#define RST_APB0_I2C           5
+
+#endif /* _DT_BINDINGS_RST_SUN8I_R_CCU_H_ */