Skip to content

Commit 0f6b9a3

Browse files
6by9pelwell
authored andcommitted
dtoverlays: Add a generic DPI panel overlay for KMS
Uses the "panel-dpi" compatible to set panel timings from DT. Signed-off-by: Dave Stevenson <[email protected]>
1 parent 4f0ae28 commit 0f6b9a3

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
232232
vc4-fkms-v3d.dtbo \
233233
vc4-fkms-v3d-pi4.dtbo \
234234
vc4-kms-dpi-at056tn53v1.dtbo \
235+
vc4-kms-dpi-generic.dtbo \
235236
vc4-kms-dsi-7inch.dtbo \
236237
vc4-kms-dsi-lt070me05000.dtbo \
237238
vc4-kms-dsi-lt070me05000-v2.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3563,6 +3563,34 @@ Load: dtoverlay=vc4-kms-dpi-at056tn53v1
35633563
Params: <None>
35643564

35653565

3566+
Name: vc4-kms-dpi-generic
3567+
Info: Enable a generic DPI display under KMS. Default timings are for the
3568+
Adafruit Kippah with 800x480 panel and RGB666 (GPIOs 0-21)
3569+
Requires vc4-kms-v3d to be loaded.
3570+
Load: dtoverlay=vc4-kms-dpi-generic,<param>=<val>
3571+
Params: clock-frequency Display clock frequency (Hz)
3572+
hactive Horizontal active pixels
3573+
hfp Horizontal front porch
3574+
hsync Horizontal sync pulse width
3575+
hbp Horizontal back porch
3576+
vactive Vertical active lines
3577+
vfp Vertical front porch
3578+
vsync Vertical sync pulse width
3579+
vbp Vertical back porch
3580+
hsync-invert Horizontal sync active low
3581+
vsync-invert Vertical sync active low
3582+
de-invert Data Enable active low
3583+
pixclk-invert Negative edge pixel clock
3584+
width-mm Define the screen width in mm
3585+
height-mm Define the screen height in mm
3586+
rgb565 Change to RGB565 output on GPIOs 0-19
3587+
rgb666-padhi Change to RGB666 output on GPIOs 0-9, 12-17, and
3588+
20-25
3589+
rgb888 Change to RGB888 output on GPIOs 0-27
3590+
bus-format Override the bus format for a MEDIA_BUS_FMT_*
3591+
value. NB also overridden by rgbXXX overrides.
3592+
3593+
35663594
Name: vc4-kms-dsi-7inch
35673595
Info: Enable the Raspberry Pi DSI 7" screen.
35683596
Includes the edt-ft5406 for the touchscreen element.
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*
2+
* vc4-kms-dpi-at056tn53v1-overlay.dts
3+
*/
4+
5+
/dts-v1/;
6+
/plugin/;
7+
8+
#include <dt-bindings/gpio/gpio.h>
9+
#include <dt-bindings/pinctrl/bcm2835.h>
10+
11+
/ {
12+
compatible = "brcm,bcm2835";
13+
14+
fragment@0 {
15+
target-path = "/";
16+
__overlay__ {
17+
panel: panel {
18+
compatible = "panel-dpi";
19+
20+
width-mm = <154>;
21+
height-mm = <83>;
22+
bus-format = <0x1009>;
23+
24+
timing: panel-timing {
25+
clock-frequency = <29500000>;
26+
hactive = <800>;
27+
hfront-porch = <24>;
28+
hsync-len = <72>;
29+
hback-porch = <96>;
30+
hsync-active = <0>;
31+
vactive = <480>;
32+
vfront-porch = <3>;
33+
vsync-len = <10>;
34+
vback-porch = <7>;
35+
vsync-active = <0>;
36+
37+
de-active = <1>;
38+
pixelclk-active = <1>;
39+
};
40+
41+
port {
42+
panel_in: endpoint {
43+
remote-endpoint = <&dpi_out>;
44+
};
45+
};
46+
};
47+
};
48+
};
49+
50+
fragment@1 {
51+
target = <&dpi>;
52+
dpi_node: __overlay__ {
53+
status = "okay";
54+
55+
pinctrl-names = "default";
56+
pinctrl-0 = <&dpi_18bit_gpio0>;
57+
58+
port {
59+
dpi_out: endpoint {
60+
remote-endpoint = <&panel_in>;
61+
};
62+
};
63+
};
64+
};
65+
66+
__overrides__ {
67+
clock-frequency = <&timing>, "clock-frequency:0";
68+
hactive = <&timing>, "hactive:0";
69+
hfp = <&timing>, "hfront-porch:0";
70+
hsync = <&timing>, "hsync-len:0";
71+
hbp = <&timing>, "hback-porch:0";
72+
vactive = <&timing>, "vactive:0";
73+
vfp = <&timing>, "vfront-porch:0";
74+
vsync = <&timing>, "vsync-len:0";
75+
vbp = <&timing>, "vback-porch:0";
76+
hsync-invert = <&timing>, "hsync-active:0=0";
77+
vsync-invert = <&timing>, "vsync-active:0=0";
78+
de-invert = <&timing>, "de-active:0=0";
79+
pixclk-invert = <&timing>, "pixelclk-active:0=0";
80+
81+
width-mm = <&panel>, "width-mm:0";
82+
height-mm = <&panel>, "height-mm:0";
83+
84+
rgb565 = <&panel>, "bus-format:0=0x1017",
85+
<&dpi_node>, "pinctrl-0:0=",<&dpi_16bit_gpio0>;
86+
rgb666-padhi = <&panel>, "bus-format:0=0x1015",
87+
<&dpi_node>, "pinctrl-0:0=",<&dpi_18bit_cpadhi_gpio0>;
88+
rgb888 = <&panel>, "bus-format:0=0x100a",
89+
<&dpi_node>, "pinctrl-0:0=",<&dpi_gpio0>;
90+
bus-format = <&panel>, "bus-format:0";
91+
};
92+
};

0 commit comments

Comments
 (0)