1/*
2 * Copyright (C) 2016 ARM Ltd.
3 * Copyright (C) 2018 Hauke Mehrtens <hauke@hauke-m.de>
4 *
5 * SPDX-License-Identifier: (GPL-2.0+ OR X11)
6 */
7
8/dts-v1/;
9#include "sun50i-h5.dtsi"
10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/pinctrl/sun4i-a10.h>
14
15/ {
16	model = "Xunlong Orange Pi Zero Plus";
17	compatible = "xunlong,orangepi-zero-plus", "allwinner,sun50i-h5";
18
19	reg_vcc3v3: vcc3v3 {
20		compatible = "regulator-fixed";
21		regulator-name = "vcc3v3";
22		regulator-min-microvolt = <3300000>;
23		regulator-max-microvolt = <3300000>;
24	};
25
26	aliases {
27		ethernet0 = &emac;
28		ethernet1 = &rtl8189ftv;
29		serial0 = &uart0;
30	};
31
32	chosen {
33		stdout-path = "serial0:115200n8";
34	};
35
36	leds {
37		compatible = "gpio-leds";
38
39		pwr {
40			label = "orangepi:green:pwr";
41			gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PA10 */
42			default-state = "on";
43		};
44
45		status {
46			label = "orangepi:red:status";
47			gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; /* PA17 */
48		};
49	};
50
51	reg_gmac_3v3: gmac-3v3 {
52		compatible = "regulator-fixed";
53		regulator-name = "gmac-3v3";
54		regulator-min-microvolt = <3300000>;
55		regulator-max-microvolt = <3300000>;
56		startup-delay-us = <100000>;
57		enable-active-high;
58		gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
59	};
60};
61
62&ehci0 {
63	status = "okay";
64};
65
66&ehci1 {
67	status = "okay";
68};
69
70&emac {
71	pinctrl-names = "default";
72	pinctrl-0 = <&emac_rgmii_pins>;
73	phy-supply = <&reg_gmac_3v3>;
74	phy-handle = <&ext_rgmii_phy>;
75	phy-mode = "rgmii";
76	status = "okay";
77};
78
79&external_mdio {
80	ext_rgmii_phy: ethernet-phy@1 {
81		compatible = "ethernet-phy-ieee802.3-c22";
82		reg = <1>;
83	};
84};
85
86&mmc0 {
87	vmmc-supply = <&reg_vcc3v3>;
88	bus-width = <4>;
89	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
90	status = "okay";
91};
92
93&mmc1 {
94	vmmc-supply = <&reg_vcc3v3>;
95	bus-width = <4>;
96	non-removable;
97	status = "okay";
98
99	/*
100	 * Explicitly define the sdio device, so that we can add an ethernet
101	 * alias for it (which e.g. makes u-boot set a mac-address).
102	 */
103	rtl8189ftv: sdio_wifi@1 {
104		reg = <1>;
105	};
106};
107
108&spi0  {
109	status = "okay";
110
111	flash@0 {
112		#address-cells = <1>;
113		#size-cells = <1>;
114		compatible = "mxicy,mx25l1606e", "winbond,w25q128";
115		reg = <0>;
116		spi-max-frequency = <40000000>;
117	};
118};
119
120&ohci0 {
121	status = "okay";
122};
123
124&ohci1 {
125	status = "okay";
126};
127
128&uart0 {
129	pinctrl-names = "default";
130	pinctrl-0 = <&uart0_pins_a>;
131	status = "okay";
132};
133
134&usb_otg {
135	dr_mode = "peripheral";
136	status = "okay";
137};
138
139&usbphy {
140	/* USB Type-A ports' VBUS is always on */
141	usb0_id_det-gpios = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
142	status = "okay";
143};
144