008af64e8ec10b33e9fb26b61b5c21184109fede
[openwrt/staging/dangole.git] /
1 From c4146a18836381f09b1ea2f4295cb94aa606f67b Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 5 Jul 2018 16:44:39 +0100
4 Subject: [PATCH 343/454] arm: dt: Add DT overlays for ADV7282M, OV5647, and
5 TC358743
6
7 DT overlays to setup the above devices via i2c_arm and csi1.
8 (This currently does not use the i2c-mux-pinctrl driver to
9 dynamically switch the pinctrl)
10
11 tc358743 is tc358743 running at a default link frequency
12 of 972Mbit/s. This allows up to 1080P50 UYVY on 2 lanes.
13 There is a parameter to allow changing the link frequency,
14 but the only values supported by the driver are 297000000
15 for 594Mbit/s, and 486000000 for 972Mbit/s.
16 There is also a parameter to enable 4 lane mode (only
17 relevant to Compute Module (1 or 3) csi1).
18
19 tc358743-audio overlay enables I2S audio from the TC358743
20 to the Pi (SD to GPIO20, SCK to GPIO18, WFS to GPIO19).
21
22 ADV7282M is the Analog Devices analogue video to CSI bridge
23 chip.
24
25 OV5647 is the Pi V1.3 camera module. Currently the driver only
26 supports VGA 8bit Bayer and very few controls.
27
28 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
29 ---
30 arch/arm/boot/dts/overlays/Makefile | 4 +
31 arch/arm/boot/dts/overlays/README | 51 ++++++++
32 .../boot/dts/overlays/adv7282m-overlay.dts | 75 ++++++++++++
33 arch/arm/boot/dts/overlays/ov5647-overlay.dts | 86 ++++++++++++++
34 .../dts/overlays/tc358743-audio-overlay.dts | 51 ++++++++
35 .../boot/dts/overlays/tc358743-overlay.dts | 111 ++++++++++++++++++
36 6 files changed, 378 insertions(+)
37 create mode 100644 arch/arm/boot/dts/overlays/adv7282m-overlay.dts
38 create mode 100644 arch/arm/boot/dts/overlays/ov5647-overlay.dts
39 create mode 100644 arch/arm/boot/dts/overlays/tc358743-audio-overlay.dts
40 create mode 100644 arch/arm/boot/dts/overlays/tc358743-overlay.dts
41
42 --- a/arch/arm/boot/dts/overlays/Makefile
43 +++ b/arch/arm/boot/dts/overlays/Makefile
44 @@ -6,6 +6,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
45 ads1015.dtbo \
46 ads1115.dtbo \
47 ads7846.dtbo \
48 + adv7282m.dtbo \
49 akkordion-iqdacplus.dtbo \
50 allo-boss-dac-pcm512x-audio.dtbo \
51 allo-digione.dtbo \
52 @@ -77,6 +78,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
53 mmc.dtbo \
54 mpu6050.dtbo \
55 mz61581.dtbo \
56 + ov5647.dtbo \
57 papirus.dtbo \
58 pi3-act-led.dtbo \
59 pi3-disable-bt.dtbo \
60 @@ -127,6 +129,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
61 spi2-3cs.dtbo \
62 superaudioboard.dtbo \
63 sx150x.dtbo \
64 + tc358743.dtbo \
65 + tc358743-audio.dtbo \
66 tinylcd35.dtbo \
67 uart0.dtbo \
68 uart1.dtbo \
69 --- a/arch/arm/boot/dts/overlays/README
70 +++ b/arch/arm/boot/dts/overlays/README
71 @@ -267,6 +267,15 @@ Params: cs SPI bus
72 www.kernel.org/doc/Documentation/devicetree/bindings/input/ads7846.txt
73
74
75 +Name: adv7282m
76 +Info: Analog Devices ADV7282M analogue video to CSI2 bridge.
77 + Uses Unicam1, which is the standard camera connector on most Pi
78 + variants.
79 +Load: dtoverlay=adv7282m,<param>=<val>
80 +Params: i2c_pins_28_29 Use pins 28&29 for the I2C instead of 44&45.
81 + This is required for Pi B+, 2, 0, and 0W.
82 +
83 +
84 Name: akkordion-iqdacplus
85 Info: Configures the Digital Dreamtime Akkordion Music Player (based on the
86 OEM IQAudIO DAC+ or DAC Zero module).
87 @@ -1232,6 +1241,23 @@ Params: speed Display
88 xohms Touchpanel sensitivity (X-plate resistance)
89
90
91 +Name: ov5647
92 +Info: Omnivision OV5647 camera module.
93 + Uses Unicam 1, which is the standard camera connector on most Pi
94 + variants.
95 +Load: dtoverlay=ov5647,<param>=<val>
96 +Params: cam0-pwdn GPIO used to control the sensor powerdown line.
97 +
98 + cam0-led GPIO used to control the sensor led
99 + Both these fields should be automatically filled
100 + in by the firmware to reflect the default GPIO
101 + configuration of the particular Pi variant in
102 + use.
103 +
104 + i2c_pins_28_29 Use pins 28&29 for the I2C instead of 44&45.
105 + This is required for Pi B+, 2, 0, and 0W.
106 +
107 +
108 Name: papirus
109 Info: PaPiRus ePaper Screen by Pi Supply (both HAT and pHAT)
110 Load: dtoverlay=papirus,<param>=<val>
111 @@ -1828,6 +1854,31 @@ Params: sx150<x>-<n>-<m> Enables
112 connected.
113
114
115 +Name: tc358743
116 +Info: Toshiba TC358743 HDMI to CSI-2 bridge chip.
117 + Uses Unicam 1, which is the standard camera connector on most Pi
118 + variants.
119 +Load: dtoverlay=tc358743,<param>=<val>
120 +Params: 4lane Use 4 lanes (only applicable to Compute Modules
121 + CAM1 connector).
122 +
123 + link-frequency Set the link frequency. Only values of 297000000
124 + (574Mbit/s) and 486000000 (972Mbit/s - default)
125 + are supported by the driver.
126 +
127 + i2c_pins_28_29 Use pins 28&29 for the I2C instead of 44&45.
128 + This is required for Pi B+, 2, 0, and 0W.
129 +
130 +
131 +Name: tc358743-audio
132 +Info: Used in combination with the tc358743-fast overlay to route the audio
133 + from the TC358743 over I2S to the Pi.
134 + Wiring is LRCK/WFS to GPIO 19, BCK/SCK to GPIO 18, and DATA/SD to GPIO
135 + 20.
136 +Load: dtoverlay=tc358743-audio,<param>=<val>
137 +Params: card-name Override the default, "tc358743", card name.
138 +
139 +
140 Name: tinylcd35
141 Info: 3.5" Color TFT Display by www.tinylcd.com
142 Options: Touch, RTC, keypad
143 --- /dev/null
144 +++ b/arch/arm/boot/dts/overlays/adv7282m-overlay.dts
145 @@ -0,0 +1,75 @@
146 +// Definitions for Analog Devices ADV7282-M video to CSI2 bridge on VC I2C bus
147 +/dts-v1/;
148 +/plugin/;
149 +
150 +/{
151 + compatible = "brcm,bcm2708";
152 +
153 + fragment@0 {
154 + target = <&i2c_vc>;
155 + __overlay__ {
156 + #address-cells = <1>;
157 + #size-cells = <0>;
158 + status = "okay";
159 +
160 + adv7282: adv7282@21 {
161 + compatible = "adi,adv7282-m";
162 + reg = <0x21>;
163 + status = "okay";
164 + clock-frequency = <24000000>;
165 + port {
166 + adv7282_0: endpoint {
167 + remote-endpoint = <&csi1_ep>;
168 + clock-lanes = <0>;
169 + data-lanes = <1>;
170 + link-frequencies =
171 + /bits/ 64 <297000000>;
172 +
173 + mclk-frequency = <12000000>;
174 + };
175 + };
176 + };
177 + };
178 + };
179 + fragment@1 {
180 + target = <&csi1>;
181 + __overlay__ {
182 + #address-cells = <1>;
183 + #size-cells = <0>;
184 + status = "okay";
185 +
186 + port {
187 + #address-cells = <1>;
188 + #size-cells = <0>;
189 + csi1_ep: endpoint {
190 + remote-endpoint = <&adv7282_0>;
191 + };
192 + };
193 + };
194 + };
195 + fragment@2 {
196 + target = <&i2c0_pins>;
197 + __dormant__ {
198 + brcm,pins = <28 29>;
199 + brcm,function = <4>; /* alt0 */
200 + };
201 +
202 + };
203 + fragment@3 {
204 + target = <&i2c0_pins>;
205 + __overlay__ {
206 + brcm,pins = <44 45>;
207 + brcm,function = <5>; /* alt1 */
208 + };
209 + };
210 + fragment@4 {
211 + target = <&i2c_vc>;
212 + __overlay__ {
213 + status = "okay";
214 + };
215 + };
216 +
217 + __overrides__ {
218 + i2c_pins_28_29 = <0>,"+2-3";
219 + };
220 +};
221 --- /dev/null
222 +++ b/arch/arm/boot/dts/overlays/ov5647-overlay.dts
223 @@ -0,0 +1,86 @@
224 +// Definitions for OV5647 camera module on VC I2C bus
225 +/dts-v1/;
226 +/plugin/;
227 +
228 +/{
229 + compatible = "brcm,bcm2708";
230 +
231 + fragment@0 {
232 + target = <&i2c_vc>;
233 + __overlay__ {
234 + #address-cells = <1>;
235 + #size-cells = <0>;
236 + status = "okay";
237 +
238 + ov5647: ov5647@36 {
239 + compatible = "ov5647";
240 + reg = <0x36>;
241 + status = "okay";
242 +
243 + pwdn-gpios = <&gpio 41 1>, <&gpio 32 1>;
244 + clocks = <&ov5647_clk>;
245 +
246 + ov5647_clk: camera-clk {
247 + compatible = "fixed-clock";
248 + #clock-cells = <0>;
249 + clock-frequency = <25000000>;
250 + };
251 +
252 + port {
253 + ov5647_0: endpoint {
254 + remote-endpoint = <&csi1_ep>;
255 + clock-lanes = <0>;
256 + data-lanes = <1 2>;
257 + clock-noncontinuous;
258 + link-frequencies =
259 + /bits/ 64 <297000000>;
260 + };
261 + };
262 + };
263 + };
264 + };
265 +
266 + fragment@1 {
267 + target = <&csi1>;
268 + __overlay__ {
269 + #address-cells = <1>;
270 + #size-cells = <0>;
271 + status = "okay";
272 +
273 + port {
274 + #address-cells = <1>;
275 + #size-cells = <0>;
276 + csi1_ep: endpoint {
277 + remote-endpoint = <&ov5647_0>;
278 + };
279 + };
280 + };
281 + };
282 +
283 + fragment@2 {
284 + target = <&i2c0_pins>;
285 + __dormant__ {
286 + brcm,pins = <28 29>;
287 + brcm,function = <4>; /* alt0 */
288 + };
289 + };
290 + fragment@3 {
291 + target = <&i2c0_pins>;
292 + __overlay__ {
293 + brcm,pins = <44 45>;
294 + brcm,function = <5>; /* alt1 */
295 + };
296 + };
297 + fragment@4 {
298 + target = <&i2c_vc>;
299 + __overlay__ {
300 + status = "okay";
301 + };
302 + };
303 +
304 + __overrides__ {
305 + i2c_pins_28_29 = <0>,"+4-5";
306 + cam0-pwdn = <&ov5647>,"pwdn-gpios:4";
307 + cam0-led = <&ov5647>,"pwdn-gpios:16";
308 + };
309 +};
310 --- /dev/null
311 +++ b/arch/arm/boot/dts/overlays/tc358743-audio-overlay.dts
312 @@ -0,0 +1,51 @@
313 +// Definitions to add I2S audio from the Toshiba TC358743 HDMI to CSI2 bridge.
314 +// Requires tc358743 overlay to have been loaded to actually function.
315 +/dts-v1/;
316 +/plugin/;
317 +
318 +/ {
319 + compatible = "brcm,bcm2708";
320 +
321 + fragment@0 {
322 + target = <&i2s>;
323 + __overlay__ {
324 + status = "okay";
325 + };
326 + };
327 +
328 + fragment@1 {
329 + target-path = "/";
330 + __overlay__ {
331 + tc358743_codec: tc358743-codec {
332 + #sound-dai-cells = <0>;
333 + compatible = "linux,spdif-dir";
334 + status = "okay";
335 + };
336 + };
337 + };
338 +
339 + fragment@2 {
340 + target = <&sound>;
341 + sound_overlay: __overlay__ {
342 + compatible = "simple-audio-card";
343 + simple-audio-card,format = "i2s";
344 + simple-audio-card,name = "tc358743";
345 + simple-audio-card,bitclock-master = <&dailink0_slave>;
346 + simple-audio-card,frame-master = <&dailink0_slave>;
347 + status = "okay";
348 +
349 + simple-audio-card,cpu {
350 + sound-dai = <&i2s>;
351 + dai-tdm-slot-num = <2>;
352 + dai-tdm-slot-width = <32>;
353 + };
354 + dailink0_slave: simple-audio-card,codec {
355 + sound-dai = <&tc358743_codec>;
356 + };
357 + };
358 + };
359 +
360 + __overrides__ {
361 + card-name = <&sound_overlay>,"simple-audio-card,name";
362 + };
363 +};
364 --- /dev/null
365 +++ b/arch/arm/boot/dts/overlays/tc358743-overlay.dts
366 @@ -0,0 +1,111 @@
367 +// Definitions for Toshiba TC358743 HDMI to CSI2 bridge on VC I2C bus
368 +/dts-v1/;
369 +/plugin/;
370 +
371 +/{
372 + compatible = "brcm,bcm2708";
373 +
374 + fragment@0 {
375 + target = <&i2c_vc>;
376 + __overlay__ {
377 + #address-cells = <1>;
378 + #size-cells = <0>;
379 + status = "okay";
380 +
381 + tc358743@0f {
382 + compatible = "toshiba,tc358743";
383 + reg = <0x0f>;
384 + status = "okay";
385 +
386 + clocks = <&tc358743_clk>;
387 + clock-names = "refclk";
388 +
389 + tc358743_clk: bridge-clk {
390 + compatible = "fixed-clock";
391 + #clock-cells = <0>;
392 + clock-frequency = <27000000>;
393 + };
394 +
395 + port {
396 + tc358743: endpoint {
397 + remote-endpoint = <&csi1_ep>;
398 + clock-lanes = <0>;
399 + clock-noncontinuous;
400 + link-frequencies =
401 + /bits/ 64 <486000000>;
402 + };
403 + };
404 + };
405 + };
406 + };
407 +
408 + fragment@1 {
409 + target = <&csi1>;
410 + __overlay__ {
411 + #address-cells = <1>;
412 + #size-cells = <0>;
413 + status = "okay";
414 +
415 + port {
416 + #address-cells = <1>;
417 + #size-cells = <0>;
418 + csi1_ep: endpoint {
419 + remote-endpoint = <&tc358743>;
420 + };
421 + };
422 + };
423 + };
424 +
425 + fragment@2 {
426 + target = <&i2c_vc>;
427 + __overlay__ {
428 + tc358743@0f {
429 + port {
430 + endpoint {
431 + data-lanes = <1 2>;
432 + };
433 + };
434 + };
435 + };
436 + };
437 +
438 + fragment@3 {
439 + target = <&i2c_vc>;
440 + __dormant__ {
441 + tc358743@0f {
442 + port {
443 + endpoint {
444 + data-lanes = <1 2 3 4>;
445 + };
446 + };
447 + };
448 + };
449 + };
450 +
451 + fragment@4 {
452 + target = <&i2c0_pins>;
453 + __dormant__ {
454 + brcm,pins = <28 29>;
455 + brcm,function = <4>; /* alt0 */
456 + };
457 + };
458 + fragment@5 {
459 + target = <&i2c0_pins>;
460 + __overlay__ {
461 + brcm,pins = <44 45>;
462 + brcm,function = <5>; /* alt1 */
463 + };
464 + };
465 + fragment@6 {
466 + target = <&i2c_vc>;
467 + __overlay__ {
468 + status = "okay";
469 + };
470 + };
471 +
472 + __overrides__ {
473 + i2c_pins_28_29 = <0>,"+4-5";
474 + 4lane = <0>, "-2+3";
475 + link-frequency = <&tc358743>,"link-frequencies#0";
476 + };
477 +};