xref: /freebsd/sys/contrib/device-tree/src/arm64/amlogic/meson-sm1-bananapi-m5.dts (revision 5956d97f4b3204318ceb6aa9c77bd0bc6ea87a41)
1*5956d97fSEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*5956d97fSEmmanuel Vadot/*
3*5956d97fSEmmanuel Vadot * Copyright (c) 2021 BayLibre SAS
4*5956d97fSEmmanuel Vadot * Author: Neil Armstrong <narmstrong@baylibre.com>
5*5956d97fSEmmanuel Vadot */
6*5956d97fSEmmanuel Vadot
7*5956d97fSEmmanuel Vadot/dts-v1/;
8*5956d97fSEmmanuel Vadot
9*5956d97fSEmmanuel Vadot#include "meson-sm1.dtsi"
10*5956d97fSEmmanuel Vadot#include <dt-bindings/leds/common.h>
11*5956d97fSEmmanuel Vadot#include <dt-bindings/input/linux-event-codes.h>
12*5956d97fSEmmanuel Vadot#include <dt-bindings/gpio/meson-g12a-gpio.h>
13*5956d97fSEmmanuel Vadot#include <dt-bindings/sound/meson-g12a-toacodec.h>
14*5956d97fSEmmanuel Vadot#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
15*5956d97fSEmmanuel Vadot
16*5956d97fSEmmanuel Vadot/ {
17*5956d97fSEmmanuel Vadot	compatible = "bananapi,bpi-m5", "amlogic,sm1";
18*5956d97fSEmmanuel Vadot	model = "Banana Pi BPI-M5";
19*5956d97fSEmmanuel Vadot
20*5956d97fSEmmanuel Vadot	adc_keys {
21*5956d97fSEmmanuel Vadot		compatible = "adc-keys";
22*5956d97fSEmmanuel Vadot		io-channels = <&saradc 2>;
23*5956d97fSEmmanuel Vadot		io-channel-names = "buttons";
24*5956d97fSEmmanuel Vadot		keyup-threshold-microvolt = <1800000>;
25*5956d97fSEmmanuel Vadot
26*5956d97fSEmmanuel Vadot		key {
27*5956d97fSEmmanuel Vadot			label = "SW3";
28*5956d97fSEmmanuel Vadot			linux,code = <BTN_3>;
29*5956d97fSEmmanuel Vadot			press-threshold-microvolt = <1700000>;
30*5956d97fSEmmanuel Vadot		};
31*5956d97fSEmmanuel Vadot	};
32*5956d97fSEmmanuel Vadot
33*5956d97fSEmmanuel Vadot	aliases {
34*5956d97fSEmmanuel Vadot		serial0 = &uart_AO;
35*5956d97fSEmmanuel Vadot		ethernet0 = &ethmac;
36*5956d97fSEmmanuel Vadot	};
37*5956d97fSEmmanuel Vadot
38*5956d97fSEmmanuel Vadot	chosen {
39*5956d97fSEmmanuel Vadot		stdout-path = "serial0:115200n8";
40*5956d97fSEmmanuel Vadot	};
41*5956d97fSEmmanuel Vadot
42*5956d97fSEmmanuel Vadot	/* TOFIX: handle CVBS_DET on SARADC channel 0 */
43*5956d97fSEmmanuel Vadot	cvbs-connector {
44*5956d97fSEmmanuel Vadot		compatible = "composite-video-connector";
45*5956d97fSEmmanuel Vadot
46*5956d97fSEmmanuel Vadot		port {
47*5956d97fSEmmanuel Vadot			cvbs_connector_in: endpoint {
48*5956d97fSEmmanuel Vadot				remote-endpoint = <&cvbs_vdac_out>;
49*5956d97fSEmmanuel Vadot			};
50*5956d97fSEmmanuel Vadot		};
51*5956d97fSEmmanuel Vadot	};
52*5956d97fSEmmanuel Vadot
53*5956d97fSEmmanuel Vadot	emmc_pwrseq: emmc-pwrseq {
54*5956d97fSEmmanuel Vadot		compatible = "mmc-pwrseq-emmc";
55*5956d97fSEmmanuel Vadot		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
56*5956d97fSEmmanuel Vadot	};
57*5956d97fSEmmanuel Vadot
58*5956d97fSEmmanuel Vadot	gpio-keys {
59*5956d97fSEmmanuel Vadot		compatible = "gpio-keys";
60*5956d97fSEmmanuel Vadot
61*5956d97fSEmmanuel Vadot		key {
62*5956d97fSEmmanuel Vadot			label = "SW1";
63*5956d97fSEmmanuel Vadot			linux,code = <BTN_1>;
64*5956d97fSEmmanuel Vadot			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
65*5956d97fSEmmanuel Vadot			interrupt-parent = <&gpio_intc>;
66*5956d97fSEmmanuel Vadot			interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
67*5956d97fSEmmanuel Vadot		};
68*5956d97fSEmmanuel Vadot	};
69*5956d97fSEmmanuel Vadot
70*5956d97fSEmmanuel Vadot	hdmi-connector {
71*5956d97fSEmmanuel Vadot		compatible = "hdmi-connector";
72*5956d97fSEmmanuel Vadot		type = "a";
73*5956d97fSEmmanuel Vadot
74*5956d97fSEmmanuel Vadot		port {
75*5956d97fSEmmanuel Vadot			hdmi_connector_in: endpoint {
76*5956d97fSEmmanuel Vadot				remote-endpoint = <&hdmi_tx_tmds_out>;
77*5956d97fSEmmanuel Vadot			};
78*5956d97fSEmmanuel Vadot		};
79*5956d97fSEmmanuel Vadot	};
80*5956d97fSEmmanuel Vadot
81*5956d97fSEmmanuel Vadot	leds {
82*5956d97fSEmmanuel Vadot		compatible = "gpio-leds";
83*5956d97fSEmmanuel Vadot
84*5956d97fSEmmanuel Vadot		green {
85*5956d97fSEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
86*5956d97fSEmmanuel Vadot			function = LED_FUNCTION_STATUS;
87*5956d97fSEmmanuel Vadot			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
88*5956d97fSEmmanuel Vadot		};
89*5956d97fSEmmanuel Vadot
90*5956d97fSEmmanuel Vadot		blue {
91*5956d97fSEmmanuel Vadot			color = <LED_COLOR_ID_BLUE>;
92*5956d97fSEmmanuel Vadot			function = LED_FUNCTION_STATUS;
93*5956d97fSEmmanuel Vadot			gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_LOW>;
94*5956d97fSEmmanuel Vadot			linux,default-trigger = "heartbeat";
95*5956d97fSEmmanuel Vadot		};
96*5956d97fSEmmanuel Vadot	};
97*5956d97fSEmmanuel Vadot
98*5956d97fSEmmanuel Vadot	memory@0 {
99*5956d97fSEmmanuel Vadot		device_type = "memory";
100*5956d97fSEmmanuel Vadot		reg = <0x0 0x0 0x0 0x40000000>;
101*5956d97fSEmmanuel Vadot	};
102*5956d97fSEmmanuel Vadot
103*5956d97fSEmmanuel Vadot	emmc_1v8: regulator-emmc_1v8 {
104*5956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
105*5956d97fSEmmanuel Vadot		regulator-name = "EMMC_1V8";
106*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <1800000>;
107*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <1800000>;
108*5956d97fSEmmanuel Vadot		vin-supply = <&vddao_3v3>;
109*5956d97fSEmmanuel Vadot		regulator-always-on;
110*5956d97fSEmmanuel Vadot	};
111*5956d97fSEmmanuel Vadot
112*5956d97fSEmmanuel Vadot	dc_in: regulator-dc_in {
113*5956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
114*5956d97fSEmmanuel Vadot		regulator-name = "DC_IN";
115*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <5000000>;
116*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <5000000>;
117*5956d97fSEmmanuel Vadot		regulator-always-on;
118*5956d97fSEmmanuel Vadot	};
119*5956d97fSEmmanuel Vadot
120*5956d97fSEmmanuel Vadot	vddio_c: regulator-vddio_c {
121*5956d97fSEmmanuel Vadot		compatible = "regulator-gpio";
122*5956d97fSEmmanuel Vadot		regulator-name = "VDDIO_C";
123*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <1800000>;
124*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
125*5956d97fSEmmanuel Vadot
126*5956d97fSEmmanuel Vadot		enable-gpio = <&gpio GPIOE_2 GPIO_ACTIVE_HIGH>;
127*5956d97fSEmmanuel Vadot		enable-active-high;
128*5956d97fSEmmanuel Vadot		regulator-always-on;
129*5956d97fSEmmanuel Vadot
130*5956d97fSEmmanuel Vadot		gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_DRAIN>;
131*5956d97fSEmmanuel Vadot		gpios-states = <1>;
132*5956d97fSEmmanuel Vadot
133*5956d97fSEmmanuel Vadot		states = <1800000 0>,
134*5956d97fSEmmanuel Vadot			 <3300000 1>;
135*5956d97fSEmmanuel Vadot	};
136*5956d97fSEmmanuel Vadot
137*5956d97fSEmmanuel Vadot	tflash_vdd: regulator-tflash_vdd {
138*5956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
139*5956d97fSEmmanuel Vadot		regulator-name = "TFLASH_VDD";
140*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
141*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
142*5956d97fSEmmanuel Vadot		vin-supply = <&dc_in>;
143*5956d97fSEmmanuel Vadot		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
144*5956d97fSEmmanuel Vadot		enable-active-high;
145*5956d97fSEmmanuel Vadot		regulator-always-on;
146*5956d97fSEmmanuel Vadot	};
147*5956d97fSEmmanuel Vadot
148*5956d97fSEmmanuel Vadot	vddao_1v8: regulator-vddao_1v8 {
149*5956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
150*5956d97fSEmmanuel Vadot		regulator-name = "VDDAO_1V8";
151*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <1800000>;
152*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <1800000>;
153*5956d97fSEmmanuel Vadot		vin-supply = <&vddao_3v3>;
154*5956d97fSEmmanuel Vadot		regulator-always-on;
155*5956d97fSEmmanuel Vadot	};
156*5956d97fSEmmanuel Vadot
157*5956d97fSEmmanuel Vadot	vddao_3v3: regulator-vddao_3v3 {
158*5956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
159*5956d97fSEmmanuel Vadot		regulator-name = "VDDAO_3V3";
160*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <3300000>;
161*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <3300000>;
162*5956d97fSEmmanuel Vadot		vin-supply = <&dc_in>;
163*5956d97fSEmmanuel Vadot		regulator-always-on;
164*5956d97fSEmmanuel Vadot	};
165*5956d97fSEmmanuel Vadot
166*5956d97fSEmmanuel Vadot	vddcpu: regulator-vddcpu {
167*5956d97fSEmmanuel Vadot		/*
168*5956d97fSEmmanuel Vadot		 * SY8120B1ABC DC/DC Regulator.
169*5956d97fSEmmanuel Vadot		 */
170*5956d97fSEmmanuel Vadot		compatible = "pwm-regulator";
171*5956d97fSEmmanuel Vadot
172*5956d97fSEmmanuel Vadot		regulator-name = "VDDCPU";
173*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <690000>;
174*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <1050000>;
175*5956d97fSEmmanuel Vadot
176*5956d97fSEmmanuel Vadot		vin-supply = <&dc_in>;
177*5956d97fSEmmanuel Vadot
178*5956d97fSEmmanuel Vadot		pwms = <&pwm_AO_cd 1 1250 0>;
179*5956d97fSEmmanuel Vadot		pwm-dutycycle-range = <100 0>;
180*5956d97fSEmmanuel Vadot
181*5956d97fSEmmanuel Vadot		regulator-boot-on;
182*5956d97fSEmmanuel Vadot		regulator-always-on;
183*5956d97fSEmmanuel Vadot	};
184*5956d97fSEmmanuel Vadot
185*5956d97fSEmmanuel Vadot	/* USB Hub Power Enable */
186*5956d97fSEmmanuel Vadot	vl_pwr_en: regulator-vl_pwr_en {
187*5956d97fSEmmanuel Vadot		compatible = "regulator-fixed";
188*5956d97fSEmmanuel Vadot		regulator-name = "VL_PWR_EN";
189*5956d97fSEmmanuel Vadot		regulator-min-microvolt = <5000000>;
190*5956d97fSEmmanuel Vadot		regulator-max-microvolt = <5000000>;
191*5956d97fSEmmanuel Vadot		vin-supply = <&dc_in>;
192*5956d97fSEmmanuel Vadot
193*5956d97fSEmmanuel Vadot		gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
194*5956d97fSEmmanuel Vadot		enable-active-high;
195*5956d97fSEmmanuel Vadot	};
196*5956d97fSEmmanuel Vadot
197*5956d97fSEmmanuel Vadot	sound {
198*5956d97fSEmmanuel Vadot		compatible = "amlogic,axg-sound-card";
199*5956d97fSEmmanuel Vadot		model = "BPI-M5";
200*5956d97fSEmmanuel Vadot		audio-widgets = "Line", "Lineout";
201*5956d97fSEmmanuel Vadot		audio-aux-devs = <&tdmout_b>, <&tdmout_c>,
202*5956d97fSEmmanuel Vadot				 <&tdmin_a>, <&tdmin_b>, <&tdmin_c>;
203*5956d97fSEmmanuel Vadot		audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1",
204*5956d97fSEmmanuel Vadot				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
205*5956d97fSEmmanuel Vadot				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
206*5956d97fSEmmanuel Vadot				"TDM_B Playback", "TDMOUT_B OUT",
207*5956d97fSEmmanuel Vadot				"TDMOUT_C IN 0", "FRDDR_A OUT 2",
208*5956d97fSEmmanuel Vadot				"TDMOUT_C IN 1", "FRDDR_B OUT 2",
209*5956d97fSEmmanuel Vadot				"TDMOUT_C IN 2", "FRDDR_C OUT 2",
210*5956d97fSEmmanuel Vadot				"TDM_C Playback", "TDMOUT_C OUT",
211*5956d97fSEmmanuel Vadot				"TDMIN_A IN 4", "TDM_B Loopback",
212*5956d97fSEmmanuel Vadot				"TDMIN_B IN 4", "TDM_B Loopback",
213*5956d97fSEmmanuel Vadot				"TDMIN_C IN 4", "TDM_B Loopback",
214*5956d97fSEmmanuel Vadot				"TDMIN_A IN 5", "TDM_C Loopback",
215*5956d97fSEmmanuel Vadot				"TDMIN_B IN 5", "TDM_C Loopback",
216*5956d97fSEmmanuel Vadot				"TDMIN_C IN 5", "TDM_C Loopback",
217*5956d97fSEmmanuel Vadot				"TODDR_A IN 0", "TDMIN_A OUT",
218*5956d97fSEmmanuel Vadot				"TODDR_B IN 0", "TDMIN_A OUT",
219*5956d97fSEmmanuel Vadot				"TODDR_C IN 0", "TDMIN_A OUT",
220*5956d97fSEmmanuel Vadot				"TODDR_A IN 1", "TDMIN_B OUT",
221*5956d97fSEmmanuel Vadot				"TODDR_B IN 1", "TDMIN_B OUT",
222*5956d97fSEmmanuel Vadot				"TODDR_C IN 1", "TDMIN_B OUT",
223*5956d97fSEmmanuel Vadot				"TODDR_A IN 2", "TDMIN_C OUT",
224*5956d97fSEmmanuel Vadot				"TODDR_B IN 2", "TDMIN_C OUT",
225*5956d97fSEmmanuel Vadot				"TODDR_C IN 2", "TDMIN_C OUT",
226*5956d97fSEmmanuel Vadot				"Lineout", "ACODEC LOLP",
227*5956d97fSEmmanuel Vadot				"Lineout", "ACODEC LORP";
228*5956d97fSEmmanuel Vadot
229*5956d97fSEmmanuel Vadot		assigned-clocks = <&clkc CLKID_MPLL2>,
230*5956d97fSEmmanuel Vadot				  <&clkc CLKID_MPLL0>,
231*5956d97fSEmmanuel Vadot				  <&clkc CLKID_MPLL1>;
232*5956d97fSEmmanuel Vadot		assigned-clock-parents = <0>, <0>, <0>;
233*5956d97fSEmmanuel Vadot		assigned-clock-rates = <294912000>,
234*5956d97fSEmmanuel Vadot				       <270950400>,
235*5956d97fSEmmanuel Vadot				       <393216000>;
236*5956d97fSEmmanuel Vadot		status = "okay";
237*5956d97fSEmmanuel Vadot
238*5956d97fSEmmanuel Vadot		dai-link-0 {
239*5956d97fSEmmanuel Vadot			sound-dai = <&frddr_a>;
240*5956d97fSEmmanuel Vadot		};
241*5956d97fSEmmanuel Vadot
242*5956d97fSEmmanuel Vadot		dai-link-1 {
243*5956d97fSEmmanuel Vadot			sound-dai = <&frddr_b>;
244*5956d97fSEmmanuel Vadot		};
245*5956d97fSEmmanuel Vadot
246*5956d97fSEmmanuel Vadot		dai-link-2 {
247*5956d97fSEmmanuel Vadot			sound-dai = <&frddr_c>;
248*5956d97fSEmmanuel Vadot		};
249*5956d97fSEmmanuel Vadot
250*5956d97fSEmmanuel Vadot		dai-link-3 {
251*5956d97fSEmmanuel Vadot			sound-dai = <&toddr_a>;
252*5956d97fSEmmanuel Vadot		};
253*5956d97fSEmmanuel Vadot
254*5956d97fSEmmanuel Vadot		dai-link-4 {
255*5956d97fSEmmanuel Vadot			sound-dai = <&toddr_b>;
256*5956d97fSEmmanuel Vadot		};
257*5956d97fSEmmanuel Vadot
258*5956d97fSEmmanuel Vadot		dai-link-5 {
259*5956d97fSEmmanuel Vadot			sound-dai = <&toddr_c>;
260*5956d97fSEmmanuel Vadot		};
261*5956d97fSEmmanuel Vadot
262*5956d97fSEmmanuel Vadot		/* 8ch hdmi interface */
263*5956d97fSEmmanuel Vadot		dai-link-6 {
264*5956d97fSEmmanuel Vadot			sound-dai = <&tdmif_b>;
265*5956d97fSEmmanuel Vadot			dai-format = "i2s";
266*5956d97fSEmmanuel Vadot			dai-tdm-slot-tx-mask-0 = <1 1>;
267*5956d97fSEmmanuel Vadot			dai-tdm-slot-tx-mask-1 = <1 1>;
268*5956d97fSEmmanuel Vadot			dai-tdm-slot-tx-mask-2 = <1 1>;
269*5956d97fSEmmanuel Vadot			dai-tdm-slot-tx-mask-3 = <1 1>;
270*5956d97fSEmmanuel Vadot			mclk-fs = <256>;
271*5956d97fSEmmanuel Vadot
272*5956d97fSEmmanuel Vadot			codec-0 {
273*5956d97fSEmmanuel Vadot				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
274*5956d97fSEmmanuel Vadot			};
275*5956d97fSEmmanuel Vadot
276*5956d97fSEmmanuel Vadot			codec-1 {
277*5956d97fSEmmanuel Vadot				sound-dai = <&toacodec TOACODEC_IN_B>;
278*5956d97fSEmmanuel Vadot			};
279*5956d97fSEmmanuel Vadot		};
280*5956d97fSEmmanuel Vadot
281*5956d97fSEmmanuel Vadot		/* i2s jack output interface */
282*5956d97fSEmmanuel Vadot		dai-link-7 {
283*5956d97fSEmmanuel Vadot			sound-dai = <&tdmif_c>;
284*5956d97fSEmmanuel Vadot			dai-format = "i2s";
285*5956d97fSEmmanuel Vadot			dai-tdm-slot-tx-mask-0 = <1 1>;
286*5956d97fSEmmanuel Vadot			mclk-fs = <256>;
287*5956d97fSEmmanuel Vadot
288*5956d97fSEmmanuel Vadot			codec-0 {
289*5956d97fSEmmanuel Vadot				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
290*5956d97fSEmmanuel Vadot			};
291*5956d97fSEmmanuel Vadot
292*5956d97fSEmmanuel Vadot			codec-1 {
293*5956d97fSEmmanuel Vadot				sound-dai = <&toacodec TOACODEC_IN_C>;
294*5956d97fSEmmanuel Vadot			};
295*5956d97fSEmmanuel Vadot		};
296*5956d97fSEmmanuel Vadot
297*5956d97fSEmmanuel Vadot		/* hdmi glue */
298*5956d97fSEmmanuel Vadot		dai-link-8 {
299*5956d97fSEmmanuel Vadot			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
300*5956d97fSEmmanuel Vadot
301*5956d97fSEmmanuel Vadot			codec {
302*5956d97fSEmmanuel Vadot				sound-dai = <&hdmi_tx>;
303*5956d97fSEmmanuel Vadot			};
304*5956d97fSEmmanuel Vadot		};
305*5956d97fSEmmanuel Vadot
306*5956d97fSEmmanuel Vadot		/* acodec glue */
307*5956d97fSEmmanuel Vadot		dai-link-9 {
308*5956d97fSEmmanuel Vadot			sound-dai = <&toacodec TOACODEC_OUT>;
309*5956d97fSEmmanuel Vadot
310*5956d97fSEmmanuel Vadot			codec {
311*5956d97fSEmmanuel Vadot				sound-dai = <&acodec>;
312*5956d97fSEmmanuel Vadot			};
313*5956d97fSEmmanuel Vadot		};
314*5956d97fSEmmanuel Vadot	};
315*5956d97fSEmmanuel Vadot};
316*5956d97fSEmmanuel Vadot
317*5956d97fSEmmanuel Vadot&acodec {
318*5956d97fSEmmanuel Vadot	AVDD-supply = <&vddao_1v8>;
319*5956d97fSEmmanuel Vadot	status = "okay";
320*5956d97fSEmmanuel Vadot};
321*5956d97fSEmmanuel Vadot
322*5956d97fSEmmanuel Vadot&arb {
323*5956d97fSEmmanuel Vadot	status = "okay";
324*5956d97fSEmmanuel Vadot};
325*5956d97fSEmmanuel Vadot
326*5956d97fSEmmanuel Vadot&clkc_audio {
327*5956d97fSEmmanuel Vadot	status = "okay";
328*5956d97fSEmmanuel Vadot};
329*5956d97fSEmmanuel Vadot
330*5956d97fSEmmanuel Vadot&cpu0 {
331*5956d97fSEmmanuel Vadot	cpu-supply = <&vddcpu>;
332*5956d97fSEmmanuel Vadot	operating-points-v2 = <&cpu_opp_table>;
333*5956d97fSEmmanuel Vadot	clocks = <&clkc CLKID_CPU_CLK>;
334*5956d97fSEmmanuel Vadot	clock-latency = <50000>;
335*5956d97fSEmmanuel Vadot};
336*5956d97fSEmmanuel Vadot
337*5956d97fSEmmanuel Vadot&cpu1 {
338*5956d97fSEmmanuel Vadot	cpu-supply = <&vddcpu>;
339*5956d97fSEmmanuel Vadot	operating-points-v2 = <&cpu_opp_table>;
340*5956d97fSEmmanuel Vadot	clocks = <&clkc CLKID_CPU1_CLK>;
341*5956d97fSEmmanuel Vadot	clock-latency = <50000>;
342*5956d97fSEmmanuel Vadot};
343*5956d97fSEmmanuel Vadot
344*5956d97fSEmmanuel Vadot&cpu2 {
345*5956d97fSEmmanuel Vadot	cpu-supply = <&vddcpu>;
346*5956d97fSEmmanuel Vadot	operating-points-v2 = <&cpu_opp_table>;
347*5956d97fSEmmanuel Vadot	clocks = <&clkc CLKID_CPU2_CLK>;
348*5956d97fSEmmanuel Vadot	clock-latency = <50000>;
349*5956d97fSEmmanuel Vadot};
350*5956d97fSEmmanuel Vadot
351*5956d97fSEmmanuel Vadot&cpu3 {
352*5956d97fSEmmanuel Vadot	cpu-supply = <&vddcpu>;
353*5956d97fSEmmanuel Vadot	operating-points-v2 = <&cpu_opp_table>;
354*5956d97fSEmmanuel Vadot	clocks = <&clkc CLKID_CPU3_CLK>;
355*5956d97fSEmmanuel Vadot	clock-latency = <50000>;
356*5956d97fSEmmanuel Vadot};
357*5956d97fSEmmanuel Vadot
358*5956d97fSEmmanuel Vadot&cvbs_vdac_port {
359*5956d97fSEmmanuel Vadot	cvbs_vdac_out: endpoint {
360*5956d97fSEmmanuel Vadot		remote-endpoint = <&cvbs_connector_in>;
361*5956d97fSEmmanuel Vadot	};
362*5956d97fSEmmanuel Vadot};
363*5956d97fSEmmanuel Vadot
364*5956d97fSEmmanuel Vadot&ext_mdio {
365*5956d97fSEmmanuel Vadot	external_phy: ethernet-phy@0 {
366*5956d97fSEmmanuel Vadot		/* Realtek RTL8211F (0x001cc916) */
367*5956d97fSEmmanuel Vadot		reg = <0>;
368*5956d97fSEmmanuel Vadot		max-speed = <1000>;
369*5956d97fSEmmanuel Vadot
370*5956d97fSEmmanuel Vadot		interrupt-parent = <&gpio_intc>;
371*5956d97fSEmmanuel Vadot		/* MAC_INTR on GPIOZ_14 */
372*5956d97fSEmmanuel Vadot		interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
373*5956d97fSEmmanuel Vadot	};
374*5956d97fSEmmanuel Vadot};
375*5956d97fSEmmanuel Vadot
376*5956d97fSEmmanuel Vadot&ethmac {
377*5956d97fSEmmanuel Vadot	pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
378*5956d97fSEmmanuel Vadot	pinctrl-names = "default";
379*5956d97fSEmmanuel Vadot	status = "okay";
380*5956d97fSEmmanuel Vadot	phy-mode = "rgmii-txid";
381*5956d97fSEmmanuel Vadot	phy-handle = <&external_phy>;
382*5956d97fSEmmanuel Vadot};
383*5956d97fSEmmanuel Vadot
384*5956d97fSEmmanuel Vadot&frddr_a {
385*5956d97fSEmmanuel Vadot	status = "okay";
386*5956d97fSEmmanuel Vadot};
387*5956d97fSEmmanuel Vadot
388*5956d97fSEmmanuel Vadot&frddr_b {
389*5956d97fSEmmanuel Vadot	status = "okay";
390*5956d97fSEmmanuel Vadot};
391*5956d97fSEmmanuel Vadot
392*5956d97fSEmmanuel Vadot&frddr_c {
393*5956d97fSEmmanuel Vadot	status = "okay";
394*5956d97fSEmmanuel Vadot};
395*5956d97fSEmmanuel Vadot
396*5956d97fSEmmanuel Vadot&gpio {
397*5956d97fSEmmanuel Vadot	gpio-line-names =
398*5956d97fSEmmanuel Vadot		/* GPIOZ */
399*5956d97fSEmmanuel Vadot		"ETH_MDIO", /* GPIOZ_0 */
400*5956d97fSEmmanuel Vadot		"ETH_MDC", /* GPIOZ_1 */
401*5956d97fSEmmanuel Vadot		"ETH_RXCLK", /* GPIOZ_2 */
402*5956d97fSEmmanuel Vadot		"ETH_RX_DV", /* GPIOZ_3 */
403*5956d97fSEmmanuel Vadot		"ETH_RXD0", /* GPIOZ_4 */
404*5956d97fSEmmanuel Vadot		"ETH_RXD1", /* GPIOZ_5 */
405*5956d97fSEmmanuel Vadot		"ETH_RXD2", /* GPIOZ_6 */
406*5956d97fSEmmanuel Vadot		"ETH_RXD3", /* GPIOZ_7 */
407*5956d97fSEmmanuel Vadot		"ETH_TXCLK", /* GPIOZ_8 */
408*5956d97fSEmmanuel Vadot		"ETH_TXEN", /* GPIOZ_9 */
409*5956d97fSEmmanuel Vadot		"ETH_TXD0", /* GPIOZ_10 */
410*5956d97fSEmmanuel Vadot		"ETH_TXD1", /* GPIOZ_11 */
411*5956d97fSEmmanuel Vadot		"ETH_TXD2", /* GPIOZ_12 */
412*5956d97fSEmmanuel Vadot		"ETH_TXD3", /* GPIOZ_13 */
413*5956d97fSEmmanuel Vadot		"ETH_INTR", /* GPIOZ_14 */
414*5956d97fSEmmanuel Vadot		"ETH_NRST", /* GPIOZ_15 */
415*5956d97fSEmmanuel Vadot		/* GPIOH */
416*5956d97fSEmmanuel Vadot		"HDMI_SDA", /* GPIOH_0 */
417*5956d97fSEmmanuel Vadot		"HDMI_SCL", /* GPIOH_1 */
418*5956d97fSEmmanuel Vadot		"HDMI_HPD", /* GPIOH_2 */
419*5956d97fSEmmanuel Vadot		"HDMI_CEC", /* GPIOH_3 */
420*5956d97fSEmmanuel Vadot		"VL-RST_N", /* GPIOH_4 */
421*5956d97fSEmmanuel Vadot		"CON1-P36", /* GPIOH_5 */
422*5956d97fSEmmanuel Vadot		"VL-PWREN", /* GPIOH_6 */
423*5956d97fSEmmanuel Vadot		"WiFi_3V3_1V8", /* GPIOH_7 */
424*5956d97fSEmmanuel Vadot		"TFLASH_VDD_EN", /* GPIOH_8 */
425*5956d97fSEmmanuel Vadot		/* BOOT */
426*5956d97fSEmmanuel Vadot		"eMMC_D0", /* BOOT_0 */
427*5956d97fSEmmanuel Vadot		"eMMC_D1", /* BOOT_1 */
428*5956d97fSEmmanuel Vadot		"eMMC_D2", /* BOOT_2 */
429*5956d97fSEmmanuel Vadot		"eMMC_D3", /* BOOT_3 */
430*5956d97fSEmmanuel Vadot		"eMMC_D4", /* BOOT_4 */
431*5956d97fSEmmanuel Vadot		"eMMC_D5", /* BOOT_5 */
432*5956d97fSEmmanuel Vadot		"eMMC_D6", /* BOOT_6 */
433*5956d97fSEmmanuel Vadot		"eMMC_D7", /* BOOT_7 */
434*5956d97fSEmmanuel Vadot		"eMMC_CLK", /* BOOT_8 */
435*5956d97fSEmmanuel Vadot		"",
436*5956d97fSEmmanuel Vadot		"eMMC_CMD", /* BOOT_10 */
437*5956d97fSEmmanuel Vadot		"",
438*5956d97fSEmmanuel Vadot		"eMMC_RST#", /* BOOT_12 */
439*5956d97fSEmmanuel Vadot		"eMMC_DS", /* BOOT_13 */
440*5956d97fSEmmanuel Vadot		/* GPIOC */
441*5956d97fSEmmanuel Vadot		"SD_D0_B", /* GPIOC_0 */
442*5956d97fSEmmanuel Vadot		"SD_D1_B", /* GPIOC_1 */
443*5956d97fSEmmanuel Vadot		"SD_D2_B", /* GPIOC_2 */
444*5956d97fSEmmanuel Vadot		"SD_D3_B", /* GPIOC_3 */
445*5956d97fSEmmanuel Vadot		"SD_CLK_B", /* GPIOC_4 */
446*5956d97fSEmmanuel Vadot		"SD_CMD_B", /* GPIOC_5 */
447*5956d97fSEmmanuel Vadot		"CARD_EN_DET", /* GPIOC_6 */
448*5956d97fSEmmanuel Vadot		"",
449*5956d97fSEmmanuel Vadot		/* GPIOA */
450*5956d97fSEmmanuel Vadot		"", "", "", "", "", "", "", "",
451*5956d97fSEmmanuel Vadot		"", "", "", "", "", "",
452*5956d97fSEmmanuel Vadot		"CON1-P27", /* GPIOA_14 */
453*5956d97fSEmmanuel Vadot		"CON1-P28", /* GPIOA_15 */
454*5956d97fSEmmanuel Vadot		/* GPIOX */
455*5956d97fSEmmanuel Vadot		"CON1-P16", /* GPIOX_0 */
456*5956d97fSEmmanuel Vadot		"CON1-P18", /* GPIOX_1 */
457*5956d97fSEmmanuel Vadot		"CON1-P22", /* GPIOX_2 */
458*5956d97fSEmmanuel Vadot		"CON1-P11", /* GPIOX_3 */
459*5956d97fSEmmanuel Vadot		"CON1-P13", /* GPIOX_4 */
460*5956d97fSEmmanuel Vadot		"CON1-P07", /* GPIOX_5 */
461*5956d97fSEmmanuel Vadot		"CON1-P33", /* GPIOX_6 */
462*5956d97fSEmmanuel Vadot		"CON1-P15", /* GPIOX_7 */
463*5956d97fSEmmanuel Vadot		"CON1-P19", /* GPIOX_8 */
464*5956d97fSEmmanuel Vadot		"CON1-P21", /* GPIOX_9 */
465*5956d97fSEmmanuel Vadot		"CON1-P24", /* GPIOX_10 */
466*5956d97fSEmmanuel Vadot		"CON1-P23", /* GPIOX_11 */
467*5956d97fSEmmanuel Vadot		"CON1-P08", /* GPIOX_12 */
468*5956d97fSEmmanuel Vadot		"CON1-P10", /* GPIOX_13 */
469*5956d97fSEmmanuel Vadot		"CON1-P29", /* GPIOX_14 */
470*5956d97fSEmmanuel Vadot		"CON1-P31", /* GPIOX_15 */
471*5956d97fSEmmanuel Vadot		"CON1-P26", /* GPIOX_16 */
472*5956d97fSEmmanuel Vadot		"CON1-P03", /* GPIOX_17 */
473*5956d97fSEmmanuel Vadot		"CON1-P05", /* GPIOX_18 */
474*5956d97fSEmmanuel Vadot		"CON1-P32"; /* GPIOX_19 */
475*5956d97fSEmmanuel Vadot
476*5956d97fSEmmanuel Vadot	/*
477*5956d97fSEmmanuel Vadot	 * WARNING: The USB Hub on the BPI-M5 needs a reset signal
478*5956d97fSEmmanuel Vadot	 * to be turned high in order to be detected by the USB Controller
479*5956d97fSEmmanuel Vadot	 * This signal should be handled by a USB specific power sequence
480*5956d97fSEmmanuel Vadot	 * in order to reset the Hub when USB bus is powered down.
481*5956d97fSEmmanuel Vadot	 */
482*5956d97fSEmmanuel Vadot	usb-hub {
483*5956d97fSEmmanuel Vadot		gpio-hog;
484*5956d97fSEmmanuel Vadot		gpios = <GPIOH_4 GPIO_ACTIVE_HIGH>;
485*5956d97fSEmmanuel Vadot		output-high;
486*5956d97fSEmmanuel Vadot		line-name = "usb-hub-reset";
487*5956d97fSEmmanuel Vadot	};
488*5956d97fSEmmanuel Vadot};
489*5956d97fSEmmanuel Vadot
490*5956d97fSEmmanuel Vadot&gpio_ao {
491*5956d97fSEmmanuel Vadot	gpio-line-names =
492*5956d97fSEmmanuel Vadot		/* GPIOAO */
493*5956d97fSEmmanuel Vadot		"DEBUG TX", /* GPIOAO_0 */
494*5956d97fSEmmanuel Vadot		"DEBUG RX", /* GPIOAO_1 */
495*5956d97fSEmmanuel Vadot		"SYS_LED2", /* GPIOAO_2 */
496*5956d97fSEmmanuel Vadot		"UPDATE_KEY", /* GPIOAO_3 */
497*5956d97fSEmmanuel Vadot		"CON1-P40", /* GPIOAO_4 */
498*5956d97fSEmmanuel Vadot		"IR_IN", /* GPIOAO_5 */
499*5956d97fSEmmanuel Vadot		"TF_3V3N_1V8_EN", /* GPIOAO_6 */
500*5956d97fSEmmanuel Vadot		"CON1-P35", /* GPIOAO_7 */
501*5956d97fSEmmanuel Vadot		"CON1-P12", /* GPIOAO_8 */
502*5956d97fSEmmanuel Vadot		"CON1-P37", /* GPIOAO_9 */
503*5956d97fSEmmanuel Vadot		"CON1-P38", /* GPIOAO_10 */
504*5956d97fSEmmanuel Vadot		"SYS_LED", /* GPIOAO_11 */
505*5956d97fSEmmanuel Vadot		/* GPIOE */
506*5956d97fSEmmanuel Vadot		"VDDEE_PWM", /* GPIOE_0 */
507*5956d97fSEmmanuel Vadot		"VDDCPU_PWM", /* GPIOE_1 */
508*5956d97fSEmmanuel Vadot		"TF_PWR_EN"; /* GPIOE_2 */
509*5956d97fSEmmanuel Vadot};
510*5956d97fSEmmanuel Vadot
511*5956d97fSEmmanuel Vadot&hdmi_tx {
512*5956d97fSEmmanuel Vadot	status = "okay";
513*5956d97fSEmmanuel Vadot	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
514*5956d97fSEmmanuel Vadot	pinctrl-names = "default";
515*5956d97fSEmmanuel Vadot	hdmi-supply = <&dc_in>;
516*5956d97fSEmmanuel Vadot};
517*5956d97fSEmmanuel Vadot
518*5956d97fSEmmanuel Vadot&hdmi_tx_tmds_port {
519*5956d97fSEmmanuel Vadot	hdmi_tx_tmds_out: endpoint {
520*5956d97fSEmmanuel Vadot		remote-endpoint = <&hdmi_connector_in>;
521*5956d97fSEmmanuel Vadot	};
522*5956d97fSEmmanuel Vadot};
523*5956d97fSEmmanuel Vadot
524*5956d97fSEmmanuel Vadot&ir {
525*5956d97fSEmmanuel Vadot	status = "okay";
526*5956d97fSEmmanuel Vadot	pinctrl-0 = <&remote_input_ao_pins>;
527*5956d97fSEmmanuel Vadot	pinctrl-names = "default";
528*5956d97fSEmmanuel Vadot};
529*5956d97fSEmmanuel Vadot
530*5956d97fSEmmanuel Vadot&pwm_AO_cd {
531*5956d97fSEmmanuel Vadot	pinctrl-0 = <&pwm_ao_d_e_pins>;
532*5956d97fSEmmanuel Vadot	pinctrl-names = "default";
533*5956d97fSEmmanuel Vadot	clocks = <&xtal>;
534*5956d97fSEmmanuel Vadot	clock-names = "clkin1";
535*5956d97fSEmmanuel Vadot	status = "okay";
536*5956d97fSEmmanuel Vadot};
537*5956d97fSEmmanuel Vadot
538*5956d97fSEmmanuel Vadot&saradc {
539*5956d97fSEmmanuel Vadot	status = "okay";
540*5956d97fSEmmanuel Vadot	vref-supply = <&vddao_1v8>;
541*5956d97fSEmmanuel Vadot};
542*5956d97fSEmmanuel Vadot
543*5956d97fSEmmanuel Vadot/* SD card */
544*5956d97fSEmmanuel Vadot&sd_emmc_b {
545*5956d97fSEmmanuel Vadot	status = "okay";
546*5956d97fSEmmanuel Vadot	pinctrl-0 = <&sdcard_c_pins>;
547*5956d97fSEmmanuel Vadot	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
548*5956d97fSEmmanuel Vadot	pinctrl-names = "default", "clk-gate";
549*5956d97fSEmmanuel Vadot
550*5956d97fSEmmanuel Vadot	bus-width = <4>;
551*5956d97fSEmmanuel Vadot	cap-sd-highspeed;
552*5956d97fSEmmanuel Vadot	max-frequency = <50000000>;
553*5956d97fSEmmanuel Vadot	disable-wp;
554*5956d97fSEmmanuel Vadot
555*5956d97fSEmmanuel Vadot	/* TOFIX: SD card is barely usable in SDR modes */
556*5956d97fSEmmanuel Vadot
557*5956d97fSEmmanuel Vadot	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
558*5956d97fSEmmanuel Vadot	vmmc-supply = <&tflash_vdd>;
559*5956d97fSEmmanuel Vadot	vqmmc-supply = <&vddio_c>;
560*5956d97fSEmmanuel Vadot};
561*5956d97fSEmmanuel Vadot
562*5956d97fSEmmanuel Vadot/* eMMC */
563*5956d97fSEmmanuel Vadot&sd_emmc_c {
564*5956d97fSEmmanuel Vadot	status = "okay";
565*5956d97fSEmmanuel Vadot	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
566*5956d97fSEmmanuel Vadot	pinctrl-1 = <&emmc_clk_gate_pins>;
567*5956d97fSEmmanuel Vadot	pinctrl-names = "default", "clk-gate";
568*5956d97fSEmmanuel Vadot
569*5956d97fSEmmanuel Vadot	bus-width = <8>;
570*5956d97fSEmmanuel Vadot	cap-mmc-highspeed;
571*5956d97fSEmmanuel Vadot	mmc-ddr-1_8v;
572*5956d97fSEmmanuel Vadot	mmc-hs200-1_8v;
573*5956d97fSEmmanuel Vadot	max-frequency = <200000000>;
574*5956d97fSEmmanuel Vadot	disable-wp;
575*5956d97fSEmmanuel Vadot
576*5956d97fSEmmanuel Vadot	mmc-pwrseq = <&emmc_pwrseq>;
577*5956d97fSEmmanuel Vadot	vmmc-supply = <&vddao_3v3>;
578*5956d97fSEmmanuel Vadot	vqmmc-supply = <&emmc_1v8>;
579*5956d97fSEmmanuel Vadot};
580*5956d97fSEmmanuel Vadot
581*5956d97fSEmmanuel Vadot&tdmif_b {
582*5956d97fSEmmanuel Vadot	status = "okay";
583*5956d97fSEmmanuel Vadot};
584*5956d97fSEmmanuel Vadot
585*5956d97fSEmmanuel Vadot&tdmif_c {
586*5956d97fSEmmanuel Vadot	status = "okay";
587*5956d97fSEmmanuel Vadot};
588*5956d97fSEmmanuel Vadot
589*5956d97fSEmmanuel Vadot&tdmin_a {
590*5956d97fSEmmanuel Vadot	status = "okay";
591*5956d97fSEmmanuel Vadot};
592*5956d97fSEmmanuel Vadot
593*5956d97fSEmmanuel Vadot&tdmin_b {
594*5956d97fSEmmanuel Vadot	status = "okay";
595*5956d97fSEmmanuel Vadot};
596*5956d97fSEmmanuel Vadot
597*5956d97fSEmmanuel Vadot&tdmin_c {
598*5956d97fSEmmanuel Vadot	status = "okay";
599*5956d97fSEmmanuel Vadot};
600*5956d97fSEmmanuel Vadot
601*5956d97fSEmmanuel Vadot&tdmout_b {
602*5956d97fSEmmanuel Vadot	status = "okay";
603*5956d97fSEmmanuel Vadot};
604*5956d97fSEmmanuel Vadot
605*5956d97fSEmmanuel Vadot&tdmout_c {
606*5956d97fSEmmanuel Vadot	status = "okay";
607*5956d97fSEmmanuel Vadot};
608*5956d97fSEmmanuel Vadot
609*5956d97fSEmmanuel Vadot&toacodec {
610*5956d97fSEmmanuel Vadot	status = "okay";
611*5956d97fSEmmanuel Vadot};
612*5956d97fSEmmanuel Vadot
613*5956d97fSEmmanuel Vadot&tohdmitx {
614*5956d97fSEmmanuel Vadot	status = "okay";
615*5956d97fSEmmanuel Vadot};
616*5956d97fSEmmanuel Vadot
617*5956d97fSEmmanuel Vadot&toddr_a {
618*5956d97fSEmmanuel Vadot	status = "okay";
619*5956d97fSEmmanuel Vadot};
620*5956d97fSEmmanuel Vadot
621*5956d97fSEmmanuel Vadot&toddr_b {
622*5956d97fSEmmanuel Vadot	status = "okay";
623*5956d97fSEmmanuel Vadot};
624*5956d97fSEmmanuel Vadot
625*5956d97fSEmmanuel Vadot&toddr_c {
626*5956d97fSEmmanuel Vadot	status = "okay";
627*5956d97fSEmmanuel Vadot};
628*5956d97fSEmmanuel Vadot
629*5956d97fSEmmanuel Vadot&uart_AO {
630*5956d97fSEmmanuel Vadot	status = "okay";
631*5956d97fSEmmanuel Vadot	pinctrl-0 = <&uart_ao_a_pins>;
632*5956d97fSEmmanuel Vadot	pinctrl-names = "default";
633*5956d97fSEmmanuel Vadot};
634*5956d97fSEmmanuel Vadot
635*5956d97fSEmmanuel Vadot&usb {
636*5956d97fSEmmanuel Vadot	status = "okay";
637*5956d97fSEmmanuel Vadot};
638*5956d97fSEmmanuel Vadot
639*5956d97fSEmmanuel Vadot&usb2_phy0 {
640*5956d97fSEmmanuel Vadot	phy-supply = <&dc_in>;
641*5956d97fSEmmanuel Vadot};
642*5956d97fSEmmanuel Vadot
643*5956d97fSEmmanuel Vadot&usb2_phy1 {
644*5956d97fSEmmanuel Vadot	/* Enable the hub which is connected to this port */
645*5956d97fSEmmanuel Vadot	phy-supply = <&vl_pwr_en>;
646*5956d97fSEmmanuel Vadot};
647