16130b1f6SAntony Antony/*
26130b1f6SAntony Antony * Copyright (C) 2017 Antony Antony <antony@phenome.org>
3*1caeae37SAndre Przywara * Copyright (C) 2016 ARM Ltd.
46130b1f6SAntony Antony *
56130b1f6SAntony Antony * This file is dual-licensed: you can use it either under the terms
66130b1f6SAntony Antony * of the GPL or the X11 license, at your option. Note that this dual
76130b1f6SAntony Antony * licensing only applies to this file, and not this project as a
86130b1f6SAntony Antony * whole.
96130b1f6SAntony Antony *
10*1caeae37SAndre Przywara *  a) This file is free software; you can redistribute it and/or
116130b1f6SAntony Antony *     modify it under the terms of the GNU General Public License as
126130b1f6SAntony Antony *     published by the Free Software Foundation; either version 2 of the
136130b1f6SAntony Antony *     License, or (at your option) any later version.
146130b1f6SAntony Antony *
15*1caeae37SAndre Przywara *     This file is distributed in the hope that it will be useful,
166130b1f6SAntony Antony *     but WITHOUT ANY WARRANTY; without even the implied warranty of
176130b1f6SAntony Antony *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
186130b1f6SAntony Antony *     GNU General Public License for more details.
196130b1f6SAntony Antony *
206130b1f6SAntony Antony * Or, alternatively,
216130b1f6SAntony Antony *
226130b1f6SAntony Antony *  b) Permission is hereby granted, free of charge, to any person
236130b1f6SAntony Antony *     obtaining a copy of this software and associated documentation
246130b1f6SAntony Antony *     files (the "Software"), to deal in the Software without
256130b1f6SAntony Antony *     restriction, including without limitation the rights to use,
266130b1f6SAntony Antony *     copy, modify, merge, publish, distribute, sublicense, and/or
276130b1f6SAntony Antony *     sell copies of the Software, and to permit persons to whom the
286130b1f6SAntony Antony *     Software is furnished to do so, subject to the following
296130b1f6SAntony Antony *     conditions:
306130b1f6SAntony Antony *
316130b1f6SAntony Antony *     The above copyright notice and this permission notice shall be
326130b1f6SAntony Antony *     included in all copies or substantial portions of the Software.
336130b1f6SAntony Antony *
346130b1f6SAntony Antony *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
356130b1f6SAntony Antony *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
366130b1f6SAntony Antony *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
376130b1f6SAntony Antony *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
386130b1f6SAntony Antony *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
396130b1f6SAntony Antony *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
406130b1f6SAntony Antony *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
416130b1f6SAntony Antony *     OTHER DEALINGS IN THE SOFTWARE.
426130b1f6SAntony Antony */
436130b1f6SAntony Antony
446130b1f6SAntony Antony/dts-v1/;
456130b1f6SAntony Antony#include "sun50i-h5.dtsi"
466130b1f6SAntony Antony
476130b1f6SAntony Antony#include <dt-bindings/gpio/gpio.h>
48*1caeae37SAndre Przywara#include <dt-bindings/input/input.h>
49*1caeae37SAndre Przywara#include <dt-bindings/pinctrl/sun4i-a10.h>
506130b1f6SAntony Antony
516130b1f6SAntony Antony/ {
526130b1f6SAntony Antony	model = "FriendlyARM NanoPi NEO Plus2";
536130b1f6SAntony Antony	compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
546130b1f6SAntony Antony
556130b1f6SAntony Antony	aliases {
56*1caeae37SAndre Przywara		ethernet0 = &emac;
576130b1f6SAntony Antony		serial0 = &uart0;
586130b1f6SAntony Antony	};
596130b1f6SAntony Antony
606130b1f6SAntony Antony	chosen {
616130b1f6SAntony Antony		stdout-path = "serial0:115200n8";
626130b1f6SAntony Antony	};
636130b1f6SAntony Antony
64*1caeae37SAndre Przywara	leds {
65*1caeae37SAndre Przywara		compatible = "gpio-leds";
66*1caeae37SAndre Przywara
67*1caeae37SAndre Przywara		pwr {
68*1caeae37SAndre Przywara			label = "nanopi:green:pwr";
69*1caeae37SAndre Przywara			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
70*1caeae37SAndre Przywara			default-state = "on";
71*1caeae37SAndre Przywara		};
72*1caeae37SAndre Przywara
73*1caeae37SAndre Przywara		status {
74*1caeae37SAndre Przywara			label = "nanopi:red:status";
75*1caeae37SAndre Przywara			gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
76*1caeae37SAndre Przywara		};
77*1caeae37SAndre Przywara	};
78*1caeae37SAndre Przywara
79*1caeae37SAndre Przywara	reg_gmac_3v3: gmac-3v3 {
80*1caeae37SAndre Przywara		compatible = "regulator-fixed";
81*1caeae37SAndre Przywara		pinctrl-names = "default";
82*1caeae37SAndre Przywara		regulator-name = "gmac-3v3";
83*1caeae37SAndre Przywara		regulator-min-microvolt = <3300000>;
84*1caeae37SAndre Przywara		regulator-max-microvolt = <3300000>;
85*1caeae37SAndre Przywara		startup-delay-us = <100000>;
86*1caeae37SAndre Przywara		enable-active-high;
87*1caeae37SAndre Przywara		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
88*1caeae37SAndre Przywara	};
89*1caeae37SAndre Przywara
906130b1f6SAntony Antony	reg_vcc3v3: vcc3v3 {
916130b1f6SAntony Antony		compatible = "regulator-fixed";
926130b1f6SAntony Antony		regulator-name = "vcc3v3";
936130b1f6SAntony Antony		regulator-min-microvolt = <3300000>;
946130b1f6SAntony Antony		regulator-max-microvolt = <3300000>;
956130b1f6SAntony Antony	};
96*1caeae37SAndre Przywara
97*1caeae37SAndre Przywara	vdd_cpux: gpio-regulator {
98*1caeae37SAndre Przywara		compatible = "regulator-gpio";
99*1caeae37SAndre Przywara		pinctrl-names = "default";
100*1caeae37SAndre Przywara		regulator-name = "vdd-cpux";
101*1caeae37SAndre Przywara		regulator-type = "voltage";
102*1caeae37SAndre Przywara		regulator-boot-on;
103*1caeae37SAndre Przywara		regulator-always-on;
104*1caeae37SAndre Przywara		regulator-min-microvolt = <1100000>;
105*1caeae37SAndre Przywara		regulator-max-microvolt = <1300000>;
106*1caeae37SAndre Przywara		regulator-ramp-delay = <50>; /* 4ms */
107*1caeae37SAndre Przywara		gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
108*1caeae37SAndre Przywara		gpios-states = <0x1>;
109*1caeae37SAndre Przywara		states = <1100000 0x0
110*1caeae37SAndre Przywara			  1300000 0x1>;
1116130b1f6SAntony Antony	};
1126130b1f6SAntony Antony
113*1caeae37SAndre Przywara	wifi_pwrseq: wifi_pwrseq {
114*1caeae37SAndre Przywara		compatible = "mmc-pwrseq-simple";
115*1caeae37SAndre Przywara		pinctrl-names = "default";
116*1caeae37SAndre Przywara		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
117*1caeae37SAndre Przywara		post-power-on-delay-ms = <200>;
118*1caeae37SAndre Przywara	};
119*1caeae37SAndre Przywara};
120*1caeae37SAndre Przywara
121*1caeae37SAndre Przywara&codec {
122*1caeae37SAndre Przywara	allwinner,audio-routing =
123*1caeae37SAndre Przywara		"Line Out", "LINEOUT",
124*1caeae37SAndre Przywara		"MIC1", "Mic",
125*1caeae37SAndre Przywara		"Mic",  "MBIAS";
1266130b1f6SAntony Antony	status = "okay";
1276130b1f6SAntony Antony};
1286130b1f6SAntony Antony
129*1caeae37SAndre Przywara&ehci0 {
130*1caeae37SAndre Przywara	status = "okay";
131*1caeae37SAndre Przywara};
132*1caeae37SAndre Przywara
133*1caeae37SAndre Przywara&ehci3 {
134*1caeae37SAndre Przywara	status = "okay";
135*1caeae37SAndre Przywara};
136*1caeae37SAndre Przywara
137*1caeae37SAndre Przywara&emac {
138*1caeae37SAndre Przywara	pinctrl-names = "default";
139*1caeae37SAndre Przywara	pinctrl-0 = <&emac_rgmii_pins>;
140*1caeae37SAndre Przywara	phy-supply = <&reg_gmac_3v3>;
141*1caeae37SAndre Przywara	phy-handle = <&ext_rgmii_phy>;
142*1caeae37SAndre Przywara	phy-mode = "rgmii";
143*1caeae37SAndre Przywara	status = "okay";
144*1caeae37SAndre Przywara};
145*1caeae37SAndre Przywara
146*1caeae37SAndre Przywara&external_mdio {
147*1caeae37SAndre Przywara	ext_rgmii_phy: ethernet-phy@7 {
148*1caeae37SAndre Przywara		compatible = "ethernet-phy-ieee802.3-c22";
149*1caeae37SAndre Przywara		reg = <7>;
150*1caeae37SAndre Przywara	};
151*1caeae37SAndre Przywara};
152*1caeae37SAndre Przywara
1536130b1f6SAntony Antony&mmc0 {
1546130b1f6SAntony Antony	vmmc-supply = <&reg_vcc3v3>;
1556130b1f6SAntony Antony	bus-width = <4>;
156*1caeae37SAndre Przywara	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
1576130b1f6SAntony Antony	status = "okay";
1586130b1f6SAntony Antony};
1596130b1f6SAntony Antony
160*1caeae37SAndre Przywara&mmc1 {
161*1caeae37SAndre Przywara	vmmc-supply = <&reg_vcc3v3>;
162*1caeae37SAndre Przywara	vqmmc-supply = <&reg_vcc3v3>;
163*1caeae37SAndre Przywara	mmc-pwrseq = <&wifi_pwrseq>;
164*1caeae37SAndre Przywara	bus-width = <4>;
165*1caeae37SAndre Przywara	non-removable;
166*1caeae37SAndre Przywara	status = "okay";
167*1caeae37SAndre Przywara
168*1caeae37SAndre Przywara	brcmf: wifi@1 {
169*1caeae37SAndre Przywara		reg = <1>;
170*1caeae37SAndre Przywara		compatible = "brcm,bcm4329-fmac";
171*1caeae37SAndre Przywara	};
172*1caeae37SAndre Przywara};
173*1caeae37SAndre Przywara
1746130b1f6SAntony Antony&mmc2 {
1756130b1f6SAntony Antony	pinctrl-names = "default";
1766130b1f6SAntony Antony	pinctrl-0 = <&mmc2_8bit_pins>;
1776130b1f6SAntony Antony	vmmc-supply = <&reg_vcc3v3>;
1786130b1f6SAntony Antony	bus-width = <8>;
1796130b1f6SAntony Antony	non-removable;
1806130b1f6SAntony Antony	cap-mmc-hw-reset;
1816130b1f6SAntony Antony	status = "okay";
1826130b1f6SAntony Antony};
1836130b1f6SAntony Antony
184*1caeae37SAndre Przywara&ohci0 {
185*1caeae37SAndre Przywara	status = "okay";
186*1caeae37SAndre Przywara};
187*1caeae37SAndre Przywara
188*1caeae37SAndre Przywara&ohci3 {
1896130b1f6SAntony Antony	status = "okay";
1906130b1f6SAntony Antony};
1916130b1f6SAntony Antony
1926130b1f6SAntony Antony&uart0 {
1936130b1f6SAntony Antony	pinctrl-names = "default";
1946130b1f6SAntony Antony	pinctrl-0 = <&uart0_pins_a>;
1956130b1f6SAntony Antony	status = "okay";
1966130b1f6SAntony Antony};
1976130b1f6SAntony Antony
198*1caeae37SAndre Przywara&usb_otg {
199*1caeae37SAndre Przywara	dr_mode = "host";
200*1caeae37SAndre Przywara	status = "okay";
201*1caeae37SAndre Przywara};
202*1caeae37SAndre Przywara
2036130b1f6SAntony Antony&usbphy {
204*1caeae37SAndre Przywara	/* USB Type-A ports' VBUS is always on */
2056130b1f6SAntony Antony	status = "okay";
2066130b1f6SAntony Antony};
207