f5e4e4b008dbb4609188c91a1e5b55a67d33c757
[openwrt/staging/hauke.git] /
1 From 393b01ee7330723b5f27b86d1b03bed88f8a8ffa Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 9 Apr 2020 17:26:13 +0100
4 Subject: [PATCH] dt: Update all mainline bcm283x dt files for i2c0
5 pinctrl mux
6
7 BSC0 (aka i2c0) can me muxed via pinctrl to GPIOs 0&1, 28&29, or
8 44&45. These have different uses based on the platform (40pin header,
9 and CSI/DSI connectors), so add a pinctrl I2C mux between the
10 different options.
11
12 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
13 ---
14 arch/arm/boot/dts/bcm2835-rpi-a-plus.dts | 5 +++++
15 arch/arm/boot/dts/bcm2835-rpi-a.dts | 7 +++++++
16 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 5 +++++
17 arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 7 +++++++
18 arch/arm/boot/dts/bcm2835-rpi-b.dts | 7 +++++++
19 arch/arm/boot/dts/bcm2835-rpi-cm1-io1.dts | 5 +++++
20 arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 5 +++++
21 arch/arm/boot/dts/bcm2835-rpi-zero.dts | 5 +++++
22 arch/arm/boot/dts/bcm2835-rpi.dtsi | 10 +++++++---
23 arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 5 +++++
24 arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts | 5 +++++
25 arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts | 5 +++++
26 arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 5 +++++
27 arch/arm/boot/dts/bcm2837-rpi-cm3-io3.dts | 5 +++++
28 14 files changed, 78 insertions(+), 3 deletions(-)
29
30 --- a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
31 +++ b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts
32 @@ -126,3 +126,8 @@
33 pinctrl-0 = <&uart0_gpio14>;
34 status = "okay";
35 };
36 +
37 +/* i2c on camera/display connector is gpio 28&29 */
38 +&i2c0mux {
39 + pinctrl-1 = <&i2c0_gpio28>;
40 +};
41 --- a/arch/arm/boot/dts/bcm2835-rpi-a.dts
42 +++ b/arch/arm/boot/dts/bcm2835-rpi-a.dts
43 @@ -121,3 +121,10 @@
44 pinctrl-0 = <&uart0_gpio14>;
45 status = "okay";
46 };
47 +
48 +/* i2c0 on camera/display connector is gpio 0&1. Not exposed on header.
49 + * To avoid having to remap everything, map both ports to gpios 0&1
50 + */
51 +&i2c0mux {
52 + pinctrl-1 = <&i2c0_gpio0>;
53 +};
54 --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
55 +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
56 @@ -128,3 +128,8 @@
57 pinctrl-0 = <&uart0_gpio14>;
58 status = "okay";
59 };
60 +
61 +/* i2c on camera/display connector is gpio 28&29 */
62 +&i2c0mux {
63 + pinctrl-1 = <&i2c0_gpio28>;
64 +};
65 --- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
66 +++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
67 @@ -121,3 +121,10 @@
68 pinctrl-0 = <&uart0_gpio14>;
69 status = "okay";
70 };
71 +
72 +/* i2c0 on camera/display connector is gpio 0&1. Not exposed on header.
73 + * To avoid having to remap everything, map both ports to gpios 0&1
74 + */
75 +&i2c0mux {
76 + pinctrl-1 = <&i2c0_gpio0>;
77 +};
78 --- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
79 +++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
80 @@ -116,3 +116,10 @@
81 pinctrl-0 = <&uart0_gpio14>;
82 status = "okay";
83 };
84 +
85 +/* camera/display connector use BSC1 on GPIOS 2&3.
86 + * To avoid having to remap everything, map both ports to gpios 0&1
87 + */
88 +&i2c0mux {
89 + pinctrl-1 = <&i2c0_gpio0>;
90 +};
91 --- a/arch/arm/boot/dts/bcm2835-rpi-cm1-io1.dts
92 +++ b/arch/arm/boot/dts/bcm2835-rpi-cm1-io1.dts
93 @@ -95,3 +95,8 @@
94 pinctrl-0 = <&uart0_gpio14>;
95 status = "okay";
96 };
97 +
98 +/* WHAT TO DO HERE? */
99 +&i2c0mux {
100 + pinctrl-1 = <&i2c0_gpio28>;
101 +};
102 --- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
103 +++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
104 @@ -149,3 +149,8 @@
105 pinctrl-0 = <&uart1_gpio14>;
106 status = "okay";
107 };
108 +
109 +/* i2c on camera/display connector is gpio 28&29 */
110 +&i2c0mux {
111 + pinctrl-1 = <&i2c0_gpio28>;
112 +};
113 --- a/arch/arm/boot/dts/bcm2835-rpi-zero.dts
114 +++ b/arch/arm/boot/dts/bcm2835-rpi-zero.dts
115 @@ -117,3 +117,8 @@
116 pinctrl-0 = <&uart0_gpio14>;
117 status = "okay";
118 };
119 +
120 +/* i2c on camera/display connector is gpio 28&29 */
121 +&i2c0mux {
122 + pinctrl-1 = <&i2c0_gpio28>;
123 +};
124 --- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
125 +++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
126 @@ -46,13 +46,17 @@
127 };
128 };
129
130 -&i2c0 {
131 - pinctrl-names = "default";
132 - pinctrl-0 = <&i2c0_gpio0>;
133 +&i2c0if {
134 status = "okay";
135 clock-frequency = <100000>;
136 };
137
138 +&i2c0mux {
139 + pinctrl-0 = <&i2c0_gpio0>;
140 + /* pinctrl-1 varies based on platform */
141 + status = "okay";
142 +};
143 +
144 &i2c1 {
145 pinctrl-names = "default";
146 pinctrl-0 = <&i2c1_gpio2>;
147 --- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
148 +++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
149 @@ -128,3 +128,8 @@
150 pinctrl-0 = <&uart0_gpio14>;
151 status = "okay";
152 };
153 +
154 +/* i2c on camera/display connector is gpio 28&29 */
155 +&i2c0mux {
156 + pinctrl-1 = <&i2c0_gpio28>;
157 +};
158 --- a/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
159 +++ b/arch/arm/boot/dts/bcm2837-rpi-3-a-plus.dts
160 @@ -176,3 +176,8 @@
161 pinctrl-0 = <&uart1_gpio14>;
162 status = "okay";
163 };
164 +
165 +/* i2c on camera/display connector is gpio 44&45 */
166 +&i2c0mux {
167 + pinctrl-1 = <&i2c0_gpio44>;
168 +};
169 --- a/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
170 +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b-plus.dts
171 @@ -179,3 +179,8 @@
172 pinctrl-0 = <&uart1_gpio14>;
173 status = "okay";
174 };
175 +
176 +/* i2c on camera/display connector is gpio 44&45 */
177 +&i2c0mux {
178 + pinctrl-1 = <&i2c0_gpio44>;
179 +};
180 --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
181 +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
182 @@ -174,3 +174,8 @@
183 status = "okay";
184 bus-width = <4>;
185 };
186 +
187 +/* i2c on camera/display connector is gpio 44&45 */
188 +&i2c0mux {
189 + pinctrl-1 = <&i2c0_gpio44>;
190 +};
191 --- a/arch/arm/boot/dts/bcm2837-rpi-cm3-io3.dts
192 +++ b/arch/arm/boot/dts/bcm2837-rpi-cm3-io3.dts
193 @@ -94,3 +94,8 @@
194 pinctrl-0 = <&uart0_gpio14>;
195 status = "okay";
196 };
197 +
198 +/* WHAT TO DO HERE? */
199 +&i2c0mux {
200 + pinctrl-1 = <&i2c0_gpio28>;
201 +};