openwrt/target/linux/bcm27xx/patches-5.15/950-0680-dtoverlays-Rework-vc4-kms-dpi-overlays-to-remove-dup.patch
Álvaro Fernández Rojas 20ea6adbf1 bcm27xx: add support for linux v5.15
Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2022-05-17 15:11:22 +02:00

546 lines
13 KiB
Diff

From 2cc810fd22f30acabbf5e6726e003c5da56d3212 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Mon, 31 Jan 2022 17:25:19 +0000
Subject: [PATCH] dtoverlays: Rework vc4-kms-dpi overlays to remove
duplication
Removes all the common panel, dpi, and backlight configuration
from the individual vc4-kms-dpi-* files into vc4-kms-dpi.dtsi.
Creates a new vc4-kms-dpi-panel-overlay.dts for preconfigured
panels, with overrides to enable the different panel configurations.
Deprecates vc4-kms-dpi-at056tn53v1 as superceded by vc4-kms-dpi-panel.
vc4-kms-kippah-7inch not deprecated for now as it is likely to be
in wider use than at056tn53v1.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
arch/arm/boot/dts/overlays/Makefile | 2 +-
arch/arm/boot/dts/overlays/README | 33 ++++-
arch/arm/boot/dts/overlays/overlay_map.dts | 4 +
.../vc4-kms-dpi-at056tn53v1-overlay.dts | 44 ------
.../overlays/vc4-kms-dpi-generic-overlay.dts | 138 ++++--------------
.../overlays/vc4-kms-dpi-panel-overlay.dts | 62 ++++++++
arch/arm/boot/dts/overlays/vc4-kms-dpi.dtsi | 109 ++++++++++++++
.../overlays/vc4-kms-kippah-7inch-overlay.dts | 27 +---
8 files changed, 235 insertions(+), 184 deletions(-)
delete mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-at056tn53v1-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/vc4-kms-dpi.dtsi
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -234,8 +234,8 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
upstream-pi4.dtbo \
vc4-fkms-v3d.dtbo \
vc4-fkms-v3d-pi4.dtbo \
- vc4-kms-dpi-at056tn53v1.dtbo \
vc4-kms-dpi-generic.dtbo \
+ vc4-kms-dpi-panel.dtbo \
vc4-kms-dsi-7inch.dtbo \
vc4-kms-dsi-lt070me05000.dtbo \
vc4-kms-dsi-lt070me05000-v2.dtbo \
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -3624,10 +3624,8 @@ Params: cma-512 CMA is 5
Name: vc4-kms-dpi-at056tn53v1
-Info: Enable an Innolux 5.6in VGA TFT connected to DPI interface under KMS.
- Requires vc4-kms-v3d to be loaded.
-Load: dtoverlay=vc4-kms-dpi-at056tn53v1
-Params: <None>
+Info: This overlay is now deprecated - see vc4-kms-dpi-panel,at056tn53v1
+Load: <Deprecated>
Name: vc4-kms-dpi-generic
@@ -3659,6 +3657,33 @@ Params: clock-frequency Display
backlight-gpio Defines a GPIO to be used for backlight control
(default of none).
backlight-pwm Defines a PWM channel to be used for backlight
+ control (default of none). NB Disables audio
+ headphone output as that also uses PWM.
+ backlight-pwm-chan Choose channel on &pwm node for backlight
+ control.
+ (default 0).
+ backlight-pwm-gpio GPIO pin to be used for the PWM backlight. See
+ pwm-2chan for valid options.
+ (default 18 - note this can only work with
+ rgb666-padhi).
+ backlight-pwm-func Pin function of GPIO used for the PWM
+ backlight.
+ See pwm-2chan for valid options.
+ (default 2).
+ backlight-def-brightness
+ Set the default brightness. Normal range 1-16.
+ (default 16).
+
+
+Name: vc4-kms-dpi-panel
+Info: Enable a preconfigured KMS DPI panel.
+ Requires vc4-kms-v3d to be loaded.
+Load: dtoverlay=vc4-kms-dpi-panel,<param>=<val>
+Params: at056tn53v1 Enable an Innolux 5.6in VGA TFT
+ kippah-7inch Enable an Adafruit Kippah with 7inch panel.
+ backlight-gpio Defines a GPIO to be used for backlight control
+ (default of none).
+ backlight-pwm Defines a PWM channel to be used for backlight
control (default of none). NB Disables audio
headphone output as that also uses PWM.
backlight-pwm-chan Choose channel on &pwm node for backlight
--- a/arch/arm/boot/dts/overlays/overlay_map.dts
+++ b/arch/arm/boot/dts/overlays/overlay_map.dts
@@ -151,6 +151,10 @@
bcm2711;
};
+ vc4-kms-dpi-at056tn53v1 {
+ deprecated = "use vc4-kms-dpi-panel,at056tn53v1";
+ };
+
vc4-kms-v3d {
bcm2835;
bcm2711 = "vc4-kms-v3d-pi4";
--- a/arch/arm/boot/dts/overlays/vc4-kms-dpi-at056tn53v1-overlay.dts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * vc4-kms-dpi-at056tn53v1-overlay.dts
- */
-
-/dts-v1/;
-/plugin/;
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/pinctrl/bcm2835.h>
-
-/ {
- compatible = "brcm,bcm2835";
-
- fragment@0 {
- target-path = "/";
- __overlay__ {
- panel: panel {
- compatible = "innolux,at056tn53v1", "simple-panel";
-
- port {
- panel_in: endpoint {
- remote-endpoint = <&dpi_out>;
- };
- };
- };
- };
- };
-
- fragment@1 {
- target = <&dpi>;
- __overlay__ {
- status = "okay";
-
- pinctrl-names = "default";
- pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
-
- port {
- dpi_out: endpoint {
- remote-endpoint = <&panel_in>;
- };
- };
- };
- };
-};
--- a/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
+++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-generic-overlay.dts
@@ -5,124 +5,43 @@
/dts-v1/;
/plugin/;
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/pinctrl/bcm2835.h>
+#include "vc4-kms-dpi.dtsi"
/ {
compatible = "brcm,bcm2835";
fragment@0 {
- target-path = "/";
- __overlay__ {
- panel: panel {
- compatible = "panel-dpi";
-
- width-mm = <154>;
- height-mm = <83>;
- bus-format = <0x1009>;
-
- timing: panel-timing {
- clock-frequency = <29500000>;
- hactive = <800>;
- hfront-porch = <24>;
- hsync-len = <72>;
- hback-porch = <96>;
- hsync-active = <1>;
- vactive = <480>;
- vfront-porch = <3>;
- vsync-len = <10>;
- vback-porch = <7>;
- vsync-active = <1>;
-
- de-active = <1>;
- pixelclk-active = <1>;
- };
-
- port {
- panel_in: endpoint {
- remote-endpoint = <&dpi_out>;
- };
- };
- };
- };
- };
-
- fragment@1 {
- target = <&dpi>;
- dpi_node: __overlay__ {
- status = "okay";
-
- pinctrl-names = "default";
- pinctrl-0 = <&dpi_18bit_gpio0>;
-
- port {
- dpi_out: endpoint {
- remote-endpoint = <&panel_in>;
- };
- };
- };
- };
-
- fragment@2 {
- target = <&panel>;
- __dormant__ {
- backlight = <&backlight>;
- };
- };
-
- fragment@3 {
- target-path = "/";
- __dormant__ {
- backlight: backlight {
- compatible = "gpio-backlight";
- gpios = <&gpio 255 GPIO_ACTIVE_HIGH>;
- };
- };
- };
-
- fragment@4 {
target = <&panel>;
- __dormant__ {
- backlight = <&backlight_pwm>;
- };
- };
-
- fragment@5 {
- target-path = "/";
- __dormant__ {
- backlight_pwm: backlight_pwm {
- compatible = "pwm-backlight";
- brightness-levels = <0 6 8 12 16 24 32 40 48 64 96 128 160 192 224 255>;
- default-brightness-level = <16>;
- pwms = <&pwm 0 200000>;
- };
- };
- };
+ __overlay__ {
+ compatible = "panel-dpi";
- fragment@6 {
- target = <&pwm>;
- __dormant__ {
- pinctrl-names = "default";
- pinctrl-0 = <&pwm_pins>;
- assigned-clock-rates = <1000000>;
- status = "okay";
- };
- };
+ width-mm = <154>;
+ height-mm = <83>;
+ bus-format = <0x1009>;
+
+ timing: panel-timing {
+ clock-frequency = <29500000>;
+ hactive = <800>;
+ hfront-porch = <24>;
+ hsync-len = <72>;
+ hback-porch = <96>;
+ hsync-active = <1>;
+ vactive = <480>;
+ vfront-porch = <3>;
+ vsync-len = <10>;
+ vback-porch = <7>;
+ vsync-active = <1>;
- fragment@7 {
- target = <&gpio>;
- __dormant__ {
- pwm_pins: pwm_pins {
- brcm,pins = <18>;
- brcm,function = <2>; /* Alt5 */
+ de-active = <1>;
+ pixelclk-active = <1>;
};
};
};
- fragment@8 {
- target = <&audio>;
- __dormant__ {
- brcm,disable-headphones;
+ fragment@1 {
+ target = <&dpi>;
+ __overlay__ {
+ pinctrl-0 = <&dpi_18bit_gpio0>;
};
};
@@ -151,12 +70,5 @@
rgb888 = <&panel>, "bus-format:0=0x100a",
<&dpi_node>, "pinctrl-0:0=",<&dpi_gpio0>;
bus-format = <&panel>, "bus-format:0";
- backlight-gpio = <0>, "+2+3",
- <&backlight>, "gpios:4";
- backlight-pwm = <0>, "+4+5+6+7+8";
- backlight-pwm-chan = <&backlight_pwm>, "pwms:4";
- backlight-pwm-gpio = <&pwm_pins>, "brcm,pins:0";
- backlight-pwm-func = <&pwm_pins>, "brcm,function:0";
- backlight-def-brightness = <&backlight_pwm>, "default-brightness-level:0";
};
};
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi-panel-overlay.dts
@@ -0,0 +1,62 @@
+/*
+ * vc4-kms-dpi-panel-overlay.dts
+ * Support for any predefined DPI panel.
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include "vc4-kms-dpi.dtsi"
+
+/ {
+ compatible = "brcm,bcm2835";
+
+ fragment@0 {
+ target = <&panel>;
+ __dormant__ {
+ compatible = "innolux,at056tn53v1", "simple-panel";
+ };
+ };
+ fragment@1 {
+ target = <&panel>;
+ __dormant__ {
+ compatible = "ontat,yx700wv03", "simple-panel";
+ };
+ };
+
+ fragment@90 {
+ target = <&dpi>;
+ __dormant__ {
+ pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>;
+ };
+ };
+ fragment@91 {
+ target = <&dpi>;
+ __dormant__ {
+ pinctrl-0 = <&dpi_18bit_gpio0>;
+ };
+ };
+ fragment@92 {
+ target = <&dpi>;
+ __dormant__ {
+ pinctrl-0 = <&dpi_gpio0>;
+ };
+ };
+ fragment@93 {
+ target = <&dpi>;
+ __dormant__ {
+ pinctrl-0 = <&dpi_16bit_cpadhi_gpio0>;
+ };
+ };
+ fragment@94 {
+ target = <&dpi>;
+ __dormant__ {
+ pinctrl-0 = <&dpi_16bit_gpio0>;
+ };
+ };
+
+ __overrides__ {
+ at056tn53v1 = <0>, "+0+90";
+ kippah-7inch = <0>, "+1+91";
+ };
+};
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/vc4-kms-dpi.dtsi
@@ -0,0 +1,109 @@
+/*
+ * vc4-kms-dpi.dtsi
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/bcm2835.h>
+
+/ {
+ fragment@100 {
+ target-path = "/";
+ __overlay__ {
+ panel: panel {
+ port {
+ panel_in: endpoint {
+ remote-endpoint = <&dpi_out>;
+ };
+ };
+ };
+ };
+ };
+
+ fragment@101 {
+ target = <&dpi>;
+ dpi_node: __overlay__ {
+ status = "okay";
+
+ pinctrl-names = "default";
+
+ port {
+ dpi_out: endpoint {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+ };
+ };
+
+ fragment@102 {
+ target = <&panel>;
+ __dormant__ {
+ backlight = <&backlight>;
+ };
+ };
+
+ fragment@103 {
+ target-path = "/";
+ __dormant__ {
+ backlight: backlight {
+ compatible = "gpio-backlight";
+ gpios = <&gpio 255 GPIO_ACTIVE_HIGH>;
+ };
+ };
+ };
+
+ fragment@104 {
+ target = <&panel>;
+ __dormant__ {
+ backlight = <&backlight_pwm>;
+ };
+ };
+
+ fragment@105 {
+ target-path = "/";
+ __dormant__ {
+ backlight_pwm: backlight_pwm {
+ compatible = "pwm-backlight";
+ brightness-levels = <0 6 8 12 16 24 32 40 48 64 96 128 160 192 224 255>;
+ default-brightness-level = <16>;
+ pwms = <&pwm 0 200000>;
+ };
+ };
+ };
+
+ fragment@106 {
+ target = <&pwm>;
+ __dormant__ {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pwm_pins>;
+ assigned-clock-rates = <1000000>;
+ status = "okay";
+ };
+ };
+
+ fragment@107 {
+ target = <&gpio>;
+ __dormant__ {
+ pwm_pins: pwm_pins {
+ brcm,pins = <18>;
+ brcm,function = <2>; /* Alt5 */
+ };
+ };
+ };
+
+ fragment@108 {
+ target = <&audio>;
+ __dormant__ {
+ brcm,disable-headphones;
+ };
+ };
+
+ __overrides__ {
+ backlight-gpio = <0>, "+102+103",
+ <&backlight>, "gpios:4";
+ backlight-pwm = <0>, "+104+105+106+107+108";
+ backlight-pwm-chan = <&backlight_pwm>, "pwms:4";
+ backlight-pwm-gpio = <&pwm_pins>, "brcm,pins:0";
+ backlight-pwm-func = <&pwm_pins>, "brcm,function:0";
+ backlight-def-brightness = <&backlight_pwm>, "default-brightness-level:0";
+ };
+};
--- a/arch/arm/boot/dts/overlays/vc4-kms-kippah-7inch-overlay.dts
+++ b/arch/arm/boot/dts/overlays/vc4-kms-kippah-7inch-overlay.dts
@@ -1,43 +1,26 @@
/*
- * vc4-kms-v3d-overlay.dts
+ * vc4-kms-kippah-7inch-overlay.dts
*/
/dts-v1/;
/plugin/;
-#include <dt-bindings/pinctrl/bcm2835.h>
+#include "vc4-kms-dpi.dtsi"
/ {
compatible = "brcm,bcm2835";
fragment@0 {
- target-path = "/";
- __overlay__ {
- panel: panel {
- compatible = "ontat,yx700wv03", "simple-panel";
-
- port {
- panel_in: endpoint {
- remote-endpoint = <&dpi_out>;
- };
- };
- };
+ target = <&panel>;
+ __overlay__ {
+ compatible = "ontat,yx700wv03", "simple-panel";
};
};
fragment@1 {
target = <&dpi>;
__overlay__ {
- status = "okay";
-
- pinctrl-names = "default";
pinctrl-0 = <&dpi_18bit_gpio0>;
-
- port {
- dpi_out: endpoint@0 {
- remote-endpoint = <&panel_in>;
- };
- };
};
};
};