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.

Scrolling bootsplash when using u-boot with LCD

I am in the process of getting the u-boot bootsplash working with an LCD, using the following primarily as a guide:

http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/220648.aspx

I got the LCD to show the image and it looks good all the way through boot until I load the firmware (as expected).  However, right at device power-up the image scrolls both vertically and horizontally for 1-2 seconds before locking.  Once the image stops scrolling, it works fine from that point forward.

I went after the usual suspects thinking this was some problem with a misconfigured hsync/vsync, some LCD initialization issue, unstable pixel clock, wrong front/backporch settings, but everything looked good on the oscilloscope.

As a test, I created the following image and loaded it up as a boot logo:

Bear in mind due to the orientation of the LCD, the image essentially has a ten pixel red line down the left hand side of the image.  The line is exactly ten pixels in width, and I offset it ten pixels from the left.  The idea behind creating this image was that it would allow me to put a scope on one of the red pixel traces going to the LCD, and measure the time from hsync to the red pixel.

The following image shows the timing when it's working correctly:

This shows the correct behavior in high resolution.  Channel 1 (yellow) is VSYNC, channel 2 (blue) is HSYNC, channel 3 (purple) is pixel clock, and channel 4 (green) is one of the red pixel lines.  You can see the ten red pixels (where the green channel is high), and it's offset from the hsync by ten pixels plus the back porch.  Looks good.

Now look at the following:

This shows that the start of the pixels is 82 nanoseconds after the end of the hsync pulse, which makes sense since it's all the way to the left.  If you look closely at the top view for the leftmost five hsyncs, you can see green pulses right
after each hsync pulse.

Finally, look at the following:

This capture was taken during the scrolling at power-up (note good_redline.jpg and bad_redline.jpg are at the same capture window size).  You can see that the distance from the hsync pulse to the start of the ten red pixels is 13.8 us,
almost halfway into the horizontal line.

So what does this tell us?  We had originally assumed we were putting out a consistent signal throughout the boot process, and that the LCD was having problems interpreting it due to some condition such as incorrect LCD initialization, unstable clocking, jitter, incorrect pulse width, wrong front/back porch settings, power ramping, etc.
However we didn't see anything wrong with the various control signals - they all look well-formed and constant.

Now that we're able to see the actual pixel *data* though, we can see that the firmware in the M3 core despite putting out properly timed control signals (pixel/hsync/vsync), it's actually putting out video with the incorrect horizontal offset.  The LCD panel is correctly rendering what the device is putting out.  And if you wait a second or two, the output of the M3 becomes correct (for no apparent reason).

In short, it's not that the video output was putting out slightly wrong data and the LCD eventually syncs up.  The video output is actually putting out wrong data and for reasons unknown it stops doing such and starts putting out the correct data.

The LCD we're testing with is an NEC model NL4864HL11-01B, a 480x640 display with a pixel clock at 19.6MHz.

A few other interesting observations:

1.  The scrolling behavior changes if I change the pixel clock rate.  In all cases the actual pixel clock as measured by the scope matches the rate I specified in u-boot, so it's not clear to me what other adverse side effects the pixel clock rate may be having on the M3 core.

2.  I can cause the behavior to happen more often by putting usleep() calls at various points in the u-boot initialization after the M3 firmware is loaded.  This shouldn't actually have any effect given the M3 core is independent of the ARM core, yet it does.

3.  I can tell the ARM CPU to sleep completely (call usleep() in a loop), and the scrolling still goes away on its own.  In other words, it appears that the ARM CPU is not specifically doing anything to cause the video to stop scrolling, given the problem goes away even when the ARM CPU is spinning in a loop doing nothing.

Please advise.

Thanks,

Devin

  • Hi Devin

    Are you using DM814x device? What silicon revision (1.x, 2.x, 3.x)?

    Are you using EZSDK 5.05.02.00 / PSP 04.04.00.01?

    Regards,
    Pavel

  • Devin,

    What does the image look like when you enable the VENC internal color bar generator?

    BR,

    Steve

  • Hi Pavel,

    Thanks for taking the time to reply.

    I'm using a DM8148 Revision 2.0.

    In terms of the EZSDK, I'm using 5.04.00.11, but according to the following that version has the same u-boot as 5.05.02.00 (u-boot 2010.06-psp04.04.00.01).

    http://processors.wiki.ti.com/index.php/Category:EZSDK_Software_BOM

    Regards,

    Devin

  • Hi Steve,

    I actually didn't know it had an internal color bar generator (I'm not surprised though, as plenty of other designs I have worked with in the past do also).

    How is the color bar generator enabled?  Is there a register that needs to be poked?  Definitely part of the problem is I have essentially zero documentation on the video core (nor do I have any sources to the firmware running on the M3).  It's essentially a black box.

    Devin

  • Setting bit 15 in the VENC register offset 00h will enable the color bar.

    HDMI/DVO1 base address = 0x4810 6000

    Analog DAC base address = 0x4810 8000

    DVO2 base address = 0x4810 a000

    BR,

    Steve

  • Hi Steve,

    I enabled the colorbars, and in fact they do *not* scroll.

    Enabled via the following patch to u-boot:

    diff --git a/drivers/video/ti814x_logo.c b/drivers/video/ti814x_logo.c
    index 7586f25..db0d127 100644
    --- a/drivers/video/ti814x_logo.c
    +++ b/drivers/video/ti814x_logo.c
    @@ -366,6 +366,7 @@ int hsyncend, int htotal, int vdisp, int vsyncstart, int vsyncend, int vtotal,
    | (hs_invert << 24)
    | (vs_invert << 23)
    | (3 << 16) /* video out format: 10 bit, separate syncs */
    + | (1 << 15) /* Color bars enable */
    | (1 << 13) /* bypass gamma correction */
    | (1 << 5) /* bypass gamma correction */
    | (1 << 4) /* bypass 2x upscale */
  • OK, so I don't believe this is a VENC to LCD connectivity/configuration issue.

    I think there is an error in the configuration of the VPDMA such that it is feeding too much/too little data to the VENC.

    BR,

    Steve

  • Hi Devin,

    We've solved the issue some time back, close to one and half years. But I remember clearly that the solution is related to adjusting one of the parameters by a small factor. I forgot which parameter was that. Can you try to tinker few parameters and see the behavior?

  • Hi Renjith,

    Thanks for writing!

    I spent literally days twiddling every variant of the venc parameters I could find.  The behavior does seems to vary based on the clocking (I'm running at 19.6 MHz), but I was never able to find a clock rate that both rendered the video properly and didn't have the scrolling.  I also mucked with the timing of the insertion of data into the frame buffer (inserting udelay calls at various points) under the hope it would change the DMA behavior, with no luck.  The scrolling occurs even if I never write a *single* byte to the frame buffer (including the memset() that zeros the memory).  Even when the device is rendering whatever junk happened to be in RAM at powerup, I can still see it scrolling.

    Unfortunately I'm at the point now where it looks like the problem is either in the silicon or the M3 firmware.  I'm happy to try something specific if you have a suggestion, but we're way past randomly tinkering with the values in the hope that it will start rendering properly.

    Devin

  • Hi Devin,

    Devin Heitmueller said:
     The scrolling occurs even if I never write a *single* byte to the frame buffer (including the memset() that zeros the memory).  Even when the device is rendering whatever junk happened to be in RAM at powerup, I can still see it scrolling.

    Writing to memory doesn't make any difference as the VPDMA descriptors are already filled and will start reading from the memory address specified. 

    Devin Heitmueller said:
    Unfortunately I'm at the point now where it looks like the problem is either in the silicon or the M3 firmware.

    I'm pretty sure that this is not a hardware bug, as we've seen the same situation on DM8148 EVM's LCD panel and we managed to solve it then. Also there is no M3 firmware running in u-boot. 

    Referring to a previous mail thread the reason for this behavior is because because of the input received by the blender is smaller or bigger than the VENC frame size. 

  • Hi Renjith,

    Renjith Thomas said:

    Writing to memory doesn't make any difference as the VPDMA descriptors are already filled and will start reading from the memory address specified. 

    That is consistent with my expectations.  However without enough insight to the operation of the firmware, I figured it was worth a try.

    Renjith Thomas said:

    Unfortunately I'm at the point now where it looks like the problem is either in the silicon or the M3 firmware.

    I'm pretty sure that this is not a hardware bug, as we've seen the same situation on DM8148 EVM's LCD panel and we managed to solve it then. Also there is no M3 firmware running in u-boot. 

    [/quote]

    Perhaps we're having some miscommunication regarding terminology, because I see a firmware blob being loaded by u-boot via drivers/video/firmware.c (the firmware itself is in include/ti81xx_vpdma_firmware.h).

    Renjith Thomas said:

    Referring to a previous mail thread the reason for this behavior is because because of the input received by the blender is smaller or bigger than the VENC frame size. 

    I have definitely seen scrolling behavior when VENC parameters are misconfigured, but in those cases it always persisted indefinitely.  In my case though, it only occurs for the first couple of seconds of operation, at which point it locks and the video is rendered perfectly from that point forward.

    Devin

  • Hi Devin,

    Devin Heitmueller said:
    Perhaps we're having some miscommunication regarding terminology, because I see a firmware blob being loaded by u-boot via drivers/video/firmware.c (the firmware itself is in include/ti81xx_vpdma_firmware.h).

    I don't think this firmware creates any trouble here as it is VPDMA's core's firmware. This is not an M3 core, and its a hidden core which I believe most likely and 8051 or ARP32 core. 

  • Devin, the initial scrolling could be caused by a delay in things in the pipeline aligning themselves. If any source and target size registers are not set correctly then their corresponding counters will be out of phase for some period of time.  Once the become phase aligned then they appear to snap together.

    This is most certainly caused by horizontal and vertical size parameters somewhere in the path not being set correctly.

    BR Steve

  • Devin,

    The issue seems to be related to descriptor settings only as pointed out by Steve. So ideally it should be in the file drivers/video/firmware.c that has all these settings.
    Also I checked with another person that had worked on it. They also faced a similar issue and they think it might be related to the settings of graphics pipeline. They advised to check whether the framestart bit in grpxX_data_cstat  register is set correctly for whatever graphics pipeline that is getting used. Please make sure this bit is set for dvo2 if you are using for LCD.
     
    Best regards,
    Pavel
  • Hi Pavel,

    The VPDMA_GRPX2_DATA_CSTAT is being set to 0x1c00.  I have to assume that's correct since my previous requests for documentation on that register resulted in TI denying my request and just telling me it has to be 0x1c00.  I had tried other values through experimentation, with no success.  This is all documented in the following thread I initiated:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/288204/1005867.aspx

    I would be happy to make available my copy of firmware.c and ti814x_logo.c off list if you would like to see it firsthand.

    Devin

  • Hi Devin,

    If you can spare a set of hardware, we can solve the issue for you. 

  • Devin,

    Can this issue be reproduced on the DM814x EVM? If yes, please provide me the steps.

    Regards,
    Pavel

  • Hi Pavel,

    I'll have to break out the schematic for the EVM and see if I can get the scope onto the relevant lines.  The image on the LCD will look like garbage because the EVM's LCD doesn't match ours, but you should be able to see the behavior on the scope.

    I assume if I do this that you have a digital oscilloscope at your disposal with which you will be able to reproduce the behavior and debug the issue?

    Devin