summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi/dsi/0001-Add-devicetree-support-for-RaspberryPi-7-panel-over-.patch
blob: fce687290923fb7e2c70b75136d24cca4a36c627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
From 380fd9f0da44ed62dff59a7c7e06f1190b58aa64 Mon Sep 17 00:00:00 2001
From: Kevin Quigley <kevin@kquigley.co.uk>
Date: Mon, 24 Sep 2018 12:22:31 +0000
Subject: [PATCH 1/4] Add devicetree support for RaspberryPi 7" panel over DSI
 I2C

---
 arch/arm/boot/dts/bcm2708-rpi-b-plus.dts      |  5 +++
 arch/arm/boot/dts/bcm2708-rpi-b.dts           |  6 +++
 arch/arm/boot/dts/bcm2708-rpi.dtsi            | 21 ++++++++++
 arch/arm/boot/dts/bcm2709-rpi-2-b.dts         |  5 +++
 arch/arm/boot/dts/bcm270x.dtsi                | 39 +++++++++++++++++
 arch/arm/boot/dts/bcm2710-rpi-3-b.dts         |  6 +++
 arch/arm/boot/dts/bcm2835-rpi-b-plus.dts      |  5 +++
 arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts      |  5 +++
 arch/arm/boot/dts/bcm2835-rpi-b.dts           |  5 +++
 arch/arm/boot/dts/bcm2835-rpi.dtsi            |  2 +
 arch/arm/boot/dts/bcm2836-rpi-2-b.dts         |  5 +++
 arch/arm/boot/dts/bcm2837-rpi-3-b.dts         |  5 +++
 arch/arm/boot/dts/bcm283x.dtsi                | 16 ++++++-
 arch/arm/boot/dts/overlays/Makefile           |  1 +
 .../boot/dts/overlays/rpi-7inch-overlay.dts   | 42 +++++++++++++++++++
 15 files changed, 167 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/overlays/rpi-7inch-overlay.dts

diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
index ef0beea3a3a3..83b95b9a6ec3 100644
--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
+++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
@@ -121,3 +121,8 @@
 		pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
 	};
 };
+
+&i2c_dsi {
+	gpios = <&gpio 28 0
+		 &gpio 29 0>;
+};
diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts
index dea70fae90e6..ea5de651d59d 100644
--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
@@ -111,3 +111,9 @@
 		act_led_trigger = <&act_led>,"linux,default-trigger";
 	};
 };
+
+
+&i2c_dsi {
+	gpios = <&gpio 2 0
+		 &gpio 3 0>;
+};
diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi
index b13632932192..2d8421f6681c 100644
--- a/arch/arm/boot/dts/bcm2708-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi
@@ -132,6 +132,27 @@
 	power-domains = <&power RPI_POWER_DOMAIN_USB>;
 };
 
+&v3d {
+        power-domains = <&power RPI_POWER_DOMAIN_V3D>;
+};
+
+&vec {
+        power-domains = <&power RPI_POWER_DOMAIN_VEC>;
+        status = "okay";
+};
+
+&dsi0 {
+        power-domains = <&power RPI_POWER_DOMAIN_DSI0>;
+        status = "okay";
+};
+
+&dsi1 {
+        power-domains = <&power RPI_POWER_DOMAIN_DSI1>;
+        status = "okay";
+};
+
+
+
 &clocks {
 	firmware = <&firmware>;
 };
diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
index 34659505055a..c23f79395791 100644
--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
+++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
@@ -122,3 +122,8 @@
 		pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
 	};
 };
+
+&i2c_dsi {
+	gpios = <&gpio 28 0
+		 &gpio 29 0>;
+};
diff --git a/arch/arm/boot/dts/bcm270x.dtsi b/arch/arm/boot/dts/bcm270x.dtsi
index f086ff0deec5..0b1ef47b18b0 100644
--- a/arch/arm/boot/dts/bcm270x.dtsi
+++ b/arch/arm/boot/dts/bcm270x.dtsi
@@ -84,6 +84,26 @@
 			status = "disabled";
 		};
 
+		dsi1: dsi@7e700000 {
+			compatible = "brcm,bcm2835-dsi1";
+			reg = <0x7e700000 0x8c>;
+			interrupts = <2 12>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#clock-cells = <1>;
+
+			clocks = <&clocks BCM2835_PLLD_DSI1>,
+				 <&clocks BCM2835_CLOCK_DSI1E>,
+				 <&clocks BCM2835_CLOCK_DSI1P>;
+			clock-names = "phy", "escape", "pixel";
+
+			clock-output-names = "dsi1_byte",
+					     "dsi1_ddr2",
+					     "dsi1_ddr";
+
+			status = "disabled";
+		};
+
 		firmwarekms: firmwarekms@7e600000 {
 			compatible = "raspberrypi,rpi-firmware-kms";
 			/* SMI interrupt reg */
@@ -93,6 +113,21 @@
 			status = "disabled";
 		};
 
+                i2c_dsi: i2cdsi {
+                        /* We have to use i2c-gpio because the
+                         * firmware is also polling another device
+                         * using the only hardware I2C bus that could
+                         * connect to these pins.
+                         */
+                        compatible = "i2c-gpio";
+                        #address-cells = <1>;
+                        #size-cells = <0>;
+                        status = "disabled";
+                        gpios = <&gpio 28 0
+                                 &gpio 29 0>;
+
+                };
+
 		smi: smi@7e600000 {
 			compatible = "brcm,bcm2835-smi";
 			reg = <0x7e600000 0x100>;
@@ -187,3 +222,7 @@
 &vc4 {
 	status = "disabled";
 };
+
+&dsi1 {
+	power-domains = <&power RPI_POWER_DOMAIN_DSI1>;
+};
diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
index 37aed344cbbf..6ec9b28999f3 100644
--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
+++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts
@@ -190,3 +190,9 @@
 		pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
 	};
 };
+
+&i2c_dsi {
+	gpios = <&gpio 44 0
+		 &gpio 45 0>;
+};
+
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
index a462de2ce37e..346efbd4a95f 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
@@ -109,3 +109,8 @@
 	pinctrl-0 = <&uart0_gpio14>;
 	status = "okay";
 };
+
+&i2c_dsi {
+	gpios = <&gpio 28 0
+		 &gpio 29 0>;
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
index 264c84e94329..8b9ebf3670c2 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts
@@ -102,3 +102,8 @@
 	pinctrl-0 = <&uart0_gpio14>;
 	status = "okay";
 };
+
+&i2c_dsi {
+	gpios = <&gpio 2 0
+		 &gpio 3 0>;
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts
index 03e3a7a7dc5e..4020e79fc989 100644
--- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
@@ -97,3 +97,8 @@
 	pinctrl-0 = <&uart0_gpio14>;
 	status = "okay";
 };
+
+&i2c_dsi {
+	gpios = <&gpio 28 0
+		 &gpio 29 0>;
+};
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
index 356d4e6a17e5..0599f0a27e5f 100644
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -101,10 +101,12 @@
 
 &dsi0 {
 	power-domains = <&power RPI_POWER_DOMAIN_DSI0>;
+	status = "okay";
 };
 
 &dsi1 {
 	power-domains = <&power RPI_POWER_DOMAIN_DSI1>;
+	status = "okay";
 };
 
 &csi0 {
diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
index 59e70f4a19e5..6c4c9c8d8ed0 100644
--- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
+++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts
@@ -47,3 +47,8 @@
 	pinctrl-0 = <&uart0_gpio14>;
 	status = "okay";
 };
+
+&i2c_dsi {
+	gpios = <&gpio 28 0
+		 &gpio 29 0>;
+};
diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
index 8703d006a206..c99f70cefa61 100644
--- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts
@@ -56,3 +56,8 @@
 	status = "okay";
 	bus-width = <4>;
 };
+
+&i2c_dsi {
+	gpios = <&gpio 44 0
+		 &gpio 45 0>;
+};
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index 22eca6fad427..3ee99963f827 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -551,7 +551,6 @@
 			clock-output-names = "dsi1_byte",
 					     "dsi1_ddr2",
 					     "dsi1_ddr";
-
 			status = "disabled";
 		};
 
@@ -652,6 +651,21 @@
 		vc4: gpu {
 			compatible = "brcm,bcm2835-vc4";
 		};
+
+		i2c_dsi: i2cdsi {
+			/* We have to use i2c-gpio because the
+			 * firmware is also polling another device
+			 * using the only hardware I2C bus that could
+			 * connect to these pins.
+			 */
+			compatible = "i2c-gpio";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+			gpios = <&gpio 28 0
+				 &gpio 29 0>;
+
+		};
 	};
 
 	clocks {
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
index e0bdd84d21c5..f983d0180b8b 100644
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -110,6 +110,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
 	rpi-cirrus-wm5102.dtbo \
 	rpi-dac.dtbo \
 	rpi-display.dtbo \
+	rpi-7inch.dtbo \
 	rpi-ft5406.dtbo \
 	rpi-poe.dtbo \
 	rpi-proto.dtbo \
diff --git a/arch/arm/boot/dts/overlays/rpi-7inch-overlay.dts b/arch/arm/boot/dts/overlays/rpi-7inch-overlay.dts
new file mode 100644
index 000000000000..3bb882d79086
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/rpi-7inch-overlay.dts
@@ -0,0 +1,42 @@
+/*
+ * Device Tree overlay for RaspberryPi 7" Touchscreen panel
+ *
+ */
+
+/dts-v1/; 
+/plugin/; 
+
+/ {
+        compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
+
+        fragment@1 {
+                target = <&dsi1>;
+                __overlay__ {
+                        #address-cells = <1>; size-cells = <0>;
+                        status = "okay";
+                        port {
+                                dsi_out_port: endpoint {
+                                        remote-endpoint = <&panel_dsi_port>;
+                                };
+                        };
+                };
+        };
+
+        fragment@2 {
+                target = <&i2c_dsi>;
+                __overlay__ {
+                        #address-cells = <1>;
+			#size-cells = <0>;
+                        status = "okay";
+			lcd@45 {
+				compatible = "raspberrypi,7inch-touchscreen-panel";
+				reg = <0x45>;
+				port {
+					panel_dsi_port: endpoint {
+						remote-endpoint = <&dsi_out_port>;
+					};
+				};
+			};
+                };
+        };
+};
-- 
2.21.0