1 From 0bda3692e0fa20e793ad3857a6ffde6bca7d49ca Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 22 Nov 2021 12:44:29 +0000
4 Subject: [PATCH] dtoverlays: Add option to select camera as on CAM0 of
7 Parameterise the overlays so that they can have an optional
8 cam0 parameter to switch to i2c_vc and csi0.
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 arch/arm/boot/dts/bcm2708-rpi-cm.dts | 1 +
13 arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 4 +
14 arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 5 ++
15 arch/arm/boot/dts/bcm2711-rpi-cm4s.dts | 25 +++---
16 arch/arm/boot/dts/overlays/README | 30 +++++++
17 arch/arm/boot/dts/overlays/imx219-overlay.dts | 67 ++++++++-------
18 .../boot/dts/overlays/imx290_327-overlay.dtsi | 27 +++---
19 .../boot/dts/overlays/imx477_378-overlay.dtsi | 84 +++++++++----------
20 arch/arm/boot/dts/overlays/imx519-overlay.dts | 23 +++--
21 .../arm/boot/dts/overlays/irs1125-overlay.dts | 35 ++++----
22 arch/arm/boot/dts/overlays/ov5647-overlay.dts | 33 +++-----
23 arch/arm/boot/dts/overlays/ov7251-overlay.dts | 28 +++----
24 arch/arm/boot/dts/overlays/ov9281-overlay.dts | 29 ++++---
25 .../boot/dts/overlays/tc358743-overlay.dts | 43 ++++------
26 14 files changed, 221 insertions(+), 213 deletions(-)
28 --- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts
29 +++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts
33 gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
34 + status = "disabled";
37 cam0_reg: &cam0_regulator {
38 --- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
39 +++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
41 act_led_gpio = <&act_led>,"gpios:4";
42 act_led_activelow = <&act_led>,"gpios:8";
43 act_led_trigger = <&act_led>,"linux,default-trigger";
44 + cam0_reg = <&cam0_reg>,"status";
45 + cam0_reg_gpio = <&cam0_reg>,"gpios:4";
46 + cam1_reg = <&cam1_reg>,"status";
47 + cam1_reg_gpio = <&cam1_reg>,"gpios:4";
50 --- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts
51 +++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts
55 gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
56 + status = "disabled";
59 cam0_reg: &cam0_regulator {
60 @@ -137,5 +138,9 @@ cam0_reg: &cam0_regulator {
61 act_led_gpio = <&act_led>,"gpios:4";
62 act_led_activelow = <&act_led>,"gpios:8";
63 act_led_trigger = <&act_led>,"linux,default-trigger";
64 + cam0_reg = <&cam0_reg>,"status";
65 + cam0_reg_gpio = <&cam0_reg>,"gpios:4";
66 + cam1_reg = <&cam1_reg>,"status";
67 + cam1_reg_gpio = <&cam1_reg>,"gpios:4";
70 --- a/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts
71 +++ b/arch/arm/boot/dts/bcm2711-rpi-cm4s.dts
73 bootargs = "coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1";
76 - cam1_reg: cam1_reg {
77 - compatible = "regulator-fixed";
78 - regulator-name = "cam1-regulator";
79 - gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
81 - status = "disabled";
83 - cam0_reg: cam0_reg {
84 - compatible = "regulator-fixed";
85 - regulator-name = "cam0-regulator";
86 - gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
88 - status = "disabled";
95 brcm,disable-headphones = <1>;
99 + gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
100 + status = "disabled";
103 +cam0_reg: &cam0_regulator {
104 + gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
105 + status = "disabled";
110 act_led_gpio = <&act_led>,"gpios:4";
111 --- a/arch/arm/boot/dts/overlays/README
112 +++ b/arch/arm/boot/dts/overlays/README
113 @@ -144,6 +144,16 @@ Params:
114 See /sys/kernel/debug/raspberrypi_axi_monitor
117 + cam0_reg Enables CAM 0 regulator. CM1 & 3 only.
119 + cam0_reg_gpio Set GPIO for CAM 0 regulator. Default 30.
122 + cam1_reg Enables CAM 1 regulator. CM1 & 3 only.
124 + cam1_reg_gpio Set GPIO for CAM 1 regulator. Default 2.
127 eee Enable Energy Efficient Ethernet support for
128 compatible devices (default "on"). See also
129 "tx_lpi_timer". Pi3B+ only.
130 @@ -1845,6 +1855,8 @@ Params: rotation Mounting
131 2 = external, default external)
132 media-controller Configure use of Media Controller API for
133 configuring the sensor (default on)
134 + cam0 Adopt the default configuration for CAM0 on a
135 + Compute Module (CSI0, i2c_vc, and cam0_reg).
139 @@ -1867,6 +1879,8 @@ Params: 4lane Enable 4
141 media-controller Configure use of Media Controller API for
142 configuring the sensor (default on)
143 + cam0 Adopt the default configuration for CAM0 on a
144 + Compute Module (CSI0, i2c_vc, and cam0_reg).
148 @@ -1880,6 +1894,8 @@ Params: rotation Mounting
149 2 = external, default external)
150 media-controller Configure use of Media Controller API for
151 configuring the sensor (default on)
152 + cam0 Adopt the default configuration for CAM0 on a
153 + Compute Module (CSI0, i2c_vc, and cam0_reg).
157 @@ -1893,6 +1909,8 @@ Params: rotation Mounting
158 2 = external, default external)
159 media-controller Configure use of Media Controller API for
160 configuring the sensor (default on)
161 + cam0 Adopt the default configuration for CAM0 on a
162 + Compute Module (CSI0, i2c_vc, and cam0_reg).
166 @@ -1906,6 +1924,8 @@ Params: rotation Mounting
167 2 = external, default external)
168 media-controller Configure use of Media Controller API for
169 configuring the sensor (default on)
170 + cam0 Adopt the default configuration for CAM0 on a
171 + Compute Module (CSI0, i2c_vc, and cam0_reg).
175 @@ -1972,6 +1992,8 @@ Info: Infineon irs1125 TOF camera modu
176 Load: dtoverlay=irs1125,<param>=<val>
177 Params: media-controller Configure use of Media Controller API for
178 configuring the sensor (default off)
179 + cam0 Adopt the default configuration for CAM0 on a
180 + Compute Module (CSI0, i2c_vc, and cam0_reg).
184 @@ -2385,6 +2407,8 @@ Params: rotation Mounting
185 2 = external, default external)
186 media-controller Configure use of Media Controller API for
187 configuring the sensor (default on)
188 + cam0 Adopt the default configuration for CAM0 on a
189 + Compute Module (CSI0, i2c_vc, and cam0_reg).
193 @@ -2398,6 +2422,8 @@ Params: rotation Mounting
194 2 = external, default external)
195 media-controller Configure use of Media Controller API for
196 configuring the sensor (default off)
197 + cam0 Adopt the default configuration for CAM0 on a
198 + Compute Module (CSI0, i2c_vc, and cam0_reg).
202 @@ -2411,6 +2437,8 @@ Params: rotation Mounting
203 2 = external, default external)
204 media-controller Configure use of Media Controller API for
205 configuring the sensor (default on)
206 + cam0 Adopt the default configuration for CAM0 on a
207 + Compute Module (CSI0, i2c_vc, and cam0_reg).
211 @@ -3393,6 +3421,8 @@ Params: 4lane Use 4 la
212 are supported by the driver.
213 media-controller Configure use of Media Controller API for
214 configuring the sensor (default off)
215 + cam0 Adopt the default configuration for CAM0 on a
216 + Compute Module (CSI0, i2c_vc, and cam0_reg).
220 --- a/arch/arm/boot/dts/overlays/imx219-overlay.dts
221 +++ b/arch/arm/boot/dts/overlays/imx219-overlay.dts
223 compatible = "brcm,bcm2835";
226 + target = <&i2c0if>;
232 + clk_frag: fragment@1 {
233 + target = <&cam1_clk>;
236 + clock-frequency = <24000000>;
241 + target = <&i2c0mux>;
247 + i2c_frag: fragment@100 {
248 target = <&i2c_csi_dsi>;
250 #address-cells = <1>;
255 - remote-endpoint = <&csi1_ep>;
256 + remote-endpoint = <&csi_ep>;
265 + csi_frag: fragment@101 {
270 + brcm,media-controller;
273 - csi1_ep: endpoint {
275 remote-endpoint = <&imx219_0>;
283 - target = <&i2c0if>;
290 - target = <&cam1_clk>;
293 - clock-frequency = <24000000>;
298 - target = <&i2c0mux>;
307 - brcm,media-controller;
312 rotation = <&imx219>,"rotation:0";
313 orientation = <&imx219>,"orientation:0";
314 - media-controller = <0>,"=5";
315 + media-controller = <&csi>,"brcm,media-controller?";
316 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
317 + <&csi_frag>, "target:0=",<&csi0>,
318 + <&clk_frag>, "target:0=",<&cam0_clk>,
319 + <&imx219>, "clocks:0=",<&cam0_clk>,
320 + <&imx219>, "VANA-supply:0=",<&cam0_reg>;
323 --- a/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi
324 +++ b/arch/arm/boot/dts/overlays/imx290_327-overlay.dtsi
327 compatible = "brcm,bcm2835";
330 + i2c_frag: fragment@0 {
331 target = <&i2c_csi_dsi>;
333 #address-cells = <1>;
339 + csi_frag: fragment@1 {
344 + brcm,media-controller;
353 + clk_frag: fragment@3 {
354 target = <&cam1_clk>;
356 + cam_clk: __overlay__ {
358 clock-frequency = <37125000>;
360 @@ -108,19 +109,17 @@
367 - brcm,media-controller;
372 4lane = <0>, "-6+7-8+9";
373 - clock-frequency = <&cam1_clk>,"clock-frequency:0",
374 + clock-frequency = <&cam_clk>,"clock-frequency:0",
375 <&imx290>,"clock-frequency:0";
376 rotation = <&imx290>,"rotation:0";
377 orientation = <&imx290>,"orientation:0";
378 - media-controller = <0>,"=10";
379 + media-controller = <&csi>,"brcm,media-controller?";
380 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
381 + <&csi_frag>, "target:0=",<&csi0>,
382 + <&clk_frag>, "target:0=",<&cam0_clk>,
383 + <&imx290>, "clocks:0=",<&cam0_clk>,
384 + <&imx290>, "vdda-supply:0=",<&cam0_reg>;
387 --- a/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi
388 +++ b/arch/arm/boot/dts/overlays/imx477_378-overlay.dtsi
391 compatible = "brcm,bcm2835";
395 + target = <&i2c0if>;
401 + clk_frag: fragment@3 {
402 + target = <&cam1_clk>;
403 + cam_clk: __overlay__ {
404 + clock-frequency = <24000000>;
410 + target = <&i2c0mux>;
416 + reg_frag: fragment@5 {
417 + target = <&cam1_reg>;
418 + cam_reg: __overlay__ {
419 + startup-delay-us = <300000>;
423 + i2c_frag: fragment@100 {
424 target = <&i2c_csi_dsi>;
426 #address-cells = <1>;
431 - remote-endpoint = <&csi1_ep>;
432 + remote-endpoint = <&csi_ep>;
441 + csi_frag: fragment@101 {
446 + brcm,media-controller;
449 - csi1_ep: endpoint {
451 remote-endpoint = <&imx477_0>;
459 - target = <&i2c0if>;
466 - target = <&cam1_clk>;
468 - clock-frequency = <24000000>;
474 - target = <&i2c0mux>;
481 - target = <&cam1_reg>;
483 - startup-delay-us = <300000>;
490 - brcm,media-controller;
495 rotation = <&imx477>,"rotation:0";
496 orientation = <&imx477>,"orientation:0";
497 - media-controller = <0>,"=6";
498 + media-controller = <&csi>,"brcm,media-controller?";
499 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
500 + <&csi_frag>, "target:0=",<&csi0>,
501 + <&clk_frag>, "target:0=",<&cam0_clk>,
502 + <®_frag>, "target:0=",<&cam0_reg>,
503 + <&imx477>, "clocks:0=",<&cam0_clk>,
504 + <&imx477>, "vdda-supply:0=",<&cam0_reg>;
507 --- a/arch/arm/boot/dts/overlays/imx519-overlay.dts
508 +++ b/arch/arm/boot/dts/overlays/imx519-overlay.dts
511 compatible = "brcm,bcm2835";
514 + i2c_frag: fragment@0 {
515 target = <&i2c_csi_dsi>;
517 #address-cells = <1>;
523 + csi_frag: fragment@1 {
528 + brcm,media-controller;
537 + clk_frag: fragment@3 {
538 target = <&cam1_clk>;
540 clock-frequency = <24000000>;
548 - brcm,media-controller;
553 rotation = <&imx519>,"rotation:0";
554 orientation = <&imx519>,"orientation:0";
555 - media-controller = <0>,"=6";
556 + media-controller = <&csi>,"brcm,media-controller?";
557 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
558 + <&csi_frag>, "target:0=",<&csi0>,
559 + <&clk_frag>, "target:0=",<&cam0_clk>,
560 + <&imx519>, "clocks:0=",<&cam0_clk>,
561 + <&imx519>, "VANA-supply:0=",<&cam0_reg>;
564 --- a/arch/arm/boot/dts/overlays/irs1125-overlay.dts
565 +++ b/arch/arm/boot/dts/overlays/irs1125-overlay.dts
568 compatible = "brcm,bcm2835";
571 + i2c_frag: fragment@0 {
572 target = <&i2c_csi_dsi>;
574 #address-cells = <1>;
578 - irs1125: irs1125@3D {
579 + irs1125: irs1125@3d {
580 compatible = "infineon,irs1125";
585 pwdn-gpios = <&gpio 5 0>;
586 - clocks = <&irs1125_clk>;
587 + clocks = <&cam1_clk>;
590 irs1125_0: endpoint {
596 + csi_frag: fragment@1 {
609 + clk_frag: fragment@5 {
610 + target = <&cam1_clk>;
612 - irs1125_clk: camera-clk {
613 - compatible = "fixed-clock";
614 - #clock-cells = <0>;
615 - clock-frequency = <26000000>;
623 - brcm,media-controller;
624 + clock-frequency = <26000000>;
629 - media-controller = <0>,"=6";
630 + media-controller = <&csi>,"brcm,media-controller?";
631 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
632 + <&csi_frag>, "target:0=",<&csi0>,
633 + <&clk_frag>, "target:0=",<&cam0_clk>,
634 + <&irs1125>, "clocks:0=",<&cam0_clk>;
637 --- a/arch/arm/boot/dts/overlays/ov5647-overlay.dts
638 +++ b/arch/arm/boot/dts/overlays/ov5647-overlay.dts
641 compatible = "brcm,bcm2835";
644 + i2c_frag: fragment@0 {
645 target = <&i2c_csi_dsi>;
647 #address-cells = <1>;
653 + csi_frag: fragment@1 {
658 + brcm,media-controller;
667 + reg_frag: fragment@4 {
668 target = <&cam1_reg>;
670 startup-delay-us = <20000>;
675 + clk_frag: fragment@5 {
676 target = <&cam1_clk>;
686 - brcm,media-controller;
691 - target = <&cam1_reg>;
693 - status = "disabled";
698 rotation = <&ov5647>,"rotation:0";
699 orientation = <&ov5647>,"orientation:0";
700 - media-controller = <0>,"=6";
701 + media-controller = <&csi>,"brcm,media-controller?";
702 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
703 + <&csi_frag>, "target:0=",<&csi0>,
704 + <®_frag>, "target:0=",<&cam0_reg>,
705 + <&clk_frag>, "target:0=",<&cam0_clk>,
706 + <&ov5647>, "clocks:0=",<&cam0_clk>,
707 + <&ov5647>, "avdd-supply:0=",<&cam0_reg>;
710 --- a/arch/arm/boot/dts/overlays/ov7251-overlay.dts
711 +++ b/arch/arm/boot/dts/overlays/ov7251-overlay.dts
714 compatible = "brcm,bcm2835";
717 + i2c_frag: fragment@0 {
718 target = <&i2c_csi_dsi>;
720 #address-cells = <1>;
726 + csi_frag: fragment@1 {
737 - target = <&cam1_clk>;
738 + target = <&i2c0mux>;
741 - clock-frequency = <24000000>;
746 - target = <&i2c0mux>;
747 + clk_frag: fragment@4 {
748 + target = <&cam1_clk>;
757 - brcm,media-controller;
758 + clock-frequency = <24000000>;
763 rotation = <&ov7251>,"rotation:0";
764 orientation = <&ov7251>,"orientation:0";
765 - media-controller = <0>,"=6";
766 + media-controller = <&csi>,"brcm,media-controller?";
767 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
768 + <&csi_frag>, "target:0=",<&csi0>,
769 + <&clk_frag>, "target:0=",<&cam0_clk>,
770 + <&ov7251>, "clocks:0=",<&cam0_clk>,
771 + <&ov7251>, "vdda-supply:0=",<&cam0_reg>;
774 --- a/arch/arm/boot/dts/overlays/ov9281-overlay.dts
775 +++ b/arch/arm/boot/dts/overlays/ov9281-overlay.dts
778 compatible = "brcm,bcm2835";
781 + i2c_frag: fragment@0 {
782 target = <&i2c_csi_dsi>;
784 #address-cells = <1>;
790 + csi_frag: fragment@1 {
795 + brcm,media-controller;
803 - target = <&cam1_clk>;
806 - clock-frequency = <24000000>;
819 + clk_frag: fragment@4 {
820 + target = <&cam1_clk>;
822 - brcm,media-controller;
824 + clock-frequency = <24000000>;
829 rotation = <&ov9281>,"rotation:0";
830 orientation = <&ov9281>,"orientation:0";
831 - media-controller = <0>,"=5";
832 + media-controller = <&csi>,"brcm,media-controller?";
833 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
834 + <&csi_frag>, "target:0=",<&csi0>,
835 + <&clk_frag>, "target:0=",<&cam0_clk>,
836 + <&ov9281>, "clocks:0=",<&cam0_clk>,
837 + <&ov9281>, "avdd-supply:0=",<&cam0_reg>;
840 --- a/arch/arm/boot/dts/overlays/tc358743-overlay.dts
841 +++ b/arch/arm/boot/dts/overlays/tc358743-overlay.dts
844 compatible = "brcm,bcm2835";
847 + i2c_frag: fragment@0 {
848 target = <&i2c_csi_dsi>;
850 #address-cells = <1>;
855 + tc358743: tc358743@f {
856 compatible = "toshiba,tc358743";
860 - clocks = <&tc358743_clk>;
861 + clocks = <&cam1_clk>;
862 clock-names = "refclk";
865 - tc358743: endpoint {
866 + tc358743_0: endpoint {
867 remote-endpoint = <&csi1_ep>;
875 + csi_frag: fragment@1 {
883 - remote-endpoint = <&tc358743>;
884 + remote-endpoint = <&tc358743_0>;
891 - target = <&tc358743>;
892 + target = <&tc358743_0>;
899 - target = <&tc358743>;
900 + target = <&tc358743_0>;
902 data-lanes = <1 2 3 4>;
910 + clk_frag: fragment@6 {
911 + target = <&cam1_clk>;
913 - tc358743_clk: bridge-clk {
914 - compatible = "fixed-clock";
915 - #clock-cells = <0>;
916 - clock-frequency = <27000000>;
918 + clock-frequency = <27000000>;
929 - brcm,media-controller;
934 4lane = <0>, "-2+3-7+8";
935 - link-frequency = <&tc358743>,"link-frequencies#0";
936 - media-controller = <0>,"=9";
937 + link-frequency = <&tc358743_0>,"link-frequencies#0";
938 + media-controller = <&csi>,"brcm,media-controller?";
939 + cam0 = <&i2c_frag>, "target:0=",<&i2c_vc>,
940 + <&csi_frag>, "target:0=",<&csi0>,
941 + <&clk_frag>, "target:0=",<&cam0_clk>,
942 + <&tc358743>, "clocks:0=",<&cam0_clk>;