From 9180aef18050636cd88be4adbb7c10ffc15fe5f4 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Sat, 8 Jul 2023 22:38:49 +0200 Subject: [PATCH] add overlay for vc4-kms-waveshare-28dpi --- .../files/dts/vc4-kms-waveshare-28dpi.dts | 101 ++++++++++++++++++ .../waveshare-2.8-lcd/waveshare-2.8-lcd.bb | 5 +- .../images/core-image-minimal.bbappend | 2 +- 3 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 recipes-bsp/waveshare-2.8-lcd/files/dts/vc4-kms-waveshare-28dpi.dts diff --git a/recipes-bsp/waveshare-2.8-lcd/files/dts/vc4-kms-waveshare-28dpi.dts b/recipes-bsp/waveshare-2.8-lcd/files/dts/vc4-kms-waveshare-28dpi.dts new file mode 100644 index 0000000..c936f71 --- /dev/null +++ b/recipes-bsp/waveshare-2.8-lcd/files/dts/vc4-kms-waveshare-28dpi.dts @@ -0,0 +1,101 @@ +/* + * vc4-kms-waveshare-28dpi-overlay.dts + */ + +/dts-v1/; +/plugin/; + +#include +#include + +/ { + compatible = "brcm,bcm2835"; + fragment@0 { + target = <&gpio>; + __overlay__ { + pwm_pins: pwm_pins { + brcm,pins = <18>; + brcm,function = ; + brcm,pull = <0>; + }; + }; + }; + + fragment@1 { + target = <&pwm>; + frag1: __overlay__ { + pinctrl-names = "default"; + pinctrl-0 = <&pwm_pins>; + assigned-clock-rates = <100000000>; + status = "okay"; + }; + }; + + fragment@2 { + target-path = "/"; + __overlay__ { + //#gpio-cells = <2>; + /* Panel backlight through PWM0_0 on GPIO18 */ + backlight_lvds: backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 10000000>; + brightness-levels = <0 1000>; + num-interpolated-steps = <1000>; + default-brightness-level = <1000>; + }; + + panel: panel { + reg = <0>; + compatible = "panel-dpi"; + backlight = <&backlight_lvds>; + + width-mm = <154>; + height-mm = <86>; + bus-format = <0x1015>; + + timing: panel-timing { + clock-frequency = <28000000>; + hactive = <480>; + hfront-porch = <26>; + hsync-len = <16>; + hback-porch = <10>; + hsync-active = <0>; + vactive = <640>; + vfront-porch = <25>; + vsync-len = <10>; + vback-porch = <16>; + vsync-active = <0>; + + de-active = <1>; + pixelclk-active = <1>; + }; + + port { + panel_in: endpoint { + remote-endpoint = <&dpi_out>; + }; + }; + }; + }; + }; + + fragment@3 { + target = <&dpi>; + dpi_node: __overlay__ { + status = "okay"; + + pinctrl-names = "default"; + + /* refer to /home/pi/linux/arch/arm/boot/dts/bcm270x.dtsi + * for the pin multiplex setting + */ + pinctrl-0 = <&dpi_18bit_cpadhi_gpio0>; + + port { + dpi_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/recipes-bsp/waveshare-2.8-lcd/waveshare-2.8-lcd.bb b/recipes-bsp/waveshare-2.8-lcd/waveshare-2.8-lcd.bb index 240e6b7..a8fbd3a 100644 --- a/recipes-bsp/waveshare-2.8-lcd/waveshare-2.8-lcd.bb +++ b/recipes-bsp/waveshare-2.8-lcd/waveshare-2.8-lcd.bb @@ -5,15 +5,16 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda inherit devicetree FILESEXTRAPATHS:prepend := "${THISDIR}/files:" -SRC_URI = " file://dts/ads1115-i2c-gpio.dts " +SRC_URI = " file://dts/ads1115-i2c-gpio.dts file://vc4-kms-waveshare-28dpi.dts " S = "${WORKDIR}/dts" -DT_FILES = "ads1115-i2c-gpio.dtbo" +DT_FILES = "ads1115-i2c-gpio.dtbo vc4-kms-waveshare-28dpi.dtbo" COMPATIBLE_MACHINE = "raspberrypi.*" do_deploy:append () { install -d ${DEPLOY_DIR_IMAGE} + install -m 0755 ${B}/vc4-kms-waveshare-28dpi.dtbo ${DEPLOY_DIR_IMAGE}/vc4-kms-waveshare-28dpi.dtbo install -m 0755 ${B}/ads1115-i2c-gpio.dtbo ${DEPLOY_DIR_IMAGE}/ads1115-i2c-gpio.dtbo install -m 0755 ${THISDIR}/files/vc4-kms-DPI-28inch.dtbo ${DEPLOY_DIR_IMAGE}/vc4-kms-DPI-28inch.dtbo install -m 0755 ${THISDIR}/files/waveshare-28dpi-3b-4b.dtbo ${DEPLOY_DIR_IMAGE}/waveshare-28dpi-3b-4b.dtbo diff --git a/recipes-core/images/core-image-minimal.bbappend b/recipes-core/images/core-image-minimal.bbappend index f9678c5..ade530a 100644 --- a/recipes-core/images/core-image-minimal.bbappend +++ b/recipes-core/images/core-image-minimal.bbappend @@ -1,6 +1,6 @@ inherit extrausers -KERNEL_DEVICETREE:append = "${@bb.utils.contains('RPI_USE_wS_28_DPI_LCD', '1', ' overlays/dpi24.dtbo overlays/vc4-kms-dpi-generic.dtbo overlays/ads1115-i2c-gpio.dtbo overlays/ads1115-i2c-gpio.dtbo overlays/vc4-kms-DPI-28inch.dtbo overlays/waveshare-28dpi-3b-4b.dtbo overlays/waveshare-28dpi-3b.dtbo overlays/waveshare-28dpi-4b.dtbo ', ' ', d)}" +KERNEL_DEVICETREE:append = "${@bb.utils.contains('RPI_USE_wS_28_DPI_LCD', '1', ' overlays/vc4-kms-waveshare-28dpi.dtbo overlays/dpi24.dtbo overlays/vc4-kms-dpi-generic.dtbo overlays/ads1115-i2c-gpio.dtbo overlays/ads1115-i2c-gpio.dtbo overlays/vc4-kms-DPI-28inch.dtbo overlays/waveshare-28dpi-3b-4b.dtbo overlays/waveshare-28dpi-3b.dtbo overlays/waveshare-28dpi-4b.dtbo ', ' ', d)}" EXTRA_USERS_PARAMS = "usermod -p BJpK8ADNDLsGg root; \