xref: /OK3568_Linux_fs/kernel/arch/arm64/boot/dts/rockchip/rk3588-vehicle-maxim-cameras-s66.dtsi (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2023 Rockchip Electronics Co., Ltd.
4 *
5 */
6
7/ {
8	max96712_osc: max96712-oscillator {
9		compatible = "fixed-clock";
10		#clock-cells = <1>;
11		clock-frequency = <25000000>;
12		clock-output-names = "max96712-osc";
13	};
14
15	max96722_osc: max96722-oscillator {
16		compatible = "fixed-clock";
17		#clock-cells = <1>;
18		clock-frequency = <25000000>;
19		clock-output-names = "max96722-osc";
20	};
21};
22
23/**
24 * ============================================================================
25 * Inno DPHY0: full mode
26 * ============================================================================
27 */
28&csi2_dphy0_hw {
29	status = "okay";
30};
31
32&csi2_dphy0 {
33	status = "okay";
34
35	ports {
36		#address-cells = <1>;
37		#size-cells = <0>;
38
39		port@0 {
40			reg = <0>;
41			#address-cells = <1>;
42			#size-cells = <0>;
43
44			mipi_dphy0_in_max96712: endpoint@1 {
45				reg = <1>;
46				remote-endpoint = <&max96712_out>;
47				data-lanes = <1 2 3 4>;
48			};
49		};
50		port@1 {
51			reg = <1>;
52			#address-cells = <1>;
53			#size-cells = <0>;
54
55			csidphy0_out: endpoint@0 {
56				reg = <0>;
57				remote-endpoint = <&mipi2_csi2_input>;
58			};
59		};
60	};
61};
62
63&mipi2_csi2 {
64	status = "okay";
65
66	ports {
67		#address-cells = <1>;
68		#size-cells = <0>;
69
70		port@0 {
71			reg = <0>;
72			#address-cells = <1>;
73			#size-cells = <0>;
74
75			mipi2_csi2_input: endpoint@1 {
76				reg = <1>;
77				remote-endpoint = <&csidphy0_out>;
78			};
79		};
80
81		port@1 {
82			reg = <1>;
83			#address-cells = <1>;
84			#size-cells = <0>;
85
86			mipi2_csi2_output: endpoint@0 {
87				reg = <0>;
88				remote-endpoint = <&cif_mipi2_in>;
89			};
90		};
91	};
92};
93
94&rkcif_mipi_lvds2 {
95	status = "okay";
96	/* parameters for do cif reset detecting:
97	 * index0: monitor mode,
98		   0 for idle,
99		   1 for continue,
100		   2 for trigger,
101		   3 for hotplug (for nextchip)
102	 * index1: the frame id to start timer,
103		   min is 2
104	 * index2: frame num of monitoring cycle
105	 * index3: err time for keep monitoring
106		   after finding out err (ms)
107	 * index4: csi2 err reference val for resetting
108	 */
109	rockchip,cif-monitor = <3 2 1 1000 5>;
110
111	port {
112		cif_mipi2_in: endpoint {
113			remote-endpoint = <&mipi2_csi2_output>;
114		};
115	};
116};
117
118/**
119 * ============================================================================
120 * Inno DPHY1: full mode
121 * ============================================================================
122 */
123&csi2_dphy1_hw {
124	status = "okay";
125};
126
127&csi2_dphy3 {
128	status = "okay";
129
130	ports {
131		#address-cells = <1>;
132		#size-cells = <0>;
133
134		port@0 {
135			reg = <0>;
136			#address-cells = <1>;
137			#size-cells = <0>;
138
139			mipi_dphy3_in_max96722: endpoint@1 {
140				reg = <1>;
141				remote-endpoint = <&max96722_out>;
142				data-lanes = <1 2 3 4>;
143			};
144		};
145		port@1 {
146			reg = <1>;
147			#address-cells = <1>;
148			#size-cells = <0>;
149
150			csidphy3_out: endpoint@0 {
151				reg = <0>;
152				remote-endpoint = <&mipi4_csi2_input>;
153			};
154		};
155	};
156};
157
158&mipi4_csi2 {
159	status = "okay";
160
161	ports {
162		#address-cells = <1>;
163		#size-cells = <0>;
164
165		port@0 {
166			reg = <0>;
167			#address-cells = <1>;
168			#size-cells = <0>;
169
170			mipi4_csi2_input: endpoint@1 {
171				reg = <1>;
172				remote-endpoint = <&csidphy3_out>;
173			};
174		};
175
176		port@1 {
177			reg = <1>;
178			#address-cells = <1>;
179			#size-cells = <0>;
180
181			mipi4_csi2_output: endpoint@0 {
182				reg = <0>;
183				remote-endpoint = <&cif_mipi4_in>;
184			};
185		};
186	};
187};
188
189&rkcif_mipi_lvds4 {
190	status = "okay";
191	/* parameters for do cif reset detecting:
192	 * index0: monitor mode,
193		   0 for idle,
194		   1 for continue,
195		   2 for trigger,
196		   3 for hotplug (for nextchip)
197	 * index1: the frame id to start timer,
198		   min is 2
199	 * index2: frame num of monitoring cycle
200	 * index3: err time for keep monitoring
201		   after finding out err (ms)
202	 * index4: csi2 err reference val for resetting
203	 */
204	rockchip,cif-monitor = <3 2 1 1000 5>;
205
206	port {
207		cif_mipi4_in: endpoint {
208			remote-endpoint = <&mipi4_csi2_output>;
209		};
210	};
211};
212
213/**
214 * =============================================================================
215 * Common
216 * =============================================================================
217 */
218&rkcif {
219	status = "okay";
220	rockchip,android-usb-camerahal-enable;
221};
222
223&rkcif_mmu {
224	status = "okay";
225};
226
227&i2c2 {
228	status = "okay";
229	pinctrl-names = "default";
230	pinctrl-0 = <&i2c2m4_xfer>;
231	clock-frequency = <400000>;
232
233	// AVM Camera x4
234	max96712: max96712@29 {
235		compatible = "maxim,max96712";
236		status = "okay";
237		reg = <0x29>;
238		clock-names = "xvclk";
239		clocks = <&max96712_osc 0>;
240		pinctrl-names = "default";
241		pinctrl-0 = <&max96712_power>, <&max96712_errb>, <&max96712_lock>;
242		power-domains = <&power RK3588_PD_VI>;
243		rockchip,grf = <&sys_grf>;
244		power-gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>;
245		lock-gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
246		link-mask = <0x0F>;
247		auto-init-deskew-mask = <0x3>;
248		frame-sync-period = <0>;
249		link-rx-rate = <0>;
250		rockchip,camera-module-index = <0>;
251		rockchip,camera-module-facing = "back";
252		rockchip,camera-module-name = "max96712";
253		rockchip,camera-module-lens-name = "max96712";
254
255		port {
256			max96712_out: endpoint {
257				remote-endpoint = <&mipi_dphy0_in_max96712>;
258				data-lanes = <1 2 3 4>;
259			};
260		};
261	};
262
263	// DMS Camera x1 + OMS Camera x3
264	max96722: max96722@6b {
265		compatible = "maxim,max96722";
266		status = "okay";
267		reg = <0x6b>;
268		clock-names = "xvclk";
269		clocks = <&max96722_osc 0>;
270		pinctrl-names = "default";
271		pinctrl-0 = <&max96722_power>, <&max96722_errb>, <&max96722_lock>;
272		power-domains = <&power RK3588_PD_VI>;
273		rockchip,grf = <&sys_grf>;
274		power-gpios = <&gpio1 RK_PC7 GPIO_ACTIVE_HIGH>;
275		lock-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
276		link-mask = <0x33>;
277		auto-init-deskew-mask = <0x3>;
278		frame-sync-period = <0>;
279		rockchip,camera-module-index = <0>;
280		rockchip,camera-module-facing = "back";
281		rockchip,camera-module-name = "max96722";
282		rockchip,camera-module-lens-name = "max96722";
283
284		port {
285			max96722_out: endpoint {
286				remote-endpoint = <&mipi_dphy3_in_max96722>;
287				data-lanes = <1 2 3 4>;
288			};
289		};
290	};
291};
292
293&pinctrl {
294	maxim-cameras {
295		max96712_power: max96712-power {
296			rockchip,pins = <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
297		};
298
299		max96712_errb: max96712-errb {
300			rockchip,pins = <1 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
301		};
302
303		max96712_lock: max96712-lock {
304			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
305		};
306
307		max96722_power: max96722-power {
308			rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
309		};
310
311		max96722_errb: max96722-errb {
312			rockchip,pins = <1 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>;
313		};
314
315		max96722_lock: max96722-lock {
316			rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>;
317		};
318	};
319};
320