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.

How to: DM6467T early sign of life

Other Parts Discussed in Thread: CDCE949I spent 20 years trying to... no, actually just several solid days of effort distributed over a month... to figure out how to do this, so I'm sharing it with you.

My custom board derived from the DM6467T EVM takes forever to boot and load my special purpose codec application, especially when the file system is in NAND flash. It takes as long as 2.2 minutes. During this time, the video looks dead as a doornail. Unless I'm watching the progress on the serial console, you can't tell if the thing is dead or alive. This is definitely not acceptable for any customers.

I did a few things...

FIRST, I figured out how to turn on video output within 11 seconds of power on. I'm using an ADV7171 video display chip, which has on-board color bar generation capability. When the driver first loads, in the probe function I configure for internal color bars. However, nothing is displayed because the chip isn't receiving a clock, which from the EVM design is VPIF_CLKOUT2. This clock comes from the DM6467T, mux selected from the VPIF_CLKIN2 input, which comes from the CDCE949 clock generator. VPIF_CLKIN2 is present, but the DM6467T isn't yet forwarding it to its VPIF_CLKOUT2 output. To solve this problem, I found a change to vpif_display.c, a file from git/drivers/media/video/davinci. Just before the probe function normal "return 0" (in contrast to the abnormal "return err" after the probe_subdev_out: label, add the following code. Now, this is hard coded for standard definition. Change the first parameter of set_clock to a 0 for high definition.

{
    struct vpif_display_config *vpif_config_data = vpif_dev->platform_data;
    if (vpif_config_data && vpif_config_data->set_clock) {
        vpif_config_data->set_clock(1/*std def*/, 0/*unused*/); // HgF: TURN ON STD DEF VIDEO CLOCK NOW!
        enable_channel2(1);
    }
}

With this code recompiled into the kernel, I get VPIF_CLKOUT2 within 11 seconds, and at about the same time, my customized ADV7170 driver configures the color bars for the ADV7171. So I get color bars within 11 seconds of power on. If you're using a different video display chip, just try to do something analogous. Note that later, when my codec application runs, things get set all over again, cleaning up the mess I've left (such as ADV7171 configured to output color bars and ignore data coming in).

SECOND, I modified my codec application to have an early splash screen. My codec application is derived from the DM6467T encodedecode demo. The call to TraceUtil_start(engine->engineName) takes as long as a minute loading the codec server from NAND flash. I modified main.c to move this call and the if structure surrounding it to a place AFTER the display thread is created. (Specifically, after the "initMask |= DISPLAYTHREADCREATED;" line). This allows the display thread to be created before this big delay occurs.

I then put the following function call in display.c, immediately after the Display_create() call and return error check:

    splash(hDisplay, dstBufSize);

As a result, the splash screen occurs very shortly after the application is loaded, and shows while the slow process occurs of the codec engine getting loaded (over on the DSP).

Overall, it now takes 11 seconds to get color bars. 50 seconds later I get my splash screen. Another minute+ later I get live video through my codec. This is still really slow, but at least I know along the way that I actually have power applied!

The splash function I used just punches a green screen. It would be pretty easy to make it read an image file off disk and display it instead, such as a pretty picture or logo screen. Oh yes, this assumes YUV422SP data format. Somewhere higher up, my dstBufSize got set for NTSC in my case.

    /******************************************************************************
     * splash screen
     ******************************************************************************/
    
    void splash(Display_Handle hDisplay, int dstBufSize)
    {
         int iYSize = dstBufSize/2;
         int iCSize = iYSize;
         unsigned char *dstPtr;
          Buffer_Handle hDstBuf;
          /* Get a buffer from the display device driver */
         if (Display_get(hDisplay, &hDstBuf)
             ERR("Failed to get display buffer\n");
         }
         dstPtr = Buffer_getUserPtr(hDstBuf);
         memset(dstPtr,95,iYSize); // BRIGHT Green RGB=(121,232,104) YCbCr=(200,82,82) DARK Green RGB=(121,232,104) YCbCr=
    (95,82,82)
         memset(dstPtr+iYSize,82,iCSize);
         /* Send buffer to the display device driver */
         if (Display_put(hDisplay, hDstBuf)
             ERR("Failed to put display buffer\n");
         }
    }

Thanks to all who helped me on these and other things along the way.

-Helmut