edfca1ed67a1a377642da9a000337f8f772bd52b
[openwrt/staging/blocktrron.git] /
1 From 7a1905f969cfa2e303f5e74efee56dbd0523e5bb Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Tue, 23 Jun 2020 15:41:42 +0100
4 Subject: [PATCH] dt/dtoverlays: Fix up base DT and overlays for
5 updated Unicam driver
6
7 The upstreamed Unicam driver uses a dt property to denote how many
8 lanes are supported by the receiver peripheral, independent of
9 the number of lanes that the sensor wants to use. It also doesn't
10 check the remote endpoint config for the number of lanes as that
11 isn't the accepted way of doing things.
12
13 Update the base DT for the brcm,num-data-lanes property, and the
14 overlays to define the desired number of lanes at both ends of
15 the link.
16
17 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
18 ---
19 arch/arm/boot/dts/bcm2711-rpi-cm4.dts | 3 ++-
20 arch/arm/boot/dts/bcm283x-rpi-csi0-2lane.dtsi | 6 +-----
21 arch/arm/boot/dts/bcm283x-rpi-csi1-2lane.dtsi | 6 +-----
22 arch/arm/boot/dts/bcm283x-rpi-csi1-4lane.dtsi | 6 +-----
23 arch/arm/boot/dts/overlays/adv7282m-overlay.dts | 1 +
24 arch/arm/boot/dts/overlays/imx477-overlay.dts | 1 +
25 arch/arm/boot/dts/overlays/irs1125-overlay.dts | 2 ++
26 arch/arm/boot/dts/overlays/ov5647-overlay.dts | 1 +
27 arch/arm/boot/dts/overlays/tc358743-overlay.dts | 16 +++++++++++++++-
28 9 files changed, 25 insertions(+), 17 deletions(-)
29
30 --- a/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
31 +++ b/arch/arm/boot/dts/bcm2711-rpi-cm4.dts
32 @@ -203,7 +203,8 @@
33 };
34
35 #include "bcm2711-rpi.dtsi"
36 -#include "bcm283x-rpi-csi1-2lane.dtsi"
37 +#include "bcm283x-rpi-csi0-2lane.dtsi"
38 +#include "bcm283x-rpi-csi1-4lane.dtsi"
39 #include "bcm283x-rpi-i2c0mux_0_44.dtsi"
40
41 /delete-node/ &emmc2;
42 --- a/arch/arm/boot/dts/bcm283x-rpi-csi0-2lane.dtsi
43 +++ b/arch/arm/boot/dts/bcm283x-rpi-csi0-2lane.dtsi
44 @@ -1,8 +1,4 @@
45 // SPDX-License-Identifier: GPL-2.0-only
46 &csi0 {
47 - port {
48 - endpoint {
49 - data-lanes = <1 2>;
50 - };
51 - };
52 + brcm,num-data-lanes = <2>;
53 };
54 --- a/arch/arm/boot/dts/bcm283x-rpi-csi1-2lane.dtsi
55 +++ b/arch/arm/boot/dts/bcm283x-rpi-csi1-2lane.dtsi
56 @@ -1,8 +1,4 @@
57 // SPDX-License-Identifier: GPL-2.0-only
58 &csi1 {
59 - port {
60 - endpoint {
61 - data-lanes = <1 2>;
62 - };
63 - };
64 + brcm,num-data-lanes = <2>;
65 };
66 --- a/arch/arm/boot/dts/bcm283x-rpi-csi1-4lane.dtsi
67 +++ b/arch/arm/boot/dts/bcm283x-rpi-csi1-4lane.dtsi
68 @@ -1,8 +1,4 @@
69 // SPDX-License-Identifier: GPL-2.0-only
70 &csi1 {
71 - port {
72 - endpoint {
73 - data-lanes = <1 2 3 4>;
74 - };
75 - };
76 + brcm,num-data-lanes = <4>;
77 };
78 --- a/arch/arm/boot/dts/overlays/adv7282m-overlay.dts
79 +++ b/arch/arm/boot/dts/overlays/adv7282m-overlay.dts
80 @@ -40,6 +40,7 @@
81 port {
82 csi1_ep: endpoint {
83 remote-endpoint = <&adv728x_0>;
84 + data-lanes = <1>;
85 };
86 };
87 };
88 --- a/arch/arm/boot/dts/overlays/imx477-overlay.dts
89 +++ b/arch/arm/boot/dts/overlays/imx477-overlay.dts
90 @@ -49,6 +49,7 @@
91 port {
92 csi1_ep: endpoint {
93 remote-endpoint = <&imx477_0>;
94 + data-lanes = <1 2>;
95 };
96 };
97 };
98 --- a/arch/arm/boot/dts/overlays/irs1125-overlay.dts
99 +++ b/arch/arm/boot/dts/overlays/irs1125-overlay.dts
100 @@ -43,6 +43,8 @@
101 port {
102 csi1_ep: endpoint {
103 remote-endpoint = <&irs1125_0>;
104 + data-lanes = <1 2>;
105 + clock-noncontinuous;
106 };
107 };
108 };
109 --- a/arch/arm/boot/dts/overlays/ov5647-overlay.dts
110 +++ b/arch/arm/boot/dts/overlays/ov5647-overlay.dts
111 @@ -43,6 +43,7 @@
112 port {
113 csi1_ep: endpoint {
114 remote-endpoint = <&ov5647_0>;
115 + data-lanes = <1 2>;
116 };
117 };
118 };
119 --- a/arch/arm/boot/dts/overlays/tc358743-overlay.dts
120 +++ b/arch/arm/boot/dts/overlays/tc358743-overlay.dts
121 @@ -86,8 +86,22 @@
122 };
123 };
124
125 + fragment@7 {
126 + target = <&csi1_ep>;
127 + __overlay__ {
128 + data-lanes = <1 2>;
129 + };
130 + };
131 +
132 + fragment@8 {
133 + target = <&csi1_ep>;
134 + __dormant__ {
135 + data-lanes = <1 2 3 4>;
136 + };
137 + };
138 +
139 __overrides__ {
140 - 4lane = <0>, "-2+3";
141 + 4lane = <0>, "-2+3-7+8";
142 link-frequency = <&tc358743>,"link-frequencies#0";
143 };
144 };