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.

[OMAP L-138] da8xx-fb.c bug report

Hi all, my first post here !!

I was working on the LCD initialisation in U-Boot on the OMAP L-138 evaluation board, to get a splash screen as fast as possible after switching on the board, it works great, but when Linux does the LCD initialisations in the file da8xx-fb.c, sometimes it works, and sometimes it fails (DMA stop working, so the screen is freezed and can't be modified anymore).

After a week of bug-hunting, I found that, in the Technical Reference, page 1037:

"If you clear RASTER_EN bit while the LCD controller is enabled, you can complete transmission of the current frame before being disabled. Completion of the
current frame is signaled by the LCD controller to the DMA by setting the frame done (Done) bit within the LCD controller status register"

In the Linux driver, the function lcd_raster_disable() disable the  RASTER_EN bit, but it doesn't wait until the bit "Done" is set if the DMA was running, and start the registers configurations right away. It will work if the DMA was stopped, but not if it was refreshing the screen.

So here is my modification to this function:

file: linux/drivers/video/da8xx-fb.c

static inline void lcd_disable_raster(void)
{
    u32 reg;

    reg = lcdc_read(LCD_RASTER_CTRL_REG);
    if (reg & LCD_RASTER_ENABLE)
    {
        lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG);

        while(!(lcdc_read(LCD_STAT_REG) & 0x1))
            ;
    }
}

And now, it works great !

I hope this will help someone !

Best regards,

Sylvain Villet

Audio Technology Switzerland

  • Hi Sylvain Villet,

    Thanks for providing your findings.

    Please provide the Linux Kernel version details.

    In which scenario, you find this problem.

    -Thanks,

    Balaji N

     

     

  • Hi,

    I'm using the Linux 2.6.37 kernel provided in the OMAP L138 DVSDK 04.03.00.06 (the current version on TI.com)

    The problem occurs when the LCDC is already running when Linux is booting. (Initialized during U-Boot startup)

    If the LCDC is refreshing the screen when Linux tries to change the configuration in the registers, the screen will be frozen, because the LCDC will finish refreshing the screen before he stops, and it must be stopped before the configurations are changed.

  • If you want to try, here is my modified version of U-Boot.

    3348.u-boot.rar

    In the kernel, I don't disable the LCD and Backlight power in the board file:

    board-da850-evm.c:da850_lcd_hw_init()

        gpio_direction_output(DA850_LCD_BL_PIN, 1);
        gpio_direction_output(DA850_LCD_PWR_PIN, 1);

    and in the driver file, I make a copy of U-Boot's framebuffer into the newely allocated Linux Framebuffer, so the splash screen stay visible during all the startup process.

  • Dear Sylvain Villet,

    Sylvain Villet said:
    I was working on the LCD initialisation in U-Boot on the OMAP L-138 evaluation board, to get a splash screen as fast as possible after switching on the board, it works great, but when Linux does the LCD initialisations in the file da8xx-fb.c, sometimes it works, and sometimes it fails (DMA stop working, so the screen is freezed and can't be modified anymore).

    nice that you done the Framebuffer Support for the L138 in u-boot. Are there plans to post this patches to th u-boot mailinglist?

    Regards,

    Bastian.