This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4378: custom LCD panel configuration in u-boot.

Part Number: AM4378

Hi all,

I'm facing a issue with the LCD driver in u-boot. I have followed the steps specified in the following post.

https://e2e.ti.com/support/processors/f/791/t/468554

I have updated my u-boot source code files accordingly. But I'm stuck with the LCD panel timing and clock configuration.

These are my current LCD configurations :

Kernel DTB file LCD node : 

lcd0: display {
compatible = "newhaven,nhd-4.3-480272ef-atxl", "panel-dpi";
label = "lcd";

pinctrl-names = "default";
pinctrl-0 = <&lcd_pins>;

backlight = <&lcd_bl>;

enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;

panel-timing {
clock-frequency = <40000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <40>;
hback-porch = <88>;
hsync-len = <128>;
vfront-porch = <13>;
vback-porch = <32>;
vsync-len = <45>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <1>;
};

port {
lcd_in: endpoint {
remote-endpoint = <&dpi_out>;
};
};
};

These configurations are working fine in the kernel . I'm facing a issue while configuring these parameters in u-boot.

Please let me know how to add these parameters to u-boot source.

Thanks !

  • Hi Harsha,
    There's an earlier guide on how to add u-boot splash screen
    software-dl.ti.com/.../Foundational_Components_U-Boot.html
    Hope it will help you add LCD panel configuration in u-boot.
    Best,
    -Hong

  • Hi Hong,

    The one you are referring is for AM335X which does not use DSS module.

    But in the case of AM437X it contains a DSS module which needs to be configured according to custom LCD configurations. So this does not work for me.

    Thanks for the reply !

  • Hi Harsha,
    For your reference, there's a link on kernel driver (omapdrm) for DSS
    software-dl.ti.com/.../DSS.html
    omapdrm is a Direct Rendering Manager (DRM) driver, located in the kernel directory drivers/gpu/drm/omapdrm/
    But I'm not aware of such support in u-boot.

    One reference on u-boot splash screen is e2e.ti.com/.../2592257

    Best,
    -Hong

  • Hi Hong,

    I have gone through this reference link : software-dl.ti.com/.../DSS.html. It is about the DSS module

    ,but I'm stuck with the DSS module configurations. 

    I have referred this link : e2e.ti.com/.../2592257 to enable LCD support in u-boot. My concern is related to the timing parameters that need to be configured according to the LCD panel.

    static const struct panel_config dvid_cfg = {
            .timing_h       = 0x01d0631d, /* Horizontal timing */
            .timing_v       = 0x00a00a02, /* Vertical timing */
            .pol_freq       = 0x00027000, /* Pol Freq */
            .divisor        = 0x00010002, /* 72Mhz Pixel Clock */
            .lcd_size       = 0x031f04ff, /* 1280x800 */
            .panel_type     = 0x01, /* TFT */
            .data_lines     = 0x03, /* 24 Bit RGB */
            .load_mode      = 0x02, /* Frame Mode */
            .panel_color    = 0, /* BLACK */
            .gfx_format     = GFXFORMAT_RGB24_UNPACKED,
    };

    Please let me know if there are any references related to the timing parameters calculations.

    Thanks for the reply !

  • Hi Harsha,
    Please note that porting work referenced in the below link was developed by community member.
    e2e.ti.com/.../2592257
    From code snippet below, panel_cfg structure elements needs to be configured first based on LCD panel, and then written into the
    corresponding DSS_DISPC registers as described in more details in Table 13-41. DSS_DISPC Registers of AM437x TRM

            writel(panel_cfg->timing_h, &dispc->timing_h);
            writel(panel_cfg->timing_v, &dispc->timing_v);
            writel(panel_cfg->pol_freq, &dispc->pol_freq);
            writel(panel_cfg->divisor, &dispc->divisor);
            writel(panel_cfg->lcd_size, &dispc->size_lcd);
            writel(panel_cfg->load_mode << LOADMODE_SHIFT, &dispc->config);
            writel( GP_OUT0 | GP_OUT1 |
                    panel_cfg->panel_type << TFTSTN_SHIFT |
                    panel_cfg->data_lines << DATALINES_SHIFT, &dispc->control);
            writel(panel_cfg->panel_color, &dispc->default_color0);
            writel((u32) panel_cfg->frame_buffer, &dispc->gfx_ba0);
            writel((u32) panel_cfg->frame_buffer, &dispc->gfx_ba1);

    Best,

    -Hong

  • Hi Hong,

    I have tried to configure the panel_cfg structure according to my LCD timing parameters that I mentioned earlier. 

    But there are no references to the calculations of the writel(panel_cfg->divisor, &dispc->divisor); 

    I'm stuck with the LCD panel frequency configuration. Most of the other parameters I have configured in the DISPC  Register.

    Please let me know if there are any references related to the timing parameters calculations.

    Thanks for the reply !

  • Hi Harsha,
    My understanding from your original post is your LCD panel display works in the kernel.
    If that is the case, one option for you to set-up the panel_cfg structure in u-boot for your LCD panel is "dump" DSS_DISPC registers after kernel up.
    I'm attaching the screen-shot on DSS_DISPC registers captured via T32 JTAG debugger on AM437x GP EVM after the kernel up running.
    Alternative is reading DSS_DISPC registers via devmem2 @kernel prompt.
    For example, reading DISPC_DIVISOR register @0x4832A470 is listed below for your reference:

    root@am437x-evm:~# devmem2 0x4832a470
    /dev/mem opened.
    Memory mapped at address 0xb6ff5000.
    Read at address  0x4832A470 (0xb6ff5470): 0x00010006

    Best,

    -Hong

  • Attaching the screen-shot on DSS_DISPC registers captured via T32 JTAG debugger on AM437x GP EVM.

  • Hi Hong,

    This helped me to solve the panel configuration issue. But still I don't see anything on the display I see a blank display.

    I think this issue is related to frame buffer. I have tried writing data to the frame buffer with the mw.w u-boot command I didn't see any of it reflected on the LCD.

    Can you please let know if you have any suggestion related to this issue.

    Thanks for the reply !