a5f0c76dd175856ecde45758d8c701a38fb7f94c
[oweals/openwrt.git] /
1 From c3ea5332de058ee7b9139133f2f8103b6dff2478 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 31 Oct 2018 15:01:59 +0000
4 Subject: [PATCH] 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    |  76 ++++++++++++
33  arch/arm/boot/dts/overlays/ov5647-overlay.dts |  87 ++++++++++++++
34  .../dts/overlays/tc358743-audio-overlay.dts   |  52 ++++++++
35  .../boot/dts/overlays/tc358743-overlay.dts    | 112 ++++++++++++++++++
36  6 files changed, 382 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 @@ -81,6 +82,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 @@ -132,6 +134,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 @@ -1284,6 +1293,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 @@ -1893,6 +1919,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,76 @@
146 +// SPDX-License-Identifier: GPL-2.0-only
147 +// Definitions for Analog Devices ADV7282-M video to CSI2 bridge on VC I2C bus
148 +/dts-v1/;
149 +/plugin/;
150 +
151 +/{
152 +       compatible = "brcm,bcm2708";
153 +
154 +       fragment@0 {
155 +               target = <&i2c_vc>;
156 +               __overlay__ {
157 +                       #address-cells = <1>;
158 +                       #size-cells = <0>;
159 +                       status = "okay";
160 +
161 +                       adv7282: adv7282@21 {
162 +                               compatible = "adi,adv7282-m";
163 +                               reg = <0x21>;
164 +                               status = "okay";
165 +                               clock-frequency = <24000000>;
166 +                               port {
167 +                                       adv7282_0: endpoint {
168 +                                               remote-endpoint = <&csi1_ep>;
169 +                                               clock-lanes = <0>;
170 +                                               data-lanes = <1>;
171 +                                               link-frequencies =
172 +                                                       /bits/ 64 <297000000>;
173 +
174 +                                               mclk-frequency = <12000000>;
175 +                                       };
176 +                               };
177 +                       };
178 +               };
179 +       };
180 +       fragment@1 {
181 +               target = <&csi1>;
182 +               __overlay__ {
183 +                       #address-cells = <1>;
184 +                       #size-cells = <0>;
185 +                       status = "okay";
186 +
187 +                       port {
188 +                               #address-cells = <1>;
189 +                               #size-cells = <0>;
190 +                               csi1_ep: endpoint {
191 +                                       remote-endpoint = <&adv7282_0>;
192 +                               };
193 +                       };
194 +               };
195 +       };
196 +       fragment@2 {
197 +               target = <&i2c0_pins>;
198 +               __dormant__ {
199 +                       brcm,pins = <28 29>;
200 +                       brcm,function = <4>; /* alt0 */
201 +               };
202 +
203 +       };
204 +       fragment@3 {
205 +               target = <&i2c0_pins>;
206 +               __overlay__ {
207 +                       brcm,pins = <44 45>;
208 +                       brcm,function = <5>; /* alt1 */
209 +               };
210 +       };
211 +       fragment@4 {
212 +               target = <&i2c_vc>;
213 +               __overlay__ {
214 +                       status = "okay";
215 +               };
216 +       };
217 +
218 +       __overrides__ {
219 +               i2c_pins_28_29 = <0>,"+2-3";
220 +       };
221 +};
222 --- /dev/null
223 +++ b/arch/arm/boot/dts/overlays/ov5647-overlay.dts
224 @@ -0,0 +1,87 @@
225 +// SPDX-License-Identifier: GPL-2.0-only
226 +// Definitions for OV5647 camera module on VC I2C bus
227 +/dts-v1/;
228 +/plugin/;
229 +
230 +/{
231 +       compatible = "brcm,bcm2708";
232 +
233 +       fragment@0 {
234 +               target = <&i2c_vc>;
235 +               __overlay__ {
236 +                       #address-cells = <1>;
237 +                       #size-cells = <0>;
238 +                       status = "okay";
239 +
240 +                       ov5647: ov5647@36 {
241 +                               compatible = "ov5647";
242 +                               reg = <0x36>;
243 +                               status = "okay";
244 +
245 +                               pwdn-gpios = <&gpio 41 1>, <&gpio 32 1>;
246 +                               clocks = <&ov5647_clk>;
247 +
248 +                               ov5647_clk: camera-clk {
249 +                                       compatible = "fixed-clock";
250 +                                       #clock-cells = <0>;
251 +                                       clock-frequency = <25000000>;
252 +                               };
253 +
254 +                               port {
255 +                                       ov5647_0: endpoint {
256 +                                               remote-endpoint = <&csi1_ep>;
257 +                                               clock-lanes = <0>;
258 +                                               data-lanes = <1 2>;
259 +                                               clock-noncontinuous;
260 +                                               link-frequencies =
261 +                                                       /bits/ 64 <297000000>;
262 +                                       };
263 +                               };
264 +                       };
265 +               };
266 +       };
267 +
268 +       fragment@1 {
269 +               target = <&csi1>;
270 +               __overlay__ {
271 +                       #address-cells = <1>;
272 +                       #size-cells = <0>;
273 +                       status = "okay";
274 +
275 +                       port {
276 +                               #address-cells = <1>;
277 +                               #size-cells = <0>;
278 +                               csi1_ep: endpoint {
279 +                                       remote-endpoint = <&ov5647_0>;
280 +                               };
281 +                       };
282 +               };
283 +       };
284 +
285 +       fragment@2 {
286 +               target = <&i2c0_pins>;
287 +               __dormant__ {
288 +                       brcm,pins = <28 29>;
289 +                       brcm,function = <4>; /* alt0 */
290 +               };
291 +       };
292 +       fragment@3 {
293 +               target = <&i2c0_pins>;
294 +               __overlay__ {
295 +                       brcm,pins = <44 45>;
296 +                       brcm,function = <5>; /* alt1 */
297 +               };
298 +       };
299 +       fragment@4 {
300 +               target = <&i2c_vc>;
301 +               __overlay__ {
302 +                       status = "okay";
303 +               };
304 +       };
305 +
306 +       __overrides__ {
307 +               i2c_pins_28_29 = <0>,"+4-5";
308 +               cam0-pwdn = <&ov5647>,"pwdn-gpios:4";
309 +               cam0-led = <&ov5647>,"pwdn-gpios:16";
310 +       };
311 +};
312 --- /dev/null
313 +++ b/arch/arm/boot/dts/overlays/tc358743-audio-overlay.dts
314 @@ -0,0 +1,52 @@
315 +// SPDX-License-Identifier: GPL-2.0-only
316 +// Definitions to add I2S audio from the Toshiba TC358743 HDMI to CSI2 bridge.
317 +// Requires tc358743 overlay to have been loaded to actually function.
318 +/dts-v1/;
319 +/plugin/;
320 +
321 +/ {
322 +       compatible = "brcm,bcm2708";
323 +
324 +       fragment@0 {
325 +               target = <&i2s>;
326 +               __overlay__ {
327 +                       status = "okay";
328 +               };
329 +       };
330 +
331 +       fragment@1 {
332 +               target-path = "/";
333 +               __overlay__ {
334 +                       tc358743_codec: tc358743-codec {
335 +                               #sound-dai-cells = <0>;
336 +                               compatible = "linux,spdif-dir";
337 +                               status = "okay";
338 +                       };
339 +               };
340 +       };
341 +
342 +       fragment@2 {
343 +               target = <&sound>;
344 +               sound_overlay: __overlay__ {
345 +                       compatible = "simple-audio-card";
346 +                       simple-audio-card,format = "i2s";
347 +                       simple-audio-card,name = "tc358743";
348 +                       simple-audio-card,bitclock-master = <&dailink0_slave>;
349 +                       simple-audio-card,frame-master = <&dailink0_slave>;
350 +                       status = "okay";
351 +
352 +                       simple-audio-card,cpu {
353 +                               sound-dai = <&i2s>;
354 +                               dai-tdm-slot-num = <2>;
355 +                               dai-tdm-slot-width = <32>;
356 +                       };
357 +                       dailink0_slave: simple-audio-card,codec {
358 +                               sound-dai = <&tc358743_codec>;
359 +                       };
360 +               };
361 +       };
362 +
363 +       __overrides__ {
364 +               card-name = <&sound_overlay>,"simple-audio-card,name";
365 +       };
366 +};
367 --- /dev/null
368 +++ b/arch/arm/boot/dts/overlays/tc358743-overlay.dts
369 @@ -0,0 +1,112 @@
370 +// SPDX-License-Identifier: GPL-2.0-only
371 +// Definitions for Toshiba TC358743 HDMI to CSI2 bridge on VC I2C bus
372 +/dts-v1/;
373 +/plugin/;
374 +
375 +/{
376 +       compatible = "brcm,bcm2708";
377 +
378 +       fragment@0 {
379 +               target = <&i2c_vc>;
380 +               __overlay__ {
381 +                       #address-cells = <1>;
382 +                       #size-cells = <0>;
383 +                       status = "okay";
384 +
385 +                       tc358743@0f {
386 +                               compatible = "toshiba,tc358743";
387 +                               reg = <0x0f>;
388 +                               status = "okay";
389 +
390 +                               clocks = <&tc358743_clk>;
391 +                               clock-names = "refclk";
392 +
393 +                               tc358743_clk: bridge-clk {
394 +                                       compatible = "fixed-clock";
395 +                                       #clock-cells = <0>;
396 +                                       clock-frequency = <27000000>;
397 +                               };
398 +
399 +                               port {
400 +                                       tc358743: endpoint {
401 +                                               remote-endpoint = <&csi1_ep>;
402 +                                               clock-lanes = <0>;
403 +                                               clock-noncontinuous;
404 +                                               link-frequencies =
405 +                                                       /bits/ 64 <486000000>;
406 +                                       };
407 +                               };
408 +                       };
409 +               };
410 +       };
411 +
412 +       fragment@1 {
413 +               target = <&csi1>;
414 +               __overlay__ {
415 +                       #address-cells = <1>;
416 +                       #size-cells = <0>;
417 +                       status = "okay";
418 +
419 +                       port {
420 +                               #address-cells = <1>;
421 +                               #size-cells = <0>;
422 +                               csi1_ep: endpoint {
423 +                                       remote-endpoint = <&tc358743>;
424 +                               };
425 +                       };
426 +               };
427 +       };
428 +
429 +       fragment@2 {
430 +               target = <&i2c_vc>;
431 +               __overlay__ {
432 +                       tc358743@0f {
433 +                               port {
434 +                                       endpoint {
435 +                                               data-lanes = <1 2>;
436 +                                       };
437 +                               };
438 +                       };
439 +               };
440 +       };
441 +
442 +       fragment@3 {
443 +               target = <&i2c_vc>;
444 +               __dormant__ {
445 +                       tc358743@0f {
446 +                               port {
447 +                                       endpoint {
448 +                                               data-lanes = <1 2 3 4>;
449 +                                       };
450 +                               };
451 +                       };
452 +               };
453 +       };
454 +
455 +       fragment@4 {
456 +               target = <&i2c0_pins>;
457 +               __dormant__ {
458 +                       brcm,pins = <28 29>;
459 +                       brcm,function = <4>; /* alt0 */
460 +               };
461 +       };
462 +       fragment@5 {
463 +               target = <&i2c0_pins>;
464 +               __overlay__ {
465 +                       brcm,pins = <44 45>;
466 +                       brcm,function = <5>; /* alt1 */
467 +               };
468 +       };
469 +       fragment@6 {
470 +               target = <&i2c_vc>;
471 +               __overlay__ {
472 +                       status = "okay";
473 +               };
474 +       };
475 +
476 +       __overrides__ {
477 +               i2c_pins_28_29 = <0>,"+4-5";
478 +               4lane = <0>, "-2+3";
479 +               link-frequency = <&tc358743>,"link-frequencies#0";
480 +       };
481 +};