1d6d1291dSIcenowy Zheng/*
2d6d1291dSIcenowy Zheng * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
3d6d1291dSIcenowy Zheng *
4d6d1291dSIcenowy Zheng * This file is dual-licensed: you can use it either under the terms
5d6d1291dSIcenowy Zheng * of the GPL or the X11 license, at your option. Note that this dual
6d6d1291dSIcenowy Zheng * licensing only applies to this file, and not this project as a
7d6d1291dSIcenowy Zheng * whole.
8d6d1291dSIcenowy Zheng *
9d6d1291dSIcenowy Zheng *  a) This file is free software; you can redistribute it and/or
10d6d1291dSIcenowy Zheng *     modify it under the terms of the GNU General Public License as
11d6d1291dSIcenowy Zheng *     published by the Free Software Foundation; either version 2 of the
12d6d1291dSIcenowy Zheng *     License, or (at your option) any later version.
13d6d1291dSIcenowy Zheng *
14d6d1291dSIcenowy Zheng *     This file is distributed in the hope that it will be useful,
15d6d1291dSIcenowy Zheng *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16d6d1291dSIcenowy Zheng *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17d6d1291dSIcenowy Zheng *     GNU General Public License for more details.
18d6d1291dSIcenowy Zheng *
19d6d1291dSIcenowy Zheng * Or, alternatively,
20d6d1291dSIcenowy Zheng *
21d6d1291dSIcenowy Zheng *  b) Permission is hereby granted, free of charge, to any person
22d6d1291dSIcenowy Zheng *     obtaining a copy of this software and associated documentation
23d6d1291dSIcenowy Zheng *     files (the "Software"), to deal in the Software without
24d6d1291dSIcenowy Zheng *     restriction, including without limitation the rights to use,
25d6d1291dSIcenowy Zheng *     copy, modify, merge, publish, distribute, sublicense, and/or
26d6d1291dSIcenowy Zheng *     sell copies of the Software, and to permit persons to whom the
27d6d1291dSIcenowy Zheng *     Software is furnished to do so, subject to the following
28d6d1291dSIcenowy Zheng *     conditions:
29d6d1291dSIcenowy Zheng *
30d6d1291dSIcenowy Zheng *     The above copyright notice and this permission notice shall be
31d6d1291dSIcenowy Zheng *     included in all copies or substantial portions of the Software.
32d6d1291dSIcenowy Zheng *
33d6d1291dSIcenowy Zheng *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34d6d1291dSIcenowy Zheng *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35d6d1291dSIcenowy Zheng *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36d6d1291dSIcenowy Zheng *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37d6d1291dSIcenowy Zheng *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38d6d1291dSIcenowy Zheng *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39d6d1291dSIcenowy Zheng *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40d6d1291dSIcenowy Zheng *     OTHER DEALINGS IN THE SOFTWARE.
41d6d1291dSIcenowy Zheng */
42d6d1291dSIcenowy Zheng
43d6d1291dSIcenowy Zheng/dts-v1/;
44d6d1291dSIcenowy Zheng#include "sun50i-h5.dtsi"
45d6d1291dSIcenowy Zheng
46d6d1291dSIcenowy Zheng#include <dt-bindings/gpio/gpio.h>
47d6d1291dSIcenowy Zheng
48d6d1291dSIcenowy Zheng/ {
49d6d1291dSIcenowy Zheng	model = "FriendlyARM NanoPi NEO 2";
50d6d1291dSIcenowy Zheng	compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
51d6d1291dSIcenowy Zheng
52d6d1291dSIcenowy Zheng	reg_vcc3v3: vcc3v3 {
53d6d1291dSIcenowy Zheng		compatible = "regulator-fixed";
54d6d1291dSIcenowy Zheng		regulator-name = "vcc3v3";
55d6d1291dSIcenowy Zheng		regulator-min-microvolt = <3300000>;
56d6d1291dSIcenowy Zheng		regulator-max-microvolt = <3300000>;
57d6d1291dSIcenowy Zheng	};
58d6d1291dSIcenowy Zheng
59d6d1291dSIcenowy Zheng	aliases {
60d6d1291dSIcenowy Zheng		serial0 = &uart0;
61d6d1291dSIcenowy Zheng	};
62d6d1291dSIcenowy Zheng
63d6d1291dSIcenowy Zheng	chosen {
64d6d1291dSIcenowy Zheng		stdout-path = "serial0:115200n8";
65d6d1291dSIcenowy Zheng	};
66d6d1291dSIcenowy Zheng
67d6d1291dSIcenowy Zheng	leds {
68d6d1291dSIcenowy Zheng		compatible = "gpio-leds";
69d6d1291dSIcenowy Zheng
70d6d1291dSIcenowy Zheng		pwr {
71d6d1291dSIcenowy Zheng			label = "nanopi:green:pwr";
72d6d1291dSIcenowy Zheng			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
73d6d1291dSIcenowy Zheng			default-state = "on";
74d6d1291dSIcenowy Zheng		};
75d6d1291dSIcenowy Zheng
76d6d1291dSIcenowy Zheng		status {
77d6d1291dSIcenowy Zheng			label = "nanopi:blue:status";
78d6d1291dSIcenowy Zheng			gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
79d6d1291dSIcenowy Zheng		};
80d6d1291dSIcenowy Zheng	};
81d6d1291dSIcenowy Zheng
82d6d1291dSIcenowy Zheng	reg_usb0_vbus: usb0-vbus {
83d6d1291dSIcenowy Zheng		compatible = "regulator-fixed";
84d6d1291dSIcenowy Zheng		regulator-name = "usb0-vbus";
85d6d1291dSIcenowy Zheng		regulator-min-microvolt = <5000000>;
86d6d1291dSIcenowy Zheng		regulator-max-microvolt = <5000000>;
87d6d1291dSIcenowy Zheng		enable-active-high;
88d6d1291dSIcenowy Zheng		gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
89d6d1291dSIcenowy Zheng		status = "okay";
90d6d1291dSIcenowy Zheng	};
91d6d1291dSIcenowy Zheng};
92d6d1291dSIcenowy Zheng
93d6d1291dSIcenowy Zheng&ehci0 {
94d6d1291dSIcenowy Zheng	status = "okay";
95d6d1291dSIcenowy Zheng};
96d6d1291dSIcenowy Zheng
97d6d1291dSIcenowy Zheng&ehci3 {
98d6d1291dSIcenowy Zheng	status = "okay";
99d6d1291dSIcenowy Zheng};
100d6d1291dSIcenowy Zheng
101d6d1291dSIcenowy Zheng&mmc0 {
102d6d1291dSIcenowy Zheng	pinctrl-names = "default";
103d6d1291dSIcenowy Zheng	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
104d6d1291dSIcenowy Zheng	vmmc-supply = <&reg_vcc3v3>;
105d6d1291dSIcenowy Zheng	bus-width = <4>;
106d6d1291dSIcenowy Zheng	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
107d6d1291dSIcenowy Zheng	status = "okay";
108d6d1291dSIcenowy Zheng};
109d6d1291dSIcenowy Zheng
110d6d1291dSIcenowy Zheng&ohci0 {
111d6d1291dSIcenowy Zheng	status = "okay";
112d6d1291dSIcenowy Zheng};
113d6d1291dSIcenowy Zheng
114d6d1291dSIcenowy Zheng&ohci3 {
115d6d1291dSIcenowy Zheng	status = "okay";
116d6d1291dSIcenowy Zheng};
117d6d1291dSIcenowy Zheng
118d6d1291dSIcenowy Zheng&uart0 {
119d6d1291dSIcenowy Zheng	pinctrl-names = "default";
120d6d1291dSIcenowy Zheng	pinctrl-0 = <&uart0_pins_a>;
121d6d1291dSIcenowy Zheng	status = "okay";
122d6d1291dSIcenowy Zheng};
123d6d1291dSIcenowy Zheng
124d6d1291dSIcenowy Zheng&usb_otg {
125d6d1291dSIcenowy Zheng	dr_mode = "otg";
126d6d1291dSIcenowy Zheng	status = "okay";
127d6d1291dSIcenowy Zheng};
128d6d1291dSIcenowy Zheng
129d6d1291dSIcenowy Zheng&usbphy {
130d6d1291dSIcenowy Zheng	/* USB Type-A port's VBUS is always on */
131d6d1291dSIcenowy Zheng	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
132d6d1291dSIcenowy Zheng	usb0_vbus-supply = <&reg_usb0_vbus>;
133d6d1291dSIcenowy Zheng	status = "okay";
134d6d1291dSIcenowy Zheng};
135