1d7341305SAntony Antony/*
2d7341305SAntony Antony * Copyright (C) 2017 Antony Antony <antony@phenome.org>
3d7341305SAntony Antony * Copyright (C) 2016 ARM Ltd.
4d7341305SAntony Antony *
5d7341305SAntony Antony * This file is dual-licensed: you can use it either under the terms
6d7341305SAntony Antony * of the GPL or the X11 license, at your option. Note that this dual
7d7341305SAntony Antony * licensing only applies to this file, and not this project as a
8d7341305SAntony Antony * whole.
9d7341305SAntony Antony *
10d7341305SAntony Antony *  a) This file is free software; you can redistribute it and/or
11d7341305SAntony Antony *     modify it under the terms of the GNU General Public License as
12d7341305SAntony Antony *     published by the Free Software Foundation; either version 2 of the
13d7341305SAntony Antony *     License, or (at your option) any later version.
14d7341305SAntony Antony *
15d7341305SAntony Antony *     This file is distributed in the hope that it will be useful,
16d7341305SAntony Antony *     but WITHOUT ANY WARRANTY; without even the implied warranty of
17d7341305SAntony Antony *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18d7341305SAntony Antony *     GNU General Public License for more details.
19d7341305SAntony Antony *
20d7341305SAntony Antony * Or, alternatively,
21d7341305SAntony Antony *
22d7341305SAntony Antony *  b) Permission is hereby granted, free of charge, to any person
23d7341305SAntony Antony *     obtaining a copy of this software and associated documentation
24d7341305SAntony Antony *     files (the "Software"), to deal in the Software without
25d7341305SAntony Antony *     restriction, including without limitation the rights to use,
26d7341305SAntony Antony *     copy, modify, merge, publish, distribute, sublicense, and/or
27d7341305SAntony Antony *     sell copies of the Software, and to permit persons to whom the
28d7341305SAntony Antony *     Software is furnished to do so, subject to the following
29d7341305SAntony Antony *     conditions:
30d7341305SAntony Antony *
31d7341305SAntony Antony *     The above copyright notice and this permission notice shall be
32d7341305SAntony Antony *     included in all copies or substantial portions of the Software.
33d7341305SAntony Antony *
34d7341305SAntony Antony *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35d7341305SAntony Antony *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36d7341305SAntony Antony *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37d7341305SAntony Antony *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38d7341305SAntony Antony *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39d7341305SAntony Antony *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40d7341305SAntony Antony *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41d7341305SAntony Antony *     OTHER DEALINGS IN THE SOFTWARE.
42d7341305SAntony Antony */
43d7341305SAntony Antony
44d7341305SAntony Antony/dts-v1/;
45d7341305SAntony Antony#include "sun50i-h5.dtsi"
46d7341305SAntony Antony
47d7341305SAntony Antony#include <dt-bindings/gpio/gpio.h>
48d7341305SAntony Antony#include <dt-bindings/input/input.h>
49d7341305SAntony Antony#include <dt-bindings/pinctrl/sun4i-a10.h>
50d7341305SAntony Antony
51d7341305SAntony Antony/ {
52d7341305SAntony Antony	model = "FriendlyARM NanoPi NEO Plus2";
53d7341305SAntony Antony	compatible = "friendlyarm,nanopi-neo-plus2", "allwinner,sun50i-h5";
54d7341305SAntony Antony
55d7341305SAntony Antony	aliases {
5627d7f929SAntony Antony		ethernet0 = &emac;
57d7341305SAntony Antony		serial0 = &uart0;
58d7341305SAntony Antony	};
59d7341305SAntony Antony
60d7341305SAntony Antony	chosen {
61d7341305SAntony Antony		stdout-path = "serial0:115200n8";
62d7341305SAntony Antony	};
63d7341305SAntony Antony
64d7341305SAntony Antony	leds {
65d7341305SAntony Antony		compatible = "gpio-leds";
66d7341305SAntony Antony
67d7341305SAntony Antony		pwr {
68d7341305SAntony Antony			label = "nanopi:green:pwr";
69d7341305SAntony Antony			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
70d7341305SAntony Antony			default-state = "on";
71d7341305SAntony Antony		};
72d7341305SAntony Antony
73d7341305SAntony Antony		status {
74d7341305SAntony Antony			label = "nanopi:red:status";
75d7341305SAntony Antony			gpios = <&pio 0 20 GPIO_ACTIVE_HIGH>;
76d7341305SAntony Antony		};
77d7341305SAntony Antony	};
78d7341305SAntony Antony
79d7341305SAntony Antony	reg_gmac_3v3: gmac-3v3 {
80d7341305SAntony Antony		compatible = "regulator-fixed";
81d7341305SAntony Antony		pinctrl-names = "default";
82d7341305SAntony Antony		regulator-name = "gmac-3v3";
83d7341305SAntony Antony		regulator-min-microvolt = <3300000>;
84d7341305SAntony Antony		regulator-max-microvolt = <3300000>;
85d7341305SAntony Antony		startup-delay-us = <100000>;
86d7341305SAntony Antony		enable-active-high;
87d7341305SAntony Antony		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
88d7341305SAntony Antony	};
89d7341305SAntony Antony
90d7341305SAntony Antony	reg_vcc3v3: vcc3v3 {
91d7341305SAntony Antony		compatible = "regulator-fixed";
92d7341305SAntony Antony		regulator-name = "vcc3v3";
93d7341305SAntony Antony		regulator-min-microvolt = <3300000>;
94d7341305SAntony Antony		regulator-max-microvolt = <3300000>;
95d7341305SAntony Antony	};
96d7341305SAntony Antony
97d7341305SAntony Antony	vdd_cpux: gpio-regulator {
98d7341305SAntony Antony		compatible = "regulator-gpio";
99d7341305SAntony Antony		pinctrl-names = "default";
100d7341305SAntony Antony		regulator-name = "vdd-cpux";
101d7341305SAntony Antony		regulator-type = "voltage";
102d7341305SAntony Antony		regulator-boot-on;
103d7341305SAntony Antony		regulator-always-on;
104d7341305SAntony Antony		regulator-min-microvolt = <1100000>;
105d7341305SAntony Antony		regulator-max-microvolt = <1300000>;
106d7341305SAntony Antony		regulator-ramp-delay = <50>; /* 4ms */
107d7341305SAntony Antony		gpios = <&r_pio 0 6 GPIO_ACTIVE_HIGH>;
108d7341305SAntony Antony		gpios-states = <0x1>;
109d7341305SAntony Antony		states = <1100000 0x0
110d7341305SAntony Antony			  1300000 0x1>;
111d7341305SAntony Antony	};
112d7341305SAntony Antony
113d7341305SAntony Antony	wifi_pwrseq: wifi_pwrseq {
114d7341305SAntony Antony		compatible = "mmc-pwrseq-simple";
115d7341305SAntony Antony		pinctrl-names = "default";
116d7341305SAntony Antony		reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
117d7341305SAntony Antony		post-power-on-delay-ms = <200>;
118d7341305SAntony Antony	};
119d7341305SAntony Antony};
120d7341305SAntony Antony
121d7341305SAntony Antony&codec {
122d7341305SAntony Antony	allwinner,audio-routing =
123d7341305SAntony Antony		"Line Out", "LINEOUT",
124d7341305SAntony Antony		"MIC1", "Mic",
125d7341305SAntony Antony		"Mic",  "MBIAS";
126d7341305SAntony Antony	status = "okay";
127d7341305SAntony Antony};
128d7341305SAntony Antony
129d7341305SAntony Antony&ehci0 {
130d7341305SAntony Antony	status = "okay";
131d7341305SAntony Antony};
132d7341305SAntony Antony
133d7341305SAntony Antony&ehci3 {
134d7341305SAntony Antony	status = "okay";
135d7341305SAntony Antony};
136d7341305SAntony Antony
13727d7f929SAntony Antony&emac {
13827d7f929SAntony Antony	pinctrl-names = "default";
13927d7f929SAntony Antony	pinctrl-0 = <&emac_rgmii_pins>;
14027d7f929SAntony Antony	phy-supply = <&reg_gmac_3v3>;
14127d7f929SAntony Antony	phy-handle = <&ext_rgmii_phy>;
14227d7f929SAntony Antony	phy-mode = "rgmii";
14327d7f929SAntony Antony	status = "okay";
14427d7f929SAntony Antony};
14527d7f929SAntony Antony
14627d7f929SAntony Antony&external_mdio {
14727d7f929SAntony Antony	ext_rgmii_phy: ethernet-phy@7 {
14827d7f929SAntony Antony		compatible = "ethernet-phy-ieee802.3-c22";
14927d7f929SAntony Antony		reg = <7>;
15027d7f929SAntony Antony	};
15127d7f929SAntony Antony};
15227d7f929SAntony Antony
153d7341305SAntony Antony&mmc0 {
154d7341305SAntony Antony	pinctrl-names = "default";
1556d84b6c9SAndre Przywara	pinctrl-0 = <&mmc0_pins_a>;
156d7341305SAntony Antony	vmmc-supply = <&reg_vcc3v3>;
157d7341305SAntony Antony	bus-width = <4>;
158d7341305SAntony Antony	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
159d7341305SAntony Antony	status = "okay";
160d7341305SAntony Antony};
161d7341305SAntony Antony
162d7341305SAntony Antony&mmc1 {
163d7341305SAntony Antony	pinctrl-names = "default";
164d7341305SAntony Antony	pinctrl-0 = <&mmc1_pins_a>;
165d7341305SAntony Antony	vmmc-supply = <&reg_vcc3v3>;
166d7341305SAntony Antony	vqmmc-supply = <&reg_vcc3v3>;
167d7341305SAntony Antony	mmc-pwrseq = <&wifi_pwrseq>;
168d7341305SAntony Antony	bus-width = <4>;
169d7341305SAntony Antony	non-removable;
170d7341305SAntony Antony	status = "okay";
171d7341305SAntony Antony
172d7341305SAntony Antony	brcmf: wifi@1 {
173d7341305SAntony Antony		reg = <1>;
174d7341305SAntony Antony		compatible = "brcm,bcm4329-fmac";
175d7341305SAntony Antony	};
176d7341305SAntony Antony};
177d7341305SAntony Antony
178d7341305SAntony Antony&mmc2 {
179d7341305SAntony Antony	pinctrl-names = "default";
180d7341305SAntony Antony	pinctrl-0 = <&mmc2_8bit_pins>;
181d7341305SAntony Antony	vmmc-supply = <&reg_vcc3v3>;
182d7341305SAntony Antony	bus-width = <8>;
183d7341305SAntony Antony	non-removable;
184d7341305SAntony Antony	cap-mmc-hw-reset;
185d7341305SAntony Antony	status = "okay";
186d7341305SAntony Antony};
187d7341305SAntony Antony
188d7341305SAntony Antony&ohci0 {
189d7341305SAntony Antony	status = "okay";
190d7341305SAntony Antony};
191d7341305SAntony Antony
192d7341305SAntony Antony&ohci3 {
193d7341305SAntony Antony	status = "okay";
194d7341305SAntony Antony};
195d7341305SAntony Antony
196d7341305SAntony Antony&uart0 {
197d7341305SAntony Antony	pinctrl-names = "default";
198d7341305SAntony Antony	pinctrl-0 = <&uart0_pins_a>;
199d7341305SAntony Antony	status = "okay";
200d7341305SAntony Antony};
201d7341305SAntony Antony
202d7341305SAntony Antony&usb_otg {
203d7341305SAntony Antony	dr_mode = "host";
204d7341305SAntony Antony	status = "okay";
205d7341305SAntony Antony};
206d7341305SAntony Antony
207d7341305SAntony Antony&usbphy {
208d7341305SAntony Antony	/* USB Type-A ports' VBUS is always on */
209d7341305SAntony Antony	status = "okay";
210d7341305SAntony Antony};
211