Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3556

Interfacing (DSI, CSI, I2C, etc.) • Re: ST7701 DSI Screen - Using mainline or vender specific file on CM4

$
0
0
So I've followed the steps here to download and compile the kernel: https://www.raspberrypi.com/documentati ... ernel.html

I've gone in and edited/added:
  1. /linux/drivers/gpu/drm/panel/panel-sitronix-st7701.c - adding in duplicate functions based (on the TS8550b) of the init_sequence, gip_sequence, drm_display_mode, and st7701_panel_desc. Only making edits to the drm_display_mode function and the references in the st7701_panel_desc.

    edited drm_display_mode:

    Code:

    static const struct drm_display_mode custom_mode = {        .clock          = 29300,        .hdisplay       = 480,        .hsync_start    = 480 + 40,        .hsync_end      = 480 + 40 + 40,        .htotal         = 480 + 40 + 40 + 30,        .vdisplay       = 800,        .vsync_start    = 800 + 8,        .vsync_end      = 800 + 8 + 16,        .vtotal         = 800 + 8 + 16 + 4,        .width_mm       = 56,        .height_mm      = 94,        .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED,};
    edited st7701_panel_desc:

    Code:

    static const struct st7701_panel_desc custom_desc = {        .mode = &custom_mode,        .lanes = 2,        .format = MIPI_DSI_FMT_RGB888,        .panel_sleep_delay = 80, /* panel need extra 80ms for sleep out cmd */        .init_sequence = custom_init_sequence,        .conn_type = DRM_MODE_CONNECTOR_DSI,        .interface = ST7701_CTRL_DSI,
    edited .compatible string to allow the dts file to reference the new functions

    Code:

    static const struct of_device_id st7701_dsi_of_match[] = {        { .compatible = "densitron,dmt028vghmcmi-1a", .data = &dmt028vghmcmi_1a_desc },        { .compatible = "techstar,ts8550b", .data = &ts8550b_desc },        { .compatible = "custom,custom", .data = &custom_desc },        { }
  2. /linux/arch/arm64/boot/dts/overlays/ - i've added a dts file

    dts file - "custom-panel.dts":

    Code:

    /dts-v1/;/plugin/;/ {    compatible = "brcm,bcm2835";    fragment@0 {        target = <&dsi1>;        __overlay__ {            status = "okay";            #address-cells = <1>;            #size-cells = <0>;            port {                dsi_out:endpoint {                    remote-endpoint = <&panel_dsi_port>;                };            };            panel: panel-dsi-custom@0 {                compatible = "custom,custom", "sitronix,st7701";                reg=<0>;                VCC-supply = <&reg_dldo2>;                IOVCC-supply = <&reg_dldo2>;                reset-gpio = <&gpio 20 1>;                port {                    panel_dsi_port: endpoint {                        remote-endpoint = <&dsi_out>;                    };                };            };        };    };    fragment@1 {        target = <&gpio>;        __overlay__ {            gpio_pins: gpio_pins {                brcm,pins = <20>;                brcm,function = <1>;                brcm,pull =<0>;            };        };    };};
  3. I added "dtoverlay=custom-panel" to /boot/config.txt
When the CM4 boots, I don't see an image and the screen configuration doesn't show any DSI display. Checking dmesg has no reference to dsi being loaded at all so I'm not sure if that points to a dts/dtoverlay issue or to the driver.

Statistics: Posted by ncarley — Wed Jan 24, 2024 5:48 am



Viewing all articles
Browse latest Browse all 3556

Trending Articles