1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
4 */
5
6/dts-v1/;
7#include "sun50i-h5.dtsi"
8
9#include <dt-bindings/gpio/gpio.h>
10
11/ {
12	model = "FriendlyARM NanoPi NEO 2";
13	compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
14
15	aliases {
16		ethernet0 = &emac;
17		serial0 = &uart0;
18	};
19
20	chosen {
21		stdout-path = "serial0:115200n8";
22	};
23
24	leds {
25		compatible = "gpio-leds";
26
27		pwr {
28			label = "nanopi:green:pwr";
29			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
30			default-state = "on";
31		};
32
33		status {
34			label = "nanopi:blue:status";
35			gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>;
36		};
37	};
38
39	reg_gmac_3v3: gmac-3v3 {
40		compatible = "regulator-fixed";
41		regulator-name = "gmac-3v3";
42		regulator-min-microvolt = <3300000>;
43		regulator-max-microvolt = <3300000>;
44		startup-delay-us = <100000>;
45		enable-active-high;
46		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
47	};
48
49	reg_vcc3v3: vcc3v3 {
50		compatible = "regulator-fixed";
51		regulator-name = "vcc3v3";
52		regulator-min-microvolt = <3300000>;
53		regulator-max-microvolt = <3300000>;
54	};
55
56	reg_usb0_vbus: usb0-vbus {
57		compatible = "regulator-fixed";
58		regulator-name = "usb0-vbus";
59		regulator-min-microvolt = <5000000>;
60		regulator-max-microvolt = <5000000>;
61		enable-active-high;
62		gpio = <&r_pio 0 2 GPIO_ACTIVE_HIGH>; /* PL2 */
63		status = "okay";
64	};
65};
66
67&ehci0 {
68	status = "okay";
69};
70
71&ehci3 {
72	status = "okay";
73};
74
75&emac {
76	pinctrl-names = "default";
77	pinctrl-0 = <&emac_rgmii_pins>;
78	phy-supply = <&reg_gmac_3v3>;
79	phy-handle = <&ext_rgmii_phy>;
80	phy-mode = "rgmii";
81	status = "okay";
82};
83
84&external_mdio {
85	ext_rgmii_phy: ethernet-phy@7 {
86		compatible = "ethernet-phy-ieee802.3-c22";
87		reg = <7>;
88	};
89};
90
91&mmc0 {
92	vmmc-supply = <&reg_vcc3v3>;
93	bus-width = <4>;
94	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
95	status = "okay";
96};
97
98&ohci0 {
99	status = "okay";
100};
101
102&ohci3 {
103	status = "okay";
104};
105
106&uart0 {
107	pinctrl-names = "default";
108	pinctrl-0 = <&uart0_pa_pins>;
109	status = "okay";
110};
111
112&usb_otg {
113	dr_mode = "otg";
114	status = "okay";
115};
116
117&usbphy {
118	/* USB Type-A port's VBUS is always on */
119	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
120	usb0_vbus-supply = <&reg_usb0_vbus>;
121	status = "okay";
122};
123