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.

AM3354: LCD support in U-boot

Part Number: AM3354

Hi all,

I use latest Processor SDK Linux v06.01: u-boot-2019.01+gitAUTOINC+029e4c009a-g029e4c009a. 

Currently I am trying to add lcd driver to u-boot source code and parse a simple image as splash screen on my display. The board I use is basically BBB + LCD display (Ampire).
I've used the following thread as reference:
  https://e2e.ti.com/support/processors/f/791/t/217383

I've added CONFIG_LCD_TCM to am335x_evm.h in order to add the driver/lcd sources to u-boot image & to the u-boot build. The lcd driver is successfully built within u-boot source code. I've added the following calls in board.c file (in int board_init(void) function) in order to init the display and add the splash screen:
  //Request lcd on gpio 3,18
        gpio_request(GPIO_LCD_ON, "lcd_on");
        udelay(1000);
//Request backlight gpio 3,17
        gpio_request(GPIO_BACKLIGHT, "backlight");
        gpio_direction_output(GPIO_BACKLIGHT, 0);
/*Initialize LCD*/
        Lcd_Init();
        udelay(1000);
        gpio_direction_output(GPIO_LCD_ON, 1);
        udelay(1000);

However I only get the backlight enabled, but display does not seem to be properly initialized (NO SPLASH SCREEN on the display).

I also tried adding the driver  to am335x.dtsi:
  lcdc: lcdc@4830e000 {
            compatible = "ti,lcd_tcm";              //this is my modification
            reg = <0x4830e000 0x1000>;

and then in am335x-boneblack.dts

&lcdc {
            status = "okay";

}

Also modified the rasterDisplay.c from the above sources by adding:

/*dummy priv_data declaration*/
struct lcd_tcm_priv {
     unsigned long int regs;
};
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
static const struct udevice_id lcd_tcm_ids[] = {
        {.compatible = "ti,lcd_tcm"},
        {}
};

U_BOOT_DRIVER(rasterDisplay) = {
        .name     = "rasterDisplay",
        .id       = UCLASS_TCM,       //this was
        .of_match = "lcd_tcm_ids",
        .probe    = "lcd_tcm_probe",
        .priv_auto_alloc_size = sizeof(struct lcd_tcm_priv),
};

and also a simple probe function:

/*
**dummy LCD probe function, which just calls LcdInit();
*/
static int lcd_tcm_probe (struct udevice *dev)
{
   struct lcd_tcm_priv *priv = dev_get_priv(dev);
   Lcd_Init();
   return 0;
};

to try and bind the rasterDisplay.c to the dts file. But after these modifications the u-boot got stuck at: "Trying to boot from MMC1".

Can you please advise if I am missing something?

Thanks and regards.

  • Hi Dakata,

    U-Boot based LCD splash screens is something we currently do not support out-of-the box, so that earlier thread you already found is probably as good of a starting point as there currently is. As it was highlighted there an LCD not working can have a multitude of setup related reasons, and is a little too complex to debug remotely, especially in an U-Boot environment.

    I assume you have that LCD already working under Linux? If so one way to debug is would be to understand/instrument the associated Linux driver code and see what differences there are in terms of display related setup including clock and reset signals, etc. I'd probably also use a JTAG debugger to try to experiment with device settings in a live debug session to speed up things a little. This may not be the answer you were looking for however it should be possible to use this as a starting point of sorts.

    I'm also going to add this idea/request to our internal "create backlog" of projects to work on (and publish).

    Regards, Andreas

  • Hi Andreas,

    I assume you have that LCD already working under Linux?

    I am working on that, as there are some issues when enabling the DRM driver for this board. I suppose it is a dts issue, but this is another topic.

    If so one way to debug is would be to understand/instrument the associated Linux driver code and see what differences there are in terms of display related setup including clock and reset signals, etc. I'd probably also use a JTAG debugger to try to experiment with device settings in a live debug session to speed up things a little.

    The JTAG was my last resort for debugging this. The thing is this board worked with older u-boot (TI Sitara SDK version 06.00.00.00, U-Boot version is 2013.01.01) & the code provided in the referenced e2e thread. So as for LCDC settings they should be correct.

    What has changed between versions is the addition of the dts file in u-boot, so I was wondering whether simply calling Lcd_Init() from board.c is enough to get the LCD working, or should I add it in the dts file in order to get u-boot to execute the code from drivers/lcd? 

    Thanks and regards.

  • Hi Andreas,

    Update on this issue. I got the display working and displaying the image on the LCD.

    You were right, I've mistakenly written some wrong values in LCDC registers. Closing this thread.

    Just an FYI, the methodology is exactly the same as described in the linked e2e thread in my original post, users should just take care of the specific register configurations for the AM335x device.

    Best Regards,
    Yordan