bcm27xx: update 6.1 patches to latest version
[openwrt/staging/dangole.git] / target / linux / bcm27xx / patches-6.1 / 950-1184-overlays-example-overlay-for-using-panel-dsi-on-RPi.patch
1 From ccf75f2a6f4045484c4539f7d47264f8f6b8453c Mon Sep 17 00:00:00 2001
2 From: Timon Skerutsch <kernel@diodes-delight.com>
3 Date: Mon, 13 Nov 2023 22:52:35 +0100
4 Subject: [PATCH] overlays: example overlay for using panel-dsi on RPi
5
6 Analog to the generic panel-dpi overlay to use panel-dsi with dtparam
7 to not require a panel specific overlay for simple use cases that
8 do not require setting more niche DSI modes.
9
10 Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
11 ---
12 arch/arm/boot/dts/overlays/Makefile | 1 +
13 arch/arm/boot/dts/overlays/README | 31 +++++
14 .../overlays/vc4-kms-dsi-generic-overlay.dts | 106 ++++++++++++++++++
15 3 files changed, 138 insertions(+)
16 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dsi-generic-overlay.dts
17
18 --- a/arch/arm/boot/dts/overlays/Makefile
19 +++ b/arch/arm/boot/dts/overlays/Makefile
20 @@ -293,6 +293,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
21 vc4-kms-dpi-hyperpixel4sq.dtbo \
22 vc4-kms-dpi-panel.dtbo \
23 vc4-kms-dsi-7inch.dtbo \
24 + vc4-kms-dsi-generic.dtbo \
25 vc4-kms-dsi-lt070me05000.dtbo \
26 vc4-kms-dsi-lt070me05000-v2.dtbo \
27 vc4-kms-dsi-waveshare-panel.dtbo \
28 --- a/arch/arm/boot/dts/overlays/README
29 +++ b/arch/arm/boot/dts/overlays/README
30 @@ -4785,6 +4785,37 @@ Params: sizex Touchscr
31 the default DSI1 and i2c_csi_dsi).
32
33
34 +Name: vc4-kms-dsi-generic
35 +Info: Enable a generic DSI display under KMS.
36 + Default timings are for a 840x480 RGB888 panel.
37 + Requires vc4-kms-v3d to be loaded.
38 +Load: dtoverlay=vc4-kms-dsi-generic,<param>=<val>
39 +Params: clock-frequency Display clock frequency (Hz)
40 + hactive Horizontal active pixels
41 + hfp Horizontal front porch
42 + hsync Horizontal sync pulse width
43 + hbp Horizontal back porch
44 + vactive Vertical active lines
45 + vfp Vertical front porch
46 + vsync Vertical sync pulse width
47 + vbp Vertical back porch
48 + width-mm Define the screen width in mm
49 + height-mm Define the screen height in mm
50 + rgb565 Change to RGB565 output
51 + rgb666 Change to RGB666 output
52 + rgb666p Change to RGB666 output with pixel packing
53 + rgb888 Change to RGB888 output, this is the default
54 + one-lane Use one DSI lane for data transmission
55 + This is the default
56 + two-lane Use two DSI lanes for data transmission
57 + three-lane Use three DSI lanes for data transmission
58 + Only supported on Pi5 and CM
59 + four-lane Use four DSI lanes for data transmission
60 + Only supported on Pi5 and CM
61 + dsi0 Switch DSI port to DSI0
62 + Only supported on Pi5 and CM
63 +
64 +
65 Name: vc4-kms-dsi-lt070me05000
66 Info: Enable a JDI LT070ME05000 DSI display on DSI1.
67 Note that this is a 4 lane DSI device, so it will only work on a Compute
68 --- /dev/null
69 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dsi-generic-overlay.dts
70 @@ -0,0 +1,106 @@
71 +/dts-v1/;
72 +/plugin/;
73 +
74 +/ {
75 + compatible = "brcm,bcm2835";
76 +
77 + dsi_frag: fragment@0 {
78 + target = <&dsi1>;
79 + __overlay__{
80 + status = "okay";
81 + #address-cells = <1>;
82 + #size-cells = <0>;
83 + port {
84 + dsi_out:endpoint {
85 + remote-endpoint = <&panel_dsi_port>;
86 + };
87 + };
88 + panel: panel-dsi-generic@0 {
89 + // See panel-dsi.yaml binding
90 + // Using dummy name for panel model
91 + compatible = "Generic,panel-dsi","panel-dsi";
92 + reg = <0>;
93 + power-supply = <0>;
94 + backlight = <0>;
95 + dsi-color-format = "RGB888";
96 + mode = "MODE_VIDEO";
97 + width-mm = <0>;
98 + height-mm = <0>;
99 +
100 + port {
101 + panel_dsi_port: endpoint {
102 + data-lanes = <1>;
103 + remote-endpoint = <&dsi_out>;
104 + };
105 + };
106 +
107 + timing: panel-timing {
108 + clock-frequency = <30000000>;
109 + hactive = <840>;
110 + vactive = <480>;
111 + hback-porch = <44>;
112 + hfront-porch = <46>;
113 + hsync-len = <2>;
114 + vback-porch = <18>;
115 + vfront-porch = <16>;
116 + vsync-len = <2>;
117 + };
118 + };
119 + };
120 + };
121 +
122 + fragment@1 {
123 + target = <&panel_dsi_port>;
124 + __dormant__ {
125 + data-lanes = <1>;
126 + };
127 + };
128 +
129 + fragment@2 {
130 + target = <&panel_dsi_port>;
131 + __dormant__ {
132 + data-lanes = <1 2>;
133 + };
134 + };
135 +
136 + fragment@3 {
137 + target = <&panel_dsi_port>;
138 + __dormant__ {
139 + data-lanes = <1 2 3>;
140 + };
141 + };
142 +
143 + fragment@4 {
144 + target = <&panel_dsi_port>;
145 + __dormant__ {
146 + data-lanes = <1 2 3 4>;
147 + };
148 + };
149 +
150 + __overrides__ {
151 + dsi0 = <&dsi_frag>, "target:0=",<&dsi0>;
152 +
153 + clock-frequency = <&timing>, "clock-frequency:0";
154 + hactive = <&timing>, "hactive:0";
155 + hfp = <&timing>, "hfront-porch:0";
156 + hsync = <&timing>, "hsync-len:0";
157 + hbp = <&timing>, "hback-porch:0";
158 + vactive = <&timing>, "vactive:0";
159 + vfp = <&timing>, "vfront-porch:0";
160 + vsync = <&timing>, "vsync-len:0";
161 + vbp = <&timing>, "vback-porch:0";
162 +
163 + width-mm = <&panel>, "width-mm:0";
164 + height-mm = <&panel>, "height-mm:0";
165 +
166 + rgb565 = <&panel>, "dsi-color-format=RGB565";
167 + rgb666p = <&panel>, "dsi-color-format=RGB666_PACKED";
168 + rgb666 = <&panel>, "dsi-color-format=RGB666";
169 + rgb888 = <&panel>, "dsi-color-format=RGB888";
170 + one-lane = <0>,"+1";
171 + two-lane = <0>,"+2";
172 + three-lane = <0>,"+3";
173 + four-lane = <0>,"+4";
174 + };
175 +
176 +};