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
6 Uses the "panel-dpi" compatible to set panel timings from
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
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
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) += \
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
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
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.
61 Name: vc4-kms-dsi-7inch
62 Info: Enable the Raspberry Pi DSI 7" screen.
63 Includes the edt-ft5406 for the touchscreen element.
65 +++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
68 + * vc4-kms-dpi-at056tn53v1-overlay.dts
74 +#include <dt-bindings/gpio/gpio.h>
75 +#include <dt-bindings/pinctrl/bcm2835.h>
78 + compatible = "brcm,bcm2835";
84 + compatible = "panel-dpi";
88 + bus-format = <0x1009>;
90 + timing: panel-timing {
91 + clock-frequency = <29500000>;
93 + hfront-porch = <24>;
101 + vsync-active = <0>;
104 + pixelclk-active = <1>;
108 + panel_in: endpoint {
109 + remote-endpoint = <&dpi_out>;
118 + dpi_node: __overlay__ {
121 + pinctrl-names = "default";
122 + pinctrl-0 = <&dpi_18bit_gpio0>;
125 + dpi_out: endpoint {
126 + remote-endpoint = <&panel_in>;
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";
147 + width-mm = <&panel>, "width-mm:0";
148 + height-mm = <&panel>, "height-mm:0";
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";