bcm27xx: switch to kernel v6.1
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-5.15 / 950-0599-dtoverlays-Add-a-generic-DPI-panel-overlay-for-KMS.patch
1 From 208d270a7b613e5593390d38a9fba8bd248c5928 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 2 Dec 2021 18:06:37 +0000
4 Subject: [PATCH] dtoverlays: Add a generic DPI panel overlay for KMS
5
6 Uses the "panel-dpi" compatible to set panel timings from
7 DT.
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
10 ---
11 arch/arm/boot/dts/overlays/Makefile | 1 +
12 arch/arm/boot/dts/overlays/README | 28 ++++++
13 .../overlays/vc4-kms-dpi-generic-overlay.dts | 92 +++++++++++++++++++
14 3 files changed, 121 insertions(+)
15 create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
16
17 --- a/arch/arm/boot/dts/overlays/Makefile
18 +++ b/arch/arm/boot/dts/overlays/Makefile
19 @@ -232,6 +232,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
20 vc4-fkms-v3d.dtbo \
21 vc4-fkms-v3d-pi4.dtbo \
22 vc4-kms-dpi-at056tn53v1.dtbo \
23 + vc4-kms-dpi-generic.dtbo \
24 vc4-kms-dsi-7inch.dtbo \
25 vc4-kms-dsi-lt070me05000.dtbo \
26 vc4-kms-dsi-lt070me05000-v2.dtbo \
27 --- a/arch/arm/boot/dts/overlays/README
28 +++ b/arch/arm/boot/dts/overlays/README
29 @@ -3563,6 +3563,34 @@ Load: dtoverlay=vc4-kms-dpi-at056tn53v
30 Params: <None>
31
32
33 +Name: vc4-kms-dpi-generic
34 +Info: Enable a generic DPI display under KMS. Default timings are for the
35 + Adafruit Kippah with 800x480 panel and RGB666 (GPIOs 0-21)
36 + Requires vc4-kms-v3d to be loaded.
37 +Load: dtoverlay=vc4-kms-dpi-generic,<param>=<val>
38 +Params: clock-frequency Display clock frequency (Hz)
39 + hactive Horizontal active pixels
40 + hfp Horizontal front porch
41 + hsync Horizontal sync pulse width
42 + hbp Horizontal back porch
43 + vactive Vertical active lines
44 + vfp Vertical front porch
45 + vsync Vertical sync pulse width
46 + vbp Vertical back porch
47 + hsync-invert Horizontal sync active low
48 + vsync-invert Vertical sync active low
49 + de-invert Data Enable active low
50 + pixclk-invert Negative edge pixel clock
51 + width-mm Define the screen width in mm
52 + height-mm Define the screen height in mm
53 + rgb565 Change to RGB565 output on GPIOs 0-19
54 + rgb666-padhi Change to RGB666 output on GPIOs 0-9, 12-17, and
55 + 20-25
56 + rgb888 Change to RGB888 output on GPIOs 0-27
57 + bus-format Override the bus format for a MEDIA_BUS_FMT_*
58 + value. NB also overridden by rgbXXX overrides.
59 +
60 +
61 Name: vc4-kms-dsi-7inch
62 Info: Enable the Raspberry Pi DSI 7" screen.
63 Includes the edt-ft5406 for the touchscreen element.
64 --- /dev/null
65 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
66 @@ -0,0 +1,92 @@
67 +/*
68 + * vc4-kms-dpi-at056tn53v1-overlay.dts
69 + */
70 +
71 +/dts-v1/;
72 +/plugin/;
73 +
74 +#include <dt-bindings/gpio/gpio.h>
75 +#include <dt-bindings/pinctrl/bcm2835.h>
76 +
77 +/ {
78 + compatible = "brcm,bcm2835";
79 +
80 + fragment@0 {
81 + target-path = "/";
82 + __overlay__ {
83 + panel: panel {
84 + compatible = "panel-dpi";
85 +
86 + width-mm = <154>;
87 + height-mm = <83>;
88 + bus-format = <0x1009>;
89 +
90 + timing: panel-timing {
91 + clock-frequency = <29500000>;
92 + hactive = <800>;
93 + hfront-porch = <24>;
94 + hsync-len = <72>;
95 + hback-porch = <96>;
96 + hsync-active = <0>;
97 + vactive = <480>;
98 + vfront-porch = <3>;
99 + vsync-len = <10>;
100 + vback-porch = <7>;
101 + vsync-active = <0>;
102 +
103 + de-active = <1>;
104 + pixelclk-active = <1>;
105 + };
106 +
107 + port {
108 + panel_in: endpoint {
109 + remote-endpoint = <&dpi_out>;
110 + };
111 + };
112 + };
113 + };
114 + };
115 +
116 + fragment@1 {
117 + target = <&dpi>;
118 + dpi_node: __overlay__ {
119 + status = "okay";
120 +
121 + pinctrl-names = "default";
122 + pinctrl-0 = <&dpi_18bit_gpio0>;
123 +
124 + port {
125 + dpi_out: endpoint {
126 + remote-endpoint = <&panel_in>;
127 + };
128 + };
129 + };
130 + };
131 +
132 + __overrides__ {
133 + clock-frequency = <&timing>, "clock-frequency:0";
134 + hactive = <&timing>, "hactive:0";
135 + hfp = <&timing>, "hfront-porch:0";
136 + hsync = <&timing>, "hsync-len:0";
137 + hbp = <&timing>, "hback-porch:0";
138 + vactive = <&timing>, "vactive:0";
139 + vfp = <&timing>, "vfront-porch:0";
140 + vsync = <&timing>, "vsync-len:0";
141 + vbp = <&timing>, "vback-porch:0";
142 + hsync-invert = <&timing>, "hsync-active:0=0";
143 + vsync-invert = <&timing>, "vsync-active:0=0";
144 + de-invert = <&timing>, "de-active:0=0";
145 + pixclk-invert = <&timing>, "pixelclk-active:0=0";
146 +
147 + width-mm = <&panel>, "width-mm:0";
148 + height-mm = <&panel>, "height-mm:0";
149 +
150 + rgb565 = <&panel>, "bus-format:0=0x1017",
151 + <&dpi_node>, "pinctrl-0:0=",<&dpi_16bit_gpio0>;
152 + rgb666-padhi = <&panel>, "bus-format:0=0x1015",
153 + <&dpi_node>, "pinctrl-0:0=",<&dpi_18bit_cpadhi_gpio0>;
154 + rgb888 = <&panel>, "bus-format:0=0x100a",
155 + <&dpi_node>, "pinctrl-0:0=",<&dpi_gpio0>;
156 + bus-format = <&panel>, "bus-format:0";
157 + };
158 +};