33a4f39ee076e2212b39598c6592dc180a56f978
[openwrt/staging/stintel.git] /
1 From 5752746d0694ee607c2971735f2befc8a86fbab9 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 15 Apr 2021 16:46:34 +0100
4 Subject: [PATCH] dtoverlays: Add overlays for JDI LT070ME05000
5 1200x1920 DSI panel
6
7 Credit to forum member gizmomouse on
8 https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=253912 and
9 Andrey Vostrukhin of Harlab for these overlays.
10
11 See https://github.com/harlab/CM4_LCD_LT070ME05000 for
12 schematics and docs for the adapter board to connect this panel which
13 is found in the Asus/Google 2013 Nexus 7" tablet and therefore
14 relatively easily available.
15
16 Note that this uses 4 DSI data lanes, and therefore MUST be used
17 with DISP1 on a Compute Module. It can not be used on a standard
18 Pi.
19
20 There are two versions of the adapter board. V1 connects the
21 display controls to Pi GPIOs, whilst v2 uses an I2C GPIO expander
22 so needs no additional connections beyond the FFC and power.
23
24 The touchscreen overlay for these panels varies, so that part
25 is not configured.
26
27 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
28 ---
29 arch/arm/boot/dts/overlays/Makefile | 2 +
30 arch/arm/boot/dts/overlays/README | 21 ++++++
31 .../vc4-kms-dsi-lt070me05000-overlay.dts | 69 +++++++++++++++++++
32 .../vc4-kms-dsi-lt070me05000-v2-overlay.dts | 64 +++++++++++++++++
33 4 files changed, 156 insertions(+)
34 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dsi-lt070me05000-overlay.dts
35 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dsi-lt070me05000-v2-overlay.dts
36
37 --- a/arch/arm/boot/dts/overlays/Makefile
38 +++ b/arch/arm/boot/dts/overlays/Makefile
39 @@ -213,6 +213,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
40 upstream-pi4.dtbo \
41 vc4-fkms-v3d.dtbo \
42 vc4-kms-dsi-7inch.dtbo \
43 + vc4-kms-dsi-lt070me05000.dtbo \
44 + vc4-kms-dsi-lt070me05000-v2.dtbo \
45 vc4-kms-kippah-7inch.dtbo \
46 vc4-kms-v3d.dtbo \
47 vc4-kms-v3d-pi4.dtbo \
48 --- a/arch/arm/boot/dts/overlays/README
49 +++ b/arch/arm/boot/dts/overlays/README
50 @@ -3158,6 +3158,27 @@ Load: dtoverlay=vc4-kms-dsi-7inch
51 Params: <None>
52
53
54 +Name: vc4-kms-dsi-lt070me05000
55 +Info: Enable a JDI LT070ME05000 DSI display on DSI1.
56 + Note that this is a 4 lane DSI device, so it will only work on a Compute
57 + Module.
58 + Requires vc4-kms-v3d to be loaded.
59 +Load: dtoverlay=vc4-kms-dsi-lt070me05000,<param>
60 +Params: reset GPIO for the reset signal (default 17)
61 + enable GPIO for the enable signal (default 4)
62 + dcdc-en GPIO for the DC-DC converter enable (default 5)
63 +
64 +
65 +Name: vc4-kms-dsi-lt070me05000-v2
66 +Info: Enable a JDI LT070ME05000 DSI display on DSI1 using Harlab's V2
67 + interface board.
68 + Note that this is a 4 lane DSI device, so it will only work on a Compute
69 + Module.
70 + Requires vc4-kms-v3d to be loaded.
71 +Load: dtoverlay=vc4-kms-dsi-lt070me05000-v2
72 +Params: <None>
73 +
74 +
75 Name: vc4-kms-kippah-7inch
76 Info: Enable the Adafruit DPI Kippah with the 7" Ontat panel attached.
77 Requires vc4-kms-v3d to be loaded.
78 --- /dev/null
79 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-lt070me05000-overlay.dts
80 @@ -0,0 +1,69 @@
81 +/*
82 + * Device Tree overlay to connect a JDI LT070ME05000 DSI panel to DSI1.
83 + * This uses 4 DSI data lanes, so can only be used with a Compute Module.
84 + *
85 + * Credit to forum user gizmomouse on
86 + * https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=253912 and
87 + * Andrey Vostrukhin of Harlab for the overlay.
88 + *
89 + * Refer to https://github.com/harlab/CM4_LCD_LT070ME05000 for schematics and
90 + * other documentation.
91 + */
92 +
93 +/dts-v1/;
94 +/plugin/;
95 +
96 +/ {
97 + compatible = "brcm,bcm2835";
98 +
99 + fragment@0 {
100 + target = <&dsi1>;
101 + __overlay__{
102 + status = "okay";
103 + #address-cells = <1>;
104 + #size-cells = <0>;
105 + port {
106 + dsi_out_port:endpoint {
107 + remote-endpoint = <&panel_dsi_port>;
108 + };
109 + };
110 +
111 + lt070me05000:lt070me05000@0 {
112 + compatible = "jdi,lt070me05000";
113 + status = "okay";
114 + reg = <0>;
115 + reset-gpios = <&gpio 17 1>; // LCD RST
116 + enable-gpios = <&gpio 4 0>; // LCD Enable
117 + dcdc-en-gpios = <&gpio 5 0>; // LCD DC-DC Enable
118 + port {
119 + panel_dsi_port: endpoint {
120 + remote-endpoint = <&dsi_out_port>;
121 + };
122 + };
123 + };
124 + };
125 + };
126 +
127 + fragment@1 {
128 + target = <&gpio>;
129 + __overlay__ {
130 + lt070me05000_pins: lt070me05000_pins {
131 + brcm,pins = <4 5 17>;
132 + brcm,function = <1 1 1>; // out
133 + brcm,pull = <0 0 0>; // off
134 + };
135 + };
136 +
137 + };
138 +
139 + __overrides__ {
140 + reset = <&lt070me05000_pins>,"brcm,pins:8",
141 + <&lt070me05000>,"reset-gpios:4";
142 +
143 + enable = <&lt070me05000_pins>,"brcm,pins:0",
144 + <&lt070me05000>,"enable-gpios:4";
145 +
146 + dcdc-en = <&lt070me05000_pins>,"brcm,pins:4",
147 + <&lt070me05000>,"dcdc-en-gpios:4";
148 + };
149 +};
150 --- /dev/null
151 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-lt070me05000-v2-overlay.dts
152 @@ -0,0 +1,64 @@
153 +/*
154 + * Device Tree overlay to connect a JDI LT070ME05000 DSI panel to DSI1.
155 + * This uses 4 DSI data lanes, so can only be used with a Compute Module.
156 + *
157 + * The overlay is for V2 of Harlab's interface board that uses a PCA9536 to
158 + * handle the panel's control GPIOs instead of wiring it back to Pi GPIOs.
159 + *
160 + * Credit to Andrey Vostrukhin of Harlab for the overlay.
161 + *
162 + * Refer to https://github.com/harlab/CM4_LCD_LT070ME05000 for schematics and
163 + * other documentation.
164 + */
165 +
166 +/dts-v1/;
167 +/plugin/;
168 +
169 +/ {
170 + compatible = "brcm,bcm2835";
171 +
172 + fragment@0 {
173 + target = <&i2c_csi_dsi>;
174 + __overlay__ {
175 + #address-cells = <1>;
176 + #size-cells = <0>;
177 + status = "okay";
178 +
179 + pca: pca@41 {
180 + compatible = "nxp,pca9536";
181 + reg = <0x41>;
182 + gpio-controller;
183 + #gpio-cells = <2>;
184 + status = "okay";
185 + };
186 + };
187 + };
188 +
189 + fragment@1 {
190 + target = <&dsi1>;
191 + __overlay__{
192 + status = "okay";
193 + #address-cells = <1>;
194 + #size-cells = <0>;
195 + port {
196 + dsi_out_port:endpoint {
197 + remote-endpoint = <&panel_dsi_port>;
198 + };
199 + };
200 +
201 + lt070me05000:lt070me05000@0 {
202 + compatible = "jdi,lt070me05000";
203 + status = "okay";
204 + reg = <0>;
205 + reset-gpios = <&pca 0 1>;
206 + enable-gpios = <&pca 2 0>;
207 + dcdc-en-gpios = <&pca 1 0>;
208 + port {
209 + panel_dsi_port: endpoint {
210 + remote-endpoint = <&dsi_out_port>;
211 + };
212 + };
213 + };
214 + };
215 + };
216 +};