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.

Enabling 16 bit LCD mode for Beaglebone Black

Other Parts Discussed in Thread: DA8XX

I am Building a Yocto based filesystem, using the Beaglebone Black, the 4DCAPE-43T.

Using the meta-arago, and meta-ti as a base, running linux-3.12.20 using a custom dts file based

on the am335x-boneblack.dts.

When I boot, I get the TUX icon with Blue feet, and people have told me that it is related to a bug

in the chip, which occurs, when I am driving a 16 bit LCD in 24 bit mode.

Some people suggest modifying the driver/video/da8xx-fb.c files, and swap the bytes there,

but I feel it is better to set the chip in 16 bit mode.

Can this be done in the device tree file?

If so, how?

Here is a list of active modules

root@beaglebone:~# lsmod
Module                  Size  Used by
bufferclass_ti          5405  0
omaplfb                11410  1
ipv6                  241475  30
musb_dsps               6511  0
musb_hdrc              52570  1 musb_dsps
snd_soc_omap            2494  0
snd_pcm_dmaengine       2997  1 snd_soc_omap
snd_soc_core           99213  1 snd_soc_omap
snd_compress            7403  1 snd_soc_core
regmap_spi              1469  1 snd_soc_core
snd_pcm                66678  3 snd_soc_core,snd_soc_omap,snd_pcm_dmaengine
snd_page_alloc          4843  1 snd_pcm
snd_timer              16028  1 snd_pcm
snd                    45368  4 snd_soc_core,snd_timer,snd_pcm,snd_compress
soundcore               4767  1 snd
pvrsrvkm              175491  6 bufferclass_ti,omaplfb
musb_am335x             1199  0

  • Hi Ulf,

    Please check AM335X Errata Usage Note 3.1.1. You will notice that red and blue color output pins are swapped for 16 and 24 bit mode. If you set the LCD controller in 16-bit mode you will not be able to use the HDMI output. I will ask a software expert to check what you need to change in the device tree for 16-bit mode.

  • OK, studied what happen a little bit more.

    The Graphics driver used is the omaplfb. This comes from the omap3-sgx-modules recipe.

    I guess, I need to have the DeviceTree setup for the Graphic Toolkit

    (Graphics_SDK_setuplinux_hardfp_5_01_01_01.bin)

  • Hi Ulf,

    You need to remove the upper 8 signal bits from the device tree lcd pinmux configuration:

                    0x20 0x01    /* gpmc_ad8.lcd_data16, OUTPUT | MODE1 */
                    0x24 0x01    /* gpmc_ad9.lcd_data17, OUTPUT | MODE1 */
                    0x28 0x01    /* gpmc_ad10.lcd_data18, OUTPUT | MODE1 */
                    0x2c 0x01    /* gpmc_ad11.lcd_data19, OUTPUT | MODE1 */
                    0x30 0x01    /* gpmc_ad12.lcd_data20, OUTPUT | MODE1 */
                    0x34 0x01    /* gpmc_ad13.lcd_data21, OUTPUT | MODE1 */
                    0x38 0x01    /* gpmc_ad14.lcd_data22, OUTPUT | MODE1 */
                    0x3c 0x01    /* gpmc_ad15.lcd_data23, OUTPUT | MODE1 */

    You also need to change the .bpp member of the panel-info structure to 16.

    Best regards,
    Miroslav

  • The Framebuffer driver is

    root@beaglebone:/proc# cat fb
    0 DA8xx FB Drv

    code in drivers/video/da8xx-fb.c

    Device Tree for this is documented in <kernel>/Documentation/devicetree/bindings/video/da8xx-fb.txt

    which does not mention bits per pixel.

    Can you configure the bits per pixel in this driver using device-tree?

    I can see, that you can do this in platform data, but cannot find any definition of any platform data.

  • Could You check my device file?

    LCD4.tar.gz
  • I tried shortcircuiting the device-tree file, and hardwired the driver to 16 bits per pixel

    bpp = 16;

    But that did not work at all with the LCD4.

    Then I tried swapping colours.

    static int fb_check_var(struct fb_var_screeninfo *var,
                struct fb_info *info)
    {

    ...
        switch (var->bits_per_pixel) {

    ...

        case 32:
            var->transp.offset = 24;
            var->transp.length = 8;
    #ifdef CONFIG_FB_DA8XX_RGB

           /* New configuration */

            var->red.offset = 0;
            var->red.length = 8;
            var->green.offset = 8;
            var->green.length = 8;
            var->blue.offset = 16;
            var->blue.length = 8;
            var->nonstd = 0;
    #else

            /* Original */
            var->red.offset = 16;
            var->red.length = 8;
            var->green.offset = 8;
            var->green.length = 8;
            var->blue.offset = 0;
            var->blue.length = 8;
            var->nonstd = 0;
    #endif
            break;
        default:
            err = -EINVAL;
        }

    ...

    }

    And then omaplfb fails to initialize.

    [   37.214978] omaplfb: OMAPLFBInitFBDev: Device 0: Unknown FB format

  • I can get things running, by setting the framebuffer to 16 bits, before psplash runs.

    /etc/rcS.d/S00fbdepth

    -----------------------------------

    #!/bin/sh

    fbset -depth 16

    -----------------------------------

    This is ugly, though (and Tux has Blue feet)

    I do not think it will work, setting bpp = 16 in the panel-info structure.

    The panel-info is handled by the tilcdc-panel.c file, which does not even get compiled

    when you are using the da8xx-fb driver. Only when you are using the tilcdc driver.

    So the question remains: How do you set 16 bit mode for the da8xx-fb driver in a device-tree file?

  • Hi Ulf,

    Did you ever get this figured out?  

    I've got the same problem with a custom 5.7' display on a BBB.  I added the panel info into my custom dts file and it had no effect, reading this thread, now I know why.

    Regards,

    Greg

  • Hi Ulf,
    Hi all,

    I am using Android JB 4.2.2(kernel version is 3.2) for custom 7' BBB. I have to configure the panel in RGB565 mode as explained in Figure 3 of the ti errata sheet(3.1.1 LCD: Color Assignments of LCD_DATA Terminals). As per I know we have to set the bpp to 16 in a board file. But I am not getting the expected result. On the board I am getting the "LCDC sync lost" message. Please let me know if anyone is faced the similar issue and let me know is there any other code changes we have to do to support the RGB565 mode.

    Here is some progress I made in my cutom board. But I struck at issue explained in the link.https://e2e.ti.com/support/arm/sitara_arm/f/791/p/264290/1582201#1582201