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