xref: /freebsd-src/sys/contrib/device-tree/src/arm/allwinner/sun8i-r40-oka40i-c.dts (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1f126890aSEmmanuel Vadot// SPDX-License-Identifier: GPL-2.0+ OR MIT
2f126890aSEmmanuel Vadot// Copyright (C) 2021 Ivan Uvarov <i.uvarov@cognitivepilot.com>
3f126890aSEmmanuel Vadot// Based on the sun8i-r40-bananapi-m2-ultra.dts, which is:
4f126890aSEmmanuel Vadot//	Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
5f126890aSEmmanuel Vadot//	Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
6f126890aSEmmanuel Vadot
7f126890aSEmmanuel Vadot/dts-v1/;
8f126890aSEmmanuel Vadot#include "sun8i-r40-feta40i.dtsi"
9f126890aSEmmanuel Vadot
10f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
11f126890aSEmmanuel Vadot#include <dt-bindings/leds/common.h>
12f126890aSEmmanuel Vadot
13f126890aSEmmanuel Vadot/ {
14f126890aSEmmanuel Vadot	model = "Forlinx OKA40i-C";
15f126890aSEmmanuel Vadot	compatible = "forlinx,oka40i-c", "forlinx,feta40i-c", "allwinner,sun8i-r40";
16f126890aSEmmanuel Vadot
17f126890aSEmmanuel Vadot	aliases {
18f126890aSEmmanuel Vadot		ethernet0 = &gmac;
19f126890aSEmmanuel Vadot		serial0 = &uart0;
20f126890aSEmmanuel Vadot		serial2 = &uart2;
21f126890aSEmmanuel Vadot		serial3 = &uart3;
22f126890aSEmmanuel Vadot		serial4 = &uart4;
23f126890aSEmmanuel Vadot		serial5 = &uart5; /* RS485 */
24f126890aSEmmanuel Vadot		serial7 = &uart7;
25f126890aSEmmanuel Vadot	};
26f126890aSEmmanuel Vadot
27f126890aSEmmanuel Vadot	chosen {
28f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
29f126890aSEmmanuel Vadot	};
30f126890aSEmmanuel Vadot
31f126890aSEmmanuel Vadot	connector {
32f126890aSEmmanuel Vadot		compatible = "hdmi-connector";
33f126890aSEmmanuel Vadot		type = "a";
34f126890aSEmmanuel Vadot
35f126890aSEmmanuel Vadot		port {
36f126890aSEmmanuel Vadot			hdmi_con_in: endpoint {
37f126890aSEmmanuel Vadot				remote-endpoint = <&hdmi_out_con>;
38f126890aSEmmanuel Vadot			};
39f126890aSEmmanuel Vadot		};
40f126890aSEmmanuel Vadot	};
41f126890aSEmmanuel Vadot
42f126890aSEmmanuel Vadot	leds {
43f126890aSEmmanuel Vadot		compatible = "gpio-leds";
44f126890aSEmmanuel Vadot
45f126890aSEmmanuel Vadot		led-5 { /* this is how the leds are labeled on the board */
46f126890aSEmmanuel Vadot			gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */
47f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
48f126890aSEmmanuel Vadot			function = LED_FUNCTION_STATUS;
49f126890aSEmmanuel Vadot		};
50f126890aSEmmanuel Vadot
51f126890aSEmmanuel Vadot		led-6 {
52f126890aSEmmanuel Vadot			gpios = <&pio 8 15 GPIO_ACTIVE_LOW>; /* PI15 */
53f126890aSEmmanuel Vadot			color = <LED_COLOR_ID_BLUE>;
54f126890aSEmmanuel Vadot			function = LED_FUNCTION_STATUS;
55f126890aSEmmanuel Vadot		};
56f126890aSEmmanuel Vadot	};
57f126890aSEmmanuel Vadot
58f126890aSEmmanuel Vadot	reg_vcc5v0: vcc5v0 {
59f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
60f126890aSEmmanuel Vadot		regulator-name = "vcc5v0";
61f126890aSEmmanuel Vadot		regulator-min-microvolt = <5000000>;
62f126890aSEmmanuel Vadot		regulator-max-microvolt = <5000000>;
63f126890aSEmmanuel Vadot	};
64f126890aSEmmanuel Vadot
65*7d0873ebSEmmanuel Vadot	wifi_pwrseq: pwrseq {
66f126890aSEmmanuel Vadot		compatible = "mmc-pwrseq-simple";
67f126890aSEmmanuel Vadot		reset-gpios = <&pio 1 10 GPIO_ACTIVE_LOW>; // PB10 WIFI_EN
68f126890aSEmmanuel Vadot		clocks = <&ccu CLK_OUTA>;
69f126890aSEmmanuel Vadot		clock-names = "ext_clock";
70f126890aSEmmanuel Vadot	};
71f126890aSEmmanuel Vadot};
72f126890aSEmmanuel Vadot
73f126890aSEmmanuel Vadot&ahci {
74f126890aSEmmanuel Vadot	ahci-supply = <&reg_dldo4>;
75f126890aSEmmanuel Vadot	phy-supply = <&reg_eldo2>;
76f126890aSEmmanuel Vadot	status = "okay";
77f126890aSEmmanuel Vadot};
78f126890aSEmmanuel Vadot
79f126890aSEmmanuel Vadot&de {
80f126890aSEmmanuel Vadot	status = "okay";
81f126890aSEmmanuel Vadot};
82f126890aSEmmanuel Vadot
83f126890aSEmmanuel Vadot&ehci1 {
84f126890aSEmmanuel Vadot	status = "okay";
85f126890aSEmmanuel Vadot};
86f126890aSEmmanuel Vadot
87f126890aSEmmanuel Vadot&ehci2 {
88f126890aSEmmanuel Vadot	status = "okay";
89f126890aSEmmanuel Vadot};
90f126890aSEmmanuel Vadot
91f126890aSEmmanuel Vadot&gmac {
92f126890aSEmmanuel Vadot	pinctrl-names = "default";
93f126890aSEmmanuel Vadot	pinctrl-0 = <&gmac_rgmii_pins>;
94f126890aSEmmanuel Vadot	phy-handle = <&phy1>;
95f126890aSEmmanuel Vadot	phy-mode = "rgmii-id";
96f126890aSEmmanuel Vadot	phy-supply = <&reg_dcdc1>;
97f126890aSEmmanuel Vadot	status = "okay";
98f126890aSEmmanuel Vadot};
99f126890aSEmmanuel Vadot
100f126890aSEmmanuel Vadot&gmac_mdio {
101f126890aSEmmanuel Vadot	phy1: ethernet-phy@1 {
102f126890aSEmmanuel Vadot		compatible = "ethernet-phy-ieee802.3-c22";
103f126890aSEmmanuel Vadot		reg = <1>;
104f126890aSEmmanuel Vadot	};
105f126890aSEmmanuel Vadot};
106f126890aSEmmanuel Vadot
107f126890aSEmmanuel Vadot&hdmi {
108f126890aSEmmanuel Vadot	status = "okay";
109f126890aSEmmanuel Vadot};
110f126890aSEmmanuel Vadot
111f126890aSEmmanuel Vadot&hdmi_out {
112f126890aSEmmanuel Vadot	hdmi_out_con: endpoint {
113f126890aSEmmanuel Vadot		remote-endpoint = <&hdmi_con_in>;
114f126890aSEmmanuel Vadot	};
115f126890aSEmmanuel Vadot};
116f126890aSEmmanuel Vadot
117f126890aSEmmanuel Vadot&i2c2 {
118f126890aSEmmanuel Vadot	status = "okay";
119f126890aSEmmanuel Vadot};
120f126890aSEmmanuel Vadot
121f126890aSEmmanuel Vadot&mmc0 {
122f126890aSEmmanuel Vadot	vmmc-supply = <&reg_dcdc1>;
123f126890aSEmmanuel Vadot	vqmmc-supply = <&reg_dcdc1>;
124f126890aSEmmanuel Vadot	bus-width = <4>;
125f126890aSEmmanuel Vadot	cd-gpios = <&pio 8 11 GPIO_ACTIVE_LOW>; // PI11
126f126890aSEmmanuel Vadot	status = "okay";
127f126890aSEmmanuel Vadot};
128f126890aSEmmanuel Vadot
129f126890aSEmmanuel Vadot&mmc3 {
130f126890aSEmmanuel Vadot	vmmc-supply = <&reg_dcdc1>;
131f126890aSEmmanuel Vadot	vqmmc-supply = <&reg_dcdc1>;
132f126890aSEmmanuel Vadot	bus-width = <4>;
133f126890aSEmmanuel Vadot	cd-gpios = <&pio 8 10 GPIO_ACTIVE_LOW>; // PI10
134f126890aSEmmanuel Vadot	status = "okay";
135f126890aSEmmanuel Vadot};
136f126890aSEmmanuel Vadot
137f126890aSEmmanuel Vadot&ohci1 {
138f126890aSEmmanuel Vadot	status = "okay";
139f126890aSEmmanuel Vadot};
140f126890aSEmmanuel Vadot
141f126890aSEmmanuel Vadot&ohci2 {
142f126890aSEmmanuel Vadot	status = "okay";
143f126890aSEmmanuel Vadot};
144f126890aSEmmanuel Vadot
145f126890aSEmmanuel Vadot&reg_dc1sw {
146f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
147f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
148f126890aSEmmanuel Vadot	regulator-name = "vcc-lcd";
149f126890aSEmmanuel Vadot};
150f126890aSEmmanuel Vadot
151f126890aSEmmanuel Vadot&reg_dldo2 {
152f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
153f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
154f126890aSEmmanuel Vadot	regulator-name = "vcc-wifi";
155f126890aSEmmanuel Vadot};
156f126890aSEmmanuel Vadot
157f126890aSEmmanuel Vadot&tcon_tv0 {
158f126890aSEmmanuel Vadot	status = "okay";
159f126890aSEmmanuel Vadot};
160f126890aSEmmanuel Vadot
161f126890aSEmmanuel Vadot&uart0 {
162f126890aSEmmanuel Vadot	pinctrl-names = "default";
163f126890aSEmmanuel Vadot	pinctrl-0 = <&uart0_pb_pins>;
164f126890aSEmmanuel Vadot	status = "okay";
165f126890aSEmmanuel Vadot};
166f126890aSEmmanuel Vadot
167f126890aSEmmanuel Vadot&uart2 {
168f126890aSEmmanuel Vadot	pinctrl-names = "default";
169f126890aSEmmanuel Vadot	pinctrl-0 = <&uart2_pi_pins>, <&uart2_rts_cts_pi_pins>;
170f126890aSEmmanuel Vadot	uart-has-rtscts;
171f126890aSEmmanuel Vadot	status = "okay";
172f126890aSEmmanuel Vadot};
173f126890aSEmmanuel Vadot
174f126890aSEmmanuel Vadot&uart3 {
175f126890aSEmmanuel Vadot	pinctrl-names = "default";
176f126890aSEmmanuel Vadot	pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
177f126890aSEmmanuel Vadot	uart-has-rtscts;
178f126890aSEmmanuel Vadot	status = "okay";
179f126890aSEmmanuel Vadot};
180f126890aSEmmanuel Vadot
181f126890aSEmmanuel Vadot&uart4 {
182f126890aSEmmanuel Vadot	pinctrl-names = "default";
183f126890aSEmmanuel Vadot	pinctrl-0 = <&uart4_pg_pins>;
184f126890aSEmmanuel Vadot	status = "okay";
185f126890aSEmmanuel Vadot};
186f126890aSEmmanuel Vadot
187f126890aSEmmanuel Vadot&uart5 { /* RS485 */
188f126890aSEmmanuel Vadot	pinctrl-names = "default";
189f126890aSEmmanuel Vadot	pinctrl-0 = <&uart5_ph_pins>;
190f126890aSEmmanuel Vadot	status = "okay";
191f126890aSEmmanuel Vadot};
192f126890aSEmmanuel Vadot
193f126890aSEmmanuel Vadot&uart7 {
194f126890aSEmmanuel Vadot	pinctrl-names = "default";
195f126890aSEmmanuel Vadot	pinctrl-0 = <&uart7_pi_pins>;
196f126890aSEmmanuel Vadot	status = "okay";
197f126890aSEmmanuel Vadot};
198f126890aSEmmanuel Vadot
199f126890aSEmmanuel Vadot&usbphy {
200f126890aSEmmanuel Vadot	usb1_vbus-supply = <&reg_vcc5v0>;
201f126890aSEmmanuel Vadot	usb2_vbus-supply = <&reg_vcc5v0>;
202f126890aSEmmanuel Vadot	status = "okay";
203f126890aSEmmanuel Vadot};
204