]> git.sur5r.net Git - u-boot/commitdiff
sunxi: DT: H5: update board .dts files from Linux
authorAndre Przywara <andre.przywara@arm.com>
Wed, 4 Jul 2018 13:16:37 +0000 (14:16 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Mon, 16 Jul 2018 06:33:05 +0000 (12:03 +0530)
Update the .dts file for the various boards with an Allwinner H5 SoC.
This is as of v4.18-rc3, exactly Linux commit:
commit af5d05bdc99c211729cba0a3d5417bccfa308caf
Author: Neil Armstrong <narmstrong@baylibre.com>
Date:   Tue Apr 24 13:47:14 2018 +0200

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

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
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

index a7e53c5c26b4159dd07d5092b9a66b9bb2d31ed3..a35f77de22d87162ab0f0c6801224f79e9f0aef2 100644 (file)
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 /*
 // 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"
  */
 
 /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";
 
 / {
        model = "Libre Computer Board ALL-H3-CC H5";
index 8b509c94c5eaf692e69bf668e1f15c1c0bb2569c..506e25ba028abc9c0b3c73b67622a8be9bf0df96 100644 (file)
@@ -1,18 +1,18 @@
 /*
  * Copyright (C) 2017 Antony Antony <antony@phenome.org>
 /*
  * 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.
  *
  *
  * 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.
  *
  *     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.
  *     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/;
  */
 
 /dts-v1/;
-
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #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 {
        compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
                serial0 = &uart0;
        };
 
                stdout-path = "serial0:115200n8";
        };
 
                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>;
        };
        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>;
+       };
+};
+
+&codec {
+       allwinner,audio-routing =
+               "Line Out", "LINEOUT",
+               "MIC1", "Mic",
+               "Mic",  "MBIAS";
+       status = "okay";
 };
 
 };
 
-&ehci1 {
+&ehci0 {
        status = "okay";
 };
 
        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@7 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <7>;
+       };
+};
+
 &mmc0 {
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
 &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";
        status = "okay";
+
+       brcmf: wifi@1 {
+               reg = <1>;
+               compatible = "brcm,bcm4329-fmac";
+       };
 };
 
 &mmc2 {
 };
 
 &mmc2 {
        status = "okay";
 };
 
        status = "okay";
 };
 
-&ohci1 {
+&ohci0 {
+       status = "okay";
+};
+
+&ohci3 {
        status = "okay";
 };
 
        status = "okay";
 };
 
        status = "okay";
 };
 
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usbphy {
 &usbphy {
+       /* USB Type-A ports' VBUS is always on */
        status = "okay";
 };
        status = "okay";
 };
index 5e4dad731620f49aaa9eab0ac2d6d43b36bc5c1e..cc268a69786c532f46e9d8d1ae81e9eadc24c2d0 100644 (file)
@@ -1,18 +1,17 @@
 /*
  * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
 /*
  * 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.
  *
  *
  * 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.
  *
  *     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.
  *     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/;
  */
 
 /dts-v1/;
-
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
@@ -52,6 +50,7 @@
        compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
 
        aliases {
        compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
                serial0 = &uart0;
        };
 
                stdout-path = "serial0:115200n8";
        };
 
                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_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";
+       };
+};
+
+&ehci0 {
+       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@7 {
+               compatible = "ethernet-phy-ieee802.3-c22";
+               reg = <7>;
+       };
 };
 
 &mmc0 {
 };
 
 &mmc0 {
-       compatible = "allwinner,sun50i-h5-mmc",
-                    "allwinner,sun50i-a64-mmc",
-                    "allwinner,sun5i-a13-mmc";
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
        cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
        status = "okay";
 };
 
        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";
 };
 &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 92079dbfe0910c4771f813c6e3322e2a6a2d32c3..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.
  *
  *
  * 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.
  *
  *     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.
  *     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/;
  */
 
 /dts-v1/;
-
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #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 {
 
        aliases {
-               serial0 = &uart0;
                ethernet0 = &emac;
                ethernet0 = &emac;
+               serial0 = &uart0;
        };
 
        chosen {
                stdout-path = "serial0:115200n8";
        };
 
        };
 
        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 {
 };
 
 &ehci0 {
        status = "okay";
 };
 
        status = "okay";
 };
 
+&ehci2 {
+       status = "okay";
+};
+
+&ehci3 {
+       status = "okay";
+};
+
 &emac {
        pinctrl-names = "default";
        pinctrl-0 = <&emac_rgmii_pins>;
 &emac {
        pinctrl-names = "default";
        pinctrl-0 = <&emac_rgmii_pins>;
-       phy-mode = "rgmii";
+       phy-supply = <&reg_gmac_3v3>;
        phy-handle = <&ext_rgmii_phy>;
        phy-handle = <&ext_rgmii_phy>;
+       phy-mode = "rgmii";
        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>;
+       status = "okay";
+};
+
 &mmc0 {
 &mmc0 {
-       compatible = "allwinner,sun50i-h5-mmc",
-                    "allwinner,sun50i-a64-mmc",
-                    "allwinner,sun5i-a13-mmc";
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
        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";
 };
 
        status = "okay";
 };
 
        status = "okay";
 };
 
+&ohci2 {
+       status = "okay";
+};
+
+&ohci3 {
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        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_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";
 };
        status = "okay";
 };
index 540e5c7d93e6d0b589dd70f7bd7ff289dd774b40..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.
  *
  *
  * 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.
  *
  *     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.
  *     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/;
  */
 
 /dts-v1/;
-
 #include "sun50i-h5.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #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 {
        compatible = "xunlong,orangepi-prime", "allwinner,sun50i-h5";
 
        aliases {
+               ethernet0 = &emac;
                serial0 = &uart0;
        };
 
                serial0 = &uart0;
        };
 
                stdout-path = "serial0:115200n8";
        };
 
                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 {
 };
 
 &ehci0 {
        status = "okay";
 };
 
        status = "okay";
 };
 
+&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 = <&ir_pins_a>;
+       status = "okay";
+};
+
 &mmc0 {
 &mmc0 {
-       compatible = "allwinner,sun50i-h5-mmc",
-                    "allwinner,sun50i-a64-mmc",
-                    "allwinner,sun5i-a13-mmc";
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
        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";
 };
 
        status = "okay";
 };
 
        status = "okay";
 };
 
+&ohci2 {
+       status = "okay";
+};
+
+&ohci3 {
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
        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_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";
 };
        status = "okay";
 };
index bc39abead0533aaf6eaba68802eae086ca6fb9d8..53c8c11620e0e32cae0642990f2c6a4e314a8683 100644 (file)
@@ -46,7 +46,6 @@
 
 #include <dt-bindings/gpio/gpio.h>
 
 
 #include <dt-bindings/gpio/gpio.h>
 
-
 / {
        model = "OrangePi Zero Plus2";
        compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
 / {
        model = "OrangePi Zero Plus2";
        compatible = "xunlong,orangepi-zero-plus2", "allwinner,sun50i-h5";
                stdout-path = "serial0:115200n8";
        };
 
                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>;
        };
        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 {
 };
 
 &mmc0 {
-       compatible = "allwinner,sun50i-h5-mmc",
-                    "allwinner,sun50i-a64-mmc",
-                    "allwinner,sun5i-a13-mmc";
        vmmc-supply = <&reg_vcc3v3>;
        bus-width = <4>;
        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";
 };
 
        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-names = "default";
        pinctrl-0 = <&mmc2_8bit_pins>;
 &mmc2 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc2_8bit_pins>;
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
        pinctrl-0 = <&uart0_pins_a>;
        status = "okay";
 };
+
+&uart1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+       status = "okay";
+};