xref: /linux/arch/arm/boot/dts/renesas/r8a7742-iwg21d-q7-dbcm-ca.dts (revision cdd5b5a9761fd66d17586e4f4ba6588c70e640ea)
1*724ba675SRob Herring// SPDX-License-Identifier: GPL-2.0
2*724ba675SRob Herring/*
3*724ba675SRob Herring * Device Tree Source for the iWave-RZ/G1H Qseven board development
4*724ba675SRob Herring * platform with camera daughter board
5*724ba675SRob Herring *
6*724ba675SRob Herring * Copyright (C) 2020 Renesas Electronics Corp.
7*724ba675SRob Herring */
8*724ba675SRob Herring
9*724ba675SRob Herring/dts-v1/;
10*724ba675SRob Herring
11*724ba675SRob Herring#include <dt-bindings/media/video-interfaces.h>
12*724ba675SRob Herring
13*724ba675SRob Herring#include "r8a7742-iwg21d-q7.dts"
14*724ba675SRob Herring
15*724ba675SRob Herring/ {
16*724ba675SRob Herring	model = "iWave Systems RZ/G1H Qseven development platform with camera add-on";
17*724ba675SRob Herring	compatible = "iwave,g21d", "iwave,g21m", "renesas,r8a7742";
18*724ba675SRob Herring
19*724ba675SRob Herring	aliases {
20*724ba675SRob Herring		serial0 = &scif0;
21*724ba675SRob Herring		serial1 = &scif1;
22*724ba675SRob Herring		serial3 = &scifb1;
23*724ba675SRob Herring		serial5 = &hscif0;
24*724ba675SRob Herring		ethernet1 = &ether;
25*724ba675SRob Herring	};
26*724ba675SRob Herring
27*724ba675SRob Herring	mclk_cam1: mclk-cam1 {
28*724ba675SRob Herring		compatible = "fixed-clock";
29*724ba675SRob Herring		#clock-cells = <0>;
30*724ba675SRob Herring		clock-frequency = <26000000>;
31*724ba675SRob Herring	};
32*724ba675SRob Herring
33*724ba675SRob Herring	mclk_cam2: mclk-cam2 {
34*724ba675SRob Herring		compatible = "fixed-clock";
35*724ba675SRob Herring		#clock-cells = <0>;
36*724ba675SRob Herring		clock-frequency = <26000000>;
37*724ba675SRob Herring	};
38*724ba675SRob Herring
39*724ba675SRob Herring	mclk_cam3: mclk-cam3 {
40*724ba675SRob Herring		compatible = "fixed-clock";
41*724ba675SRob Herring		#clock-cells = <0>;
42*724ba675SRob Herring		clock-frequency = <26000000>;
43*724ba675SRob Herring	};
44*724ba675SRob Herring
45*724ba675SRob Herring	mclk_cam4: mclk-cam4 {
46*724ba675SRob Herring		compatible = "fixed-clock";
47*724ba675SRob Herring		#clock-cells = <0>;
48*724ba675SRob Herring		clock-frequency = <26000000>;
49*724ba675SRob Herring	};
50*724ba675SRob Herring
51*724ba675SRob Herring	reg_1p8v: 1p8v {
52*724ba675SRob Herring		compatible = "regulator-fixed";
53*724ba675SRob Herring		regulator-name = "1P8V";
54*724ba675SRob Herring		regulator-min-microvolt = <1800000>;
55*724ba675SRob Herring		regulator-max-microvolt = <1800000>;
56*724ba675SRob Herring		regulator-always-on;
57*724ba675SRob Herring	};
58*724ba675SRob Herring
59*724ba675SRob Herring	reg_2p8v: 2p8v {
60*724ba675SRob Herring		compatible = "regulator-fixed";
61*724ba675SRob Herring		regulator-name = "2P8V";
62*724ba675SRob Herring		regulator-min-microvolt = <2800000>;
63*724ba675SRob Herring		regulator-max-microvolt = <2800000>;
64*724ba675SRob Herring		regulator-always-on;
65*724ba675SRob Herring	};
66*724ba675SRob Herring};
67*724ba675SRob Herring
68*724ba675SRob Herring&avb {
69*724ba675SRob Herring	/* Pins shared with VIN0, keep status disabled */
70*724ba675SRob Herring	status = "disabled";
71*724ba675SRob Herring};
72*724ba675SRob Herring
73*724ba675SRob Herring&can0 {
74*724ba675SRob Herring	pinctrl-0 = <&can0_pins>;
75*724ba675SRob Herring	pinctrl-names = "default";
76*724ba675SRob Herring	status = "okay";
77*724ba675SRob Herring};
78*724ba675SRob Herring
79*724ba675SRob Herring&ether {
80*724ba675SRob Herring	pinctrl-0 = <&ether_pins>;
81*724ba675SRob Herring	pinctrl-names = "default";
82*724ba675SRob Herring
83*724ba675SRob Herring	phy-handle = <&phy1>;
84*724ba675SRob Herring	renesas,ether-link-active-low;
85*724ba675SRob Herring	status = "okay";
86*724ba675SRob Herring
87*724ba675SRob Herring	phy1: ethernet-phy@1 {
88*724ba675SRob Herring		compatible = "ethernet-phy-id0022.1560",
89*724ba675SRob Herring			     "ethernet-phy-ieee802.3-c22";
90*724ba675SRob Herring		reg = <1>;
91*724ba675SRob Herring		micrel,led-mode = <1>;
92*724ba675SRob Herring	};
93*724ba675SRob Herring};
94*724ba675SRob Herring
95*724ba675SRob Herring&gpio0 {
96*724ba675SRob Herring	/* Disable hogging GP0_18 to output LOW */
97*724ba675SRob Herring	/delete-node/ qspi-en-hog;
98*724ba675SRob Herring
99*724ba675SRob Herring	/* Hog GP0_18 to output HIGH to enable VIN2 */
100*724ba675SRob Herring	vin2-en-hog {
101*724ba675SRob Herring		gpio-hog;
102*724ba675SRob Herring		gpios = <18 GPIO_ACTIVE_HIGH>;
103*724ba675SRob Herring		output-high;
104*724ba675SRob Herring		line-name = "VIN2_EN";
105*724ba675SRob Herring	};
106*724ba675SRob Herring};
107*724ba675SRob Herring
108*724ba675SRob Herring&hscif0 {
109*724ba675SRob Herring	pinctrl-0 = <&hscif0_pins>;
110*724ba675SRob Herring	pinctrl-names = "default";
111*724ba675SRob Herring	uart-has-rtscts;
112*724ba675SRob Herring	status = "okay";
113*724ba675SRob Herring};
114*724ba675SRob Herring
115*724ba675SRob Herring&i2c1 {
116*724ba675SRob Herring	pinctrl-0 = <&i2c1_pins>;
117*724ba675SRob Herring	pinctrl-names = "default";
118*724ba675SRob Herring
119*724ba675SRob Herring	/* status set to "okay" when needed by camera configuration below */
120*724ba675SRob Herring	clock-frequency = <400000>;
121*724ba675SRob Herring};
122*724ba675SRob Herring
123*724ba675SRob Herring&i2c3 {
124*724ba675SRob Herring	pinctrl-0 = <&i2c3_pins>;
125*724ba675SRob Herring	pinctrl-names = "default";
126*724ba675SRob Herring
127*724ba675SRob Herring	/* status set to "okay" when needed by camera configuration below */
128*724ba675SRob Herring	clock-frequency = <400000>;
129*724ba675SRob Herring};
130*724ba675SRob Herring
131*724ba675SRob Herring&pfc {
132*724ba675SRob Herring	can0_pins: can0 {
133*724ba675SRob Herring		groups = "can0_data_d";
134*724ba675SRob Herring		function = "can0";
135*724ba675SRob Herring	};
136*724ba675SRob Herring
137*724ba675SRob Herring	ether_pins: ether {
138*724ba675SRob Herring		groups = "eth_mdio", "eth_rmii";
139*724ba675SRob Herring		function = "eth";
140*724ba675SRob Herring	};
141*724ba675SRob Herring
142*724ba675SRob Herring	hscif0_pins: hscif0 {
143*724ba675SRob Herring		groups = "hscif0_data", "hscif0_ctrl";
144*724ba675SRob Herring		function = "hscif0";
145*724ba675SRob Herring	};
146*724ba675SRob Herring
147*724ba675SRob Herring	i2c1_pins: i2c1 {
148*724ba675SRob Herring		groups = "i2c1_c";
149*724ba675SRob Herring		function = "i2c1";
150*724ba675SRob Herring	};
151*724ba675SRob Herring
152*724ba675SRob Herring	i2c3_pins: i2c3 {
153*724ba675SRob Herring		groups = "i2c3";
154*724ba675SRob Herring		function = "i2c3";
155*724ba675SRob Herring	};
156*724ba675SRob Herring
157*724ba675SRob Herring	scif0_pins: scif0 {
158*724ba675SRob Herring		groups = "scif0_data";
159*724ba675SRob Herring		function = "scif0";
160*724ba675SRob Herring	};
161*724ba675SRob Herring
162*724ba675SRob Herring	scif1_pins: scif1 {
163*724ba675SRob Herring		groups = "scif1_data";
164*724ba675SRob Herring		function = "scif1";
165*724ba675SRob Herring	};
166*724ba675SRob Herring
167*724ba675SRob Herring	scifb1_pins: scifb1 {
168*724ba675SRob Herring		groups = "scifb1_data";
169*724ba675SRob Herring		function = "scifb1";
170*724ba675SRob Herring	};
171*724ba675SRob Herring
172*724ba675SRob Herring	vin0_8bit_pins: vin0 {
173*724ba675SRob Herring		groups = "vin0_data8", "vin0_clk", "vin0_sync";
174*724ba675SRob Herring		function = "vin0";
175*724ba675SRob Herring	};
176*724ba675SRob Herring
177*724ba675SRob Herring	vin1_8bit_pins: vin1 {
178*724ba675SRob Herring		groups = "vin1_data8_b", "vin1_clk_b", "vin1_sync_b";
179*724ba675SRob Herring		function = "vin1";
180*724ba675SRob Herring	};
181*724ba675SRob Herring
182*724ba675SRob Herring	vin2_pins: vin2 {
183*724ba675SRob Herring		groups = "vin2_g8", "vin2_clk";
184*724ba675SRob Herring		function = "vin2";
185*724ba675SRob Herring	};
186*724ba675SRob Herring
187*724ba675SRob Herring	vin3_pins: vin3 {
188*724ba675SRob Herring		groups = "vin3_data8", "vin3_clk", "vin3_sync";
189*724ba675SRob Herring		function = "vin3";
190*724ba675SRob Herring	};
191*724ba675SRob Herring};
192*724ba675SRob Herring
193*724ba675SRob Herring&qspi {
194*724ba675SRob Herring	/* Pins shared with VIN2, keep status disabled */
195*724ba675SRob Herring	status = "disabled";
196*724ba675SRob Herring};
197*724ba675SRob Herring
198*724ba675SRob Herring&scif0 {
199*724ba675SRob Herring	pinctrl-0 = <&scif0_pins>;
200*724ba675SRob Herring	pinctrl-names = "default";
201*724ba675SRob Herring	status = "okay";
202*724ba675SRob Herring};
203*724ba675SRob Herring
204*724ba675SRob Herring&scif1 {
205*724ba675SRob Herring	pinctrl-0 = <&scif1_pins>;
206*724ba675SRob Herring	pinctrl-names = "default";
207*724ba675SRob Herring	status = "okay";
208*724ba675SRob Herring};
209*724ba675SRob Herring
210*724ba675SRob Herring&scifb1 {
211*724ba675SRob Herring	pinctrl-0 = <&scifb1_pins>;
212*724ba675SRob Herring	pinctrl-names = "default";
213*724ba675SRob Herring	status = "okay";
214*724ba675SRob Herring
215*724ba675SRob Herring	rts-gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
216*724ba675SRob Herring	cts-gpios = <&gpio4 17 GPIO_ACTIVE_LOW>;
217*724ba675SRob Herring};
218*724ba675SRob Herring
219*724ba675SRob Herring/*
220*724ba675SRob Herring * Below configuration ties VINx endpoints to ov5640/ov7725 camera endpoints
221*724ba675SRob Herring *
222*724ba675SRob Herring * (un)comment the #include statements to change configuration
223*724ba675SRob Herring */
224*724ba675SRob Herring
225*724ba675SRob Herring/* 8bit CMOS Camera 1 (J13) */
226*724ba675SRob Herring#define CAM_PARENT_I2C		i2c0
227*724ba675SRob Herring#define MCLK_CAM		mclk_cam1
228*724ba675SRob Herring#define CAM_EP			cam0ep
229*724ba675SRob Herring#define VIN_EP			vin0ep
230*724ba675SRob Herring#undef CAM_ENABLED
231*724ba675SRob Herring#include "r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi"
232*724ba675SRob Herring//#include "r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi"
233*724ba675SRob Herring
234*724ba675SRob Herring#ifdef CAM_ENABLED
235*724ba675SRob Herring&vin0 {
236*724ba675SRob Herring	/*
237*724ba675SRob Herring	 * Set SW2 switch on the SOM to 'ON'
238*724ba675SRob Herring	 * Set SW1 switch on camera board to 'OFF' as we are using 8bit mode
239*724ba675SRob Herring	 */
240*724ba675SRob Herring	status = "okay";
241*724ba675SRob Herring	pinctrl-0 = <&vin0_8bit_pins>;
242*724ba675SRob Herring	pinctrl-names = "default";
243*724ba675SRob Herring
244*724ba675SRob Herring	port {
245*724ba675SRob Herring		vin0ep: endpoint {
246*724ba675SRob Herring			remote-endpoint = <&cam0ep>;
247*724ba675SRob Herring			bus-width = <8>;
248*724ba675SRob Herring			bus-type = <MEDIA_BUS_TYPE_BT656>;
249*724ba675SRob Herring		};
250*724ba675SRob Herring	};
251*724ba675SRob Herring};
252*724ba675SRob Herring#endif /* CAM_ENABLED */
253*724ba675SRob Herring
254*724ba675SRob Herring#undef CAM_PARENT_I2C
255*724ba675SRob Herring#undef MCLK_CAM
256*724ba675SRob Herring#undef CAM_EP
257*724ba675SRob Herring#undef VIN_EP
258*724ba675SRob Herring
259*724ba675SRob Herring/* 8bit CMOS Camera 2 (J14) */
260*724ba675SRob Herring#define CAM_PARENT_I2C		i2c1
261*724ba675SRob Herring#define MCLK_CAM		mclk_cam2
262*724ba675SRob Herring#define CAM_EP			cam1ep
263*724ba675SRob Herring#define VIN_EP			vin1ep
264*724ba675SRob Herring#undef CAM_ENABLED
265*724ba675SRob Herring#include "r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi"
266*724ba675SRob Herring//#include "r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi"
267*724ba675SRob Herring
268*724ba675SRob Herring#ifdef CAM_ENABLED
269*724ba675SRob Herring&vin1 {
270*724ba675SRob Herring	/* Set SW1 switch on the SOM to 'ON' */
271*724ba675SRob Herring	status = "okay";
272*724ba675SRob Herring	pinctrl-0 = <&vin1_8bit_pins>;
273*724ba675SRob Herring	pinctrl-names = "default";
274*724ba675SRob Herring
275*724ba675SRob Herring	port {
276*724ba675SRob Herring		vin1ep: endpoint {
277*724ba675SRob Herring			remote-endpoint = <&cam1ep>;
278*724ba675SRob Herring			bus-width = <8>;
279*724ba675SRob Herring			bus-type = <MEDIA_BUS_TYPE_BT656>;
280*724ba675SRob Herring		};
281*724ba675SRob Herring	};
282*724ba675SRob Herring};
283*724ba675SRob Herring
284*724ba675SRob Herring#endif /* CAM_ENABLED */
285*724ba675SRob Herring
286*724ba675SRob Herring#undef CAM_PARENT_I2C
287*724ba675SRob Herring#undef MCLK_CAM
288*724ba675SRob Herring#undef CAM_EP
289*724ba675SRob Herring#undef VIN_EP
290*724ba675SRob Herring
291*724ba675SRob Herring/* 8bit CMOS Camera 3 (J12) */
292*724ba675SRob Herring#define CAM_PARENT_I2C		i2c2
293*724ba675SRob Herring#define MCLK_CAM		mclk_cam3
294*724ba675SRob Herring#define CAM_EP			cam2ep
295*724ba675SRob Herring#define VIN_EP			vin2ep
296*724ba675SRob Herring#undef CAM_ENABLED
297*724ba675SRob Herring#include "r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi"
298*724ba675SRob Herring//#include "r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi"
299*724ba675SRob Herring
300*724ba675SRob Herring#ifdef CAM_ENABLED
301*724ba675SRob Herring&vin2 {
302*724ba675SRob Herring	status = "okay";
303*724ba675SRob Herring	pinctrl-0 = <&vin2_pins>;
304*724ba675SRob Herring	pinctrl-names = "default";
305*724ba675SRob Herring
306*724ba675SRob Herring	port {
307*724ba675SRob Herring		vin2ep: endpoint {
308*724ba675SRob Herring			remote-endpoint = <&cam2ep>;
309*724ba675SRob Herring			bus-width = <8>;
310*724ba675SRob Herring			data-shift = <8>;
311*724ba675SRob Herring			bus-type = <MEDIA_BUS_TYPE_BT656>;
312*724ba675SRob Herring		};
313*724ba675SRob Herring	};
314*724ba675SRob Herring};
315*724ba675SRob Herring#endif /* CAM_ENABLED */
316*724ba675SRob Herring
317*724ba675SRob Herring#undef CAM_PARENT_I2C
318*724ba675SRob Herring#undef MCLK_CAM
319*724ba675SRob Herring#undef CAM_EP
320*724ba675SRob Herring#undef VIN_EP
321*724ba675SRob Herring
322*724ba675SRob Herring/* 8bit CMOS Camera 4 (J11) */
323*724ba675SRob Herring#define CAM_PARENT_I2C		i2c3
324*724ba675SRob Herring#define MCLK_CAM		mclk_cam4
325*724ba675SRob Herring#define CAM_EP			cam3ep
326*724ba675SRob Herring#define VIN_EP			vin3ep
327*724ba675SRob Herring#undef CAM_ENABLED
328*724ba675SRob Herring#include "r8a7742-iwg21d-q7-dbcm-ov5640-single.dtsi"
329*724ba675SRob Herring//#include "r8a7742-iwg21d-q7-dbcm-ov7725-single.dtsi"
330*724ba675SRob Herring
331*724ba675SRob Herring#ifdef CAM_ENABLED
332*724ba675SRob Herring&vin3 {
333*724ba675SRob Herring	status = "okay";
334*724ba675SRob Herring	pinctrl-0 = <&vin3_pins>;
335*724ba675SRob Herring	pinctrl-names = "default";
336*724ba675SRob Herring
337*724ba675SRob Herring	port {
338*724ba675SRob Herring		vin3ep: endpoint {
339*724ba675SRob Herring			remote-endpoint = <&cam3ep>;
340*724ba675SRob Herring			bus-width = <8>;
341*724ba675SRob Herring			bus-type = <MEDIA_BUS_TYPE_BT656>;
342*724ba675SRob Herring		};
343*724ba675SRob Herring	};
344*724ba675SRob Herring};
345*724ba675SRob Herring#endif /* CAM_ENABLED */
346*724ba675SRob Herring
347*724ba675SRob Herring#undef CAM_PARENT_I2C
348*724ba675SRob Herring#undef MCLK_CAM
349*724ba675SRob Herring#undef CAM_EP
350*724ba675SRob Herring#undef VIN_EP
351