1724ba675SRob Herring// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2724ba675SRob Herring/*
3724ba675SRob Herring * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
4724ba675SRob Herring * Author: Ludovic Barre <ludovic.barre@st.com> for STMicroelectronics.
5724ba675SRob Herring */
6724ba675SRob Herring/dts-v1/;
7724ba675SRob Herring
8724ba675SRob Herring#include "stm32mp157c-ed1.dts"
9724ba675SRob Herring#include <dt-bindings/gpio/gpio.h>
10724ba675SRob Herring#include <dt-bindings/input/input.h>
11724ba675SRob Herring#include <dt-bindings/media/video-interfaces.h>
12724ba675SRob Herring
13724ba675SRob Herring/ {
14724ba675SRob Herring	model = "STMicroelectronics STM32MP157C eval daughter on eval mother";
15724ba675SRob Herring	compatible = "st,stm32mp157c-ev1", "st,stm32mp157c-ed1", "st,stm32mp157";
16724ba675SRob Herring
17724ba675SRob Herring	aliases {
18724ba675SRob Herring		serial1 = &usart3;
19724ba675SRob Herring		ethernet0 = &ethernet0;
20724ba675SRob Herring	};
21724ba675SRob Herring
22724ba675SRob Herring	chosen {
23724ba675SRob Herring		stdout-path = "serial0:115200n8";
24724ba675SRob Herring	};
25724ba675SRob Herring
26724ba675SRob Herring	clocks {
27724ba675SRob Herring		clk_ext_camera: clk-ext-camera {
28724ba675SRob Herring			#clock-cells = <0>;
29724ba675SRob Herring			compatible = "fixed-clock";
30724ba675SRob Herring			clock-frequency = <24000000>;
31724ba675SRob Herring		};
32724ba675SRob Herring	};
33724ba675SRob Herring
34724ba675SRob Herring	joystick {
35724ba675SRob Herring		compatible = "gpio-keys";
36724ba675SRob Herring		pinctrl-0 = <&joystick_pins>;
37724ba675SRob Herring		pinctrl-names = "default";
38724ba675SRob Herring		button-0 {
39724ba675SRob Herring			label = "JoySel";
40724ba675SRob Herring			linux,code = <KEY_ENTER>;
41724ba675SRob Herring			interrupt-parent = <&stmfx_pinctrl>;
42724ba675SRob Herring			interrupts = <0 IRQ_TYPE_EDGE_RISING>;
43724ba675SRob Herring		};
44724ba675SRob Herring		button-1 {
45724ba675SRob Herring			label = "JoyDown";
46724ba675SRob Herring			linux,code = <KEY_DOWN>;
47724ba675SRob Herring			interrupt-parent = <&stmfx_pinctrl>;
48724ba675SRob Herring			interrupts = <1 IRQ_TYPE_EDGE_RISING>;
49724ba675SRob Herring		};
50724ba675SRob Herring		button-2 {
51724ba675SRob Herring			label = "JoyLeft";
52724ba675SRob Herring			linux,code = <KEY_LEFT>;
53724ba675SRob Herring			interrupt-parent = <&stmfx_pinctrl>;
54724ba675SRob Herring			interrupts = <2 IRQ_TYPE_EDGE_RISING>;
55724ba675SRob Herring		};
56724ba675SRob Herring		button-3 {
57724ba675SRob Herring			label = "JoyRight";
58724ba675SRob Herring			linux,code = <KEY_RIGHT>;
59724ba675SRob Herring			interrupt-parent = <&stmfx_pinctrl>;
60724ba675SRob Herring			interrupts = <3 IRQ_TYPE_EDGE_RISING>;
61724ba675SRob Herring		};
62724ba675SRob Herring		button-4 {
63724ba675SRob Herring			label = "JoyUp";
64724ba675SRob Herring			linux,code = <KEY_UP>;
65724ba675SRob Herring			interrupt-parent = <&stmfx_pinctrl>;
66724ba675SRob Herring			interrupts = <4 IRQ_TYPE_EDGE_RISING>;
67724ba675SRob Herring		};
68724ba675SRob Herring	};
69724ba675SRob Herring
70724ba675SRob Herring	panel_backlight: panel-backlight {
71724ba675SRob Herring		compatible = "gpio-backlight";
72724ba675SRob Herring		gpios = <&gpiod 13 GPIO_ACTIVE_LOW>;
73724ba675SRob Herring		default-on;
74724ba675SRob Herring		status = "okay";
75724ba675SRob Herring	};
76724ba675SRob Herring};
77724ba675SRob Herring
78724ba675SRob Herring&cec {
79724ba675SRob Herring	pinctrl-names = "default";
80724ba675SRob Herring	pinctrl-0 = <&cec_pins_a>;
81724ba675SRob Herring	status = "okay";
82724ba675SRob Herring};
83724ba675SRob Herring
84724ba675SRob Herring&dcmi {
85724ba675SRob Herring	status = "okay";
86724ba675SRob Herring	pinctrl-names = "default", "sleep";
87724ba675SRob Herring	pinctrl-0 = <&dcmi_pins_a>;
88724ba675SRob Herring	pinctrl-1 = <&dcmi_sleep_pins_a>;
89724ba675SRob Herring
90724ba675SRob Herring	port {
91724ba675SRob Herring		dcmi_0: endpoint {
92724ba675SRob Herring			remote-endpoint = <&ov5640_0>;
93724ba675SRob Herring			bus-type = <MEDIA_BUS_TYPE_PARALLEL>;
94724ba675SRob Herring			bus-width = <8>;
95724ba675SRob Herring			hsync-active = <0>;
96724ba675SRob Herring			vsync-active = <0>;
97724ba675SRob Herring			pclk-sample = <1>;
98724ba675SRob Herring		};
99724ba675SRob Herring	};
100724ba675SRob Herring};
101724ba675SRob Herring
102724ba675SRob Herring&dsi {
103724ba675SRob Herring	#address-cells = <1>;
104724ba675SRob Herring	#size-cells = <0>;
105724ba675SRob Herring	status = "okay";
106724ba675SRob Herring
107724ba675SRob Herring	panel@0 {
108724ba675SRob Herring		compatible = "raydium,rm68200";
109724ba675SRob Herring		reg = <0>;
110724ba675SRob Herring		reset-gpios = <&gpiof 15 GPIO_ACTIVE_LOW>;
111724ba675SRob Herring		backlight = <&panel_backlight>;
112724ba675SRob Herring		power-supply = <&v3v3>;
113724ba675SRob Herring		status = "okay";
114724ba675SRob Herring
115724ba675SRob Herring		port {
116724ba675SRob Herring			dsi_panel_in: endpoint {
117724ba675SRob Herring				remote-endpoint = <&dsi_out>;
118724ba675SRob Herring			};
119724ba675SRob Herring		};
120724ba675SRob Herring	};
121724ba675SRob Herring};
122724ba675SRob Herring
123*5408d518SMarek Vasut&dsi_in {
124*5408d518SMarek Vasut	remote-endpoint = <&ltdc_ep0_out>;
125*5408d518SMarek Vasut};
126*5408d518SMarek Vasut
127*5408d518SMarek Vasut&dsi_out {
128*5408d518SMarek Vasut	remote-endpoint = <&dsi_panel_in>;
129*5408d518SMarek Vasut};
130*5408d518SMarek Vasut
131724ba675SRob Herring&ethernet0 {
132724ba675SRob Herring	status = "okay";
133724ba675SRob Herring	pinctrl-0 = <&ethernet0_rgmii_pins_a>;
134724ba675SRob Herring	pinctrl-1 = <&ethernet0_rgmii_sleep_pins_a>;
135724ba675SRob Herring	pinctrl-names = "default", "sleep";
136724ba675SRob Herring	phy-mode = "rgmii-id";
137724ba675SRob Herring	max-speed = <1000>;
138724ba675SRob Herring	phy-handle = <&phy0>;
139724ba675SRob Herring
140724ba675SRob Herring	mdio {
141724ba675SRob Herring		#address-cells = <1>;
142724ba675SRob Herring		#size-cells = <0>;
143724ba675SRob Herring		compatible = "snps,dwmac-mdio";
144724ba675SRob Herring		phy0: ethernet-phy@0 {
145724ba675SRob Herring			reg = <0>;
146724ba675SRob Herring		};
147724ba675SRob Herring	};
148724ba675SRob Herring};
149724ba675SRob Herring
150724ba675SRob Herring&fmc {
151724ba675SRob Herring	pinctrl-names = "default", "sleep";
152724ba675SRob Herring	pinctrl-0 = <&fmc_pins_a>;
153724ba675SRob Herring	pinctrl-1 = <&fmc_sleep_pins_a>;
154724ba675SRob Herring	status = "okay";
155724ba675SRob Herring
156724ba675SRob Herring	nand-controller@4,0 {
157724ba675SRob Herring		status = "okay";
158724ba675SRob Herring
159724ba675SRob Herring		nand@0 {
160724ba675SRob Herring			reg = <0>;
161724ba675SRob Herring			nand-on-flash-bbt;
162724ba675SRob Herring			#address-cells = <1>;
163724ba675SRob Herring			#size-cells = <1>;
164724ba675SRob Herring		};
165724ba675SRob Herring	};
166724ba675SRob Herring};
167724ba675SRob Herring
168724ba675SRob Herring&i2c2 {
169724ba675SRob Herring	pinctrl-names = "default", "sleep";
170724ba675SRob Herring	pinctrl-0 = <&i2c2_pins_a>;
171724ba675SRob Herring	pinctrl-1 = <&i2c2_sleep_pins_a>;
172724ba675SRob Herring	i2c-scl-rising-time-ns = <185>;
173724ba675SRob Herring	i2c-scl-falling-time-ns = <20>;
174724ba675SRob Herring	status = "okay";
175724ba675SRob Herring
176724ba675SRob Herring	ov5640: camera@3c {
177724ba675SRob Herring		compatible = "ovti,ov5640";
178724ba675SRob Herring		reg = <0x3c>;
179724ba675SRob Herring		clocks = <&clk_ext_camera>;
180724ba675SRob Herring		clock-names = "xclk";
181724ba675SRob Herring		AVDD-supply = <&v2v8>;
182724ba675SRob Herring		DOVDD-supply = <&v2v8>;
183724ba675SRob Herring		DVDD-supply = <&v2v8>;
184724ba675SRob Herring		powerdown-gpios = <&stmfx_pinctrl 18 (GPIO_ACTIVE_HIGH | GPIO_PUSH_PULL)>;
185724ba675SRob Herring		reset-gpios = <&stmfx_pinctrl 19 (GPIO_ACTIVE_LOW | GPIO_PUSH_PULL)>;
186724ba675SRob Herring		rotation = <180>;
187724ba675SRob Herring		status = "okay";
188724ba675SRob Herring
189724ba675SRob Herring		port {
190724ba675SRob Herring			ov5640_0: endpoint {
191724ba675SRob Herring				remote-endpoint = <&dcmi_0>;
192724ba675SRob Herring				bus-width = <8>;
193724ba675SRob Herring				data-shift = <2>; /* lines 9:2 are used */
194724ba675SRob Herring				hsync-active = <0>;
195724ba675SRob Herring				vsync-active = <0>;
196724ba675SRob Herring				pclk-sample = <1>;
197724ba675SRob Herring			};
198724ba675SRob Herring		};
199724ba675SRob Herring	};
200724ba675SRob Herring
201724ba675SRob Herring	stmfx: stmfx@42 {
202724ba675SRob Herring		compatible = "st,stmfx-0300";
203724ba675SRob Herring		reg = <0x42>;
204724ba675SRob Herring		interrupts = <8 IRQ_TYPE_EDGE_RISING>;
205724ba675SRob Herring		interrupt-parent = <&gpioi>;
206724ba675SRob Herring		vdd-supply = <&v3v3>;
207724ba675SRob Herring
208724ba675SRob Herring		stmfx_pinctrl: pinctrl {
209724ba675SRob Herring			compatible = "st,stmfx-0300-pinctrl";
210724ba675SRob Herring			gpio-controller;
211724ba675SRob Herring			#gpio-cells = <2>;
212724ba675SRob Herring			interrupt-controller;
213724ba675SRob Herring			#interrupt-cells = <2>;
214724ba675SRob Herring			gpio-ranges = <&stmfx_pinctrl 0 0 24>;
215724ba675SRob Herring
216724ba675SRob Herring			joystick_pins: joystick-pins {
217724ba675SRob Herring				pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
218724ba675SRob Herring				bias-pull-down;
219724ba675SRob Herring			};
220724ba675SRob Herring		};
221724ba675SRob Herring	};
222724ba675SRob Herring};
223724ba675SRob Herring
224724ba675SRob Herring&i2c5 {
225724ba675SRob Herring	pinctrl-names = "default", "sleep";
226724ba675SRob Herring	pinctrl-0 = <&i2c5_pins_a>;
227724ba675SRob Herring	pinctrl-1 = <&i2c5_sleep_pins_a>;
228724ba675SRob Herring	i2c-scl-rising-time-ns = <185>;
229724ba675SRob Herring	i2c-scl-falling-time-ns = <20>;
230724ba675SRob Herring	status = "okay";
231724ba675SRob Herring};
232724ba675SRob Herring
233724ba675SRob Herring&ltdc {
234724ba675SRob Herring	status = "okay";
235724ba675SRob Herring
236724ba675SRob Herring	port {
237724ba675SRob Herring		ltdc_ep0_out: endpoint {
238724ba675SRob Herring			remote-endpoint = <&dsi_in>;
239724ba675SRob Herring		};
240724ba675SRob Herring	};
241724ba675SRob Herring};
242724ba675SRob Herring
243724ba675SRob Herring&m_can1 {
244724ba675SRob Herring	pinctrl-names = "default", "sleep";
245724ba675SRob Herring	pinctrl-0 = <&m_can1_pins_a>;
246724ba675SRob Herring	pinctrl-1 = <&m_can1_sleep_pins_a>;
247724ba675SRob Herring	status = "okay";
248724ba675SRob Herring};
249724ba675SRob Herring
250724ba675SRob Herring&qspi {
251724ba675SRob Herring	pinctrl-names = "default", "sleep";
252724ba675SRob Herring	pinctrl-0 = <&qspi_clk_pins_a
253724ba675SRob Herring		     &qspi_bk1_pins_a
254724ba675SRob Herring		     &qspi_cs1_pins_a
255724ba675SRob Herring		     &qspi_bk2_pins_a
256724ba675SRob Herring		     &qspi_cs2_pins_a>;
257724ba675SRob Herring	pinctrl-1 = <&qspi_clk_sleep_pins_a
258724ba675SRob Herring		     &qspi_bk1_sleep_pins_a
259724ba675SRob Herring		     &qspi_cs1_sleep_pins_a
260724ba675SRob Herring		     &qspi_bk2_sleep_pins_a
261724ba675SRob Herring		     &qspi_cs2_sleep_pins_a>;
262724ba675SRob Herring	reg = <0x58003000 0x1000>, <0x70000000 0x4000000>;
263724ba675SRob Herring	#address-cells = <1>;
264724ba675SRob Herring	#size-cells = <0>;
265724ba675SRob Herring	status = "okay";
266724ba675SRob Herring
267724ba675SRob Herring	flash0: flash@0 {
268724ba675SRob Herring		compatible = "jedec,spi-nor";
269724ba675SRob Herring		reg = <0>;
270724ba675SRob Herring		spi-rx-bus-width = <4>;
271724ba675SRob Herring		spi-max-frequency = <108000000>;
272724ba675SRob Herring		#address-cells = <1>;
273724ba675SRob Herring		#size-cells = <1>;
274724ba675SRob Herring	};
275724ba675SRob Herring
276724ba675SRob Herring	flash1: flash@1 {
277724ba675SRob Herring		compatible = "jedec,spi-nor";
278724ba675SRob Herring		reg = <1>;
279724ba675SRob Herring		spi-rx-bus-width = <4>;
280724ba675SRob Herring		spi-max-frequency = <108000000>;
281724ba675SRob Herring		#address-cells = <1>;
282724ba675SRob Herring		#size-cells = <1>;
283724ba675SRob Herring	};
284724ba675SRob Herring};
285724ba675SRob Herring
286724ba675SRob Herring&sdmmc3 {
287724ba675SRob Herring	pinctrl-names = "default", "opendrain", "sleep";
288724ba675SRob Herring	pinctrl-0 = <&sdmmc3_b4_pins_a>;
289724ba675SRob Herring	pinctrl-1 = <&sdmmc3_b4_od_pins_a>;
290724ba675SRob Herring	pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>;
291724ba675SRob Herring	broken-cd;
292724ba675SRob Herring	st,neg-edge;
293724ba675SRob Herring	bus-width = <4>;
294724ba675SRob Herring	vmmc-supply = <&v3v3>;
295724ba675SRob Herring	status = "disabled";
296724ba675SRob Herring};
297724ba675SRob Herring
298724ba675SRob Herring&spi1 {
299724ba675SRob Herring	pinctrl-names = "default";
300724ba675SRob Herring	pinctrl-0 = <&spi1_pins_a>;
301724ba675SRob Herring	status = "disabled";
302724ba675SRob Herring};
303724ba675SRob Herring
304724ba675SRob Herring&timers2 {
305724ba675SRob Herring	/* spare dmas for other usage (un-delete to enable pwm capture) */
306724ba675SRob Herring	/delete-property/dmas;
307724ba675SRob Herring	/delete-property/dma-names;
308724ba675SRob Herring	status = "disabled";
309724ba675SRob Herring	pwm {
310724ba675SRob Herring		pinctrl-0 = <&pwm2_pins_a>;
311724ba675SRob Herring		pinctrl-1 = <&pwm2_sleep_pins_a>;
312724ba675SRob Herring		pinctrl-names = "default", "sleep";
313724ba675SRob Herring		status = "okay";
314724ba675SRob Herring	};
315724ba675SRob Herring	timer@1 {
316724ba675SRob Herring		status = "okay";
317724ba675SRob Herring	};
318724ba675SRob Herring};
319724ba675SRob Herring
320724ba675SRob Herring&timers8 {
321724ba675SRob Herring	/delete-property/dmas;
322724ba675SRob Herring	/delete-property/dma-names;
323724ba675SRob Herring	status = "disabled";
324724ba675SRob Herring	pwm {
325724ba675SRob Herring		pinctrl-0 = <&pwm8_pins_a>;
326724ba675SRob Herring		pinctrl-1 = <&pwm8_sleep_pins_a>;
327724ba675SRob Herring		pinctrl-names = "default", "sleep";
328724ba675SRob Herring		status = "okay";
329724ba675SRob Herring	};
330724ba675SRob Herring	timer@7 {
331724ba675SRob Herring		status = "okay";
332724ba675SRob Herring	};
333724ba675SRob Herring};
334724ba675SRob Herring
335724ba675SRob Herring&timers12 {
336724ba675SRob Herring	/delete-property/dmas;
337724ba675SRob Herring	/delete-property/dma-names;
338724ba675SRob Herring	status = "disabled";
339724ba675SRob Herring	pwm {
340724ba675SRob Herring		pinctrl-0 = <&pwm12_pins_a>;
341724ba675SRob Herring		pinctrl-1 = <&pwm12_sleep_pins_a>;
342724ba675SRob Herring		pinctrl-names = "default", "sleep";
343724ba675SRob Herring		status = "okay";
344724ba675SRob Herring	};
345724ba675SRob Herring	timer@11 {
346724ba675SRob Herring		status = "okay";
347724ba675SRob Herring	};
348724ba675SRob Herring};
349724ba675SRob Herring
350724ba675SRob Herring&usart3 {
351724ba675SRob Herring	pinctrl-names = "default", "sleep", "idle";
352724ba675SRob Herring	pinctrl-0 = <&usart3_pins_b>;
353724ba675SRob Herring	pinctrl-1 = <&usart3_sleep_pins_b>;
354724ba675SRob Herring	pinctrl-2 = <&usart3_idle_pins_b>;
355724ba675SRob Herring	/*
356724ba675SRob Herring	 * HW flow control USART3_RTS is optional, and isn't default wired to
357724ba675SRob Herring	 * the connector. SB23 needs to be soldered in order to use it, and R77
358724ba675SRob Herring	 * (ETH_CLK) should be removed.
359724ba675SRob Herring	 */
360724ba675SRob Herring	uart-has-rtscts;
361724ba675SRob Herring	status = "disabled";
362724ba675SRob Herring};
363724ba675SRob Herring
364724ba675SRob Herring&usbh_ehci {
365724ba675SRob Herring	phys = <&usbphyc_port0>;
366724ba675SRob Herring	status = "okay";
367724ba675SRob Herring	#address-cells = <1>;
368724ba675SRob Herring	#size-cells = <0>;
369724ba675SRob Herring	/* onboard HUB */
370724ba675SRob Herring	hub@1 {
371724ba675SRob Herring		compatible = "usb424,2514";
372724ba675SRob Herring		reg = <1>;
373724ba675SRob Herring		vdd-supply = <&v3v3>;
374724ba675SRob Herring	};
375724ba675SRob Herring};
376724ba675SRob Herring
377724ba675SRob Herring&usbotg_hs {
378724ba675SRob Herring	pinctrl-0 = <&usbotg_hs_pins_a>;
379724ba675SRob Herring	pinctrl-names = "default";
380724ba675SRob Herring	phys = <&usbphyc_port1 0>;
381724ba675SRob Herring	phy-names = "usb2-phy";
382724ba675SRob Herring	status = "okay";
383724ba675SRob Herring};
384724ba675SRob Herring
385724ba675SRob Herring&usbphyc {
386724ba675SRob Herring	status = "okay";
387724ba675SRob Herring};
388724ba675SRob Herring
389724ba675SRob Herring&usbphyc_port0 {
390724ba675SRob Herring	st,tune-hs-dc-level = <2>;
391724ba675SRob Herring	st,enable-fs-rftime-tuning;
392724ba675SRob Herring	st,enable-hs-rftime-reduction;
393724ba675SRob Herring	st,trim-hs-current = <15>;
394724ba675SRob Herring	st,trim-hs-impedance = <1>;
395724ba675SRob Herring	st,tune-squelch-level = <3>;
396724ba675SRob Herring	st,tune-hs-rx-offset = <2>;
397724ba675SRob Herring	st,no-lsfs-sc;
398724ba675SRob Herring
399724ba675SRob Herring	connector {
400724ba675SRob Herring		compatible = "usb-a-connector";
401724ba675SRob Herring		vbus-supply = <&vbus_sw>;
402724ba675SRob Herring	};
403724ba675SRob Herring};
404724ba675SRob Herring
405724ba675SRob Herring&usbphyc_port1 {
406724ba675SRob Herring	st,tune-hs-dc-level = <2>;
407724ba675SRob Herring	st,enable-fs-rftime-tuning;
408724ba675SRob Herring	st,enable-hs-rftime-reduction;
409724ba675SRob Herring	st,trim-hs-current = <15>;
410724ba675SRob Herring	st,trim-hs-impedance = <1>;
411724ba675SRob Herring	st,tune-squelch-level = <3>;
412724ba675SRob Herring	st,tune-hs-rx-offset = <2>;
413724ba675SRob Herring	st,no-lsfs-sc;
414724ba675SRob Herring};
415