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.

DM36x USB host: how to test the eye diagram

Hi,

My customer wants to test the eye diagram for DM36x USB host. I found there is code related to TEST_PACKET. I think if the usb host can send the TEST_PACKET, then customer can do the eye diagram. But I don't have a full flow to how to let the USB host to send out the TEST_PACKET.

Would you pls kindly help?

The kernel is MV2.6.18.

  • Meng chris

    Please check MV2.6.18 usb code (drivers/musb/musb_procfs.c) already has the implementation for test mode. You may need to port if not available from below link.

    Usage: To initiate 53 bytes of test packet in host mode for eye diagram, build the kernel in host mode with procfs implementation and issue the command.

    echo T > /proc/drivers/musb/musb_hdrc 

    Refer the below arago link for code reference

    http://arago-project.org/git/projects/?p=linux-omap3.git;a=tree;f=drivers/usb/musb;h=90348512cb3b5ed34cdbdf6e006d1f50d3b1a2d0;hb=5191ea28cd3d4a80d5d06bdff642306b6b1d26c8

    below are impelmentation details

    Look for drivers/usb/musb/musb_procfs.c

    static int musb_proc_write(struct file *file, const char __user *buffer,
                            unsigned long count, void *data)

    {

    ...............
           case 'T':
                    if (mbase) {
                            musb_load_testpacket(musb);
                            musb_writeb(mbase, MUSB_TESTMODE,
                                            MUSB_TEST_PACKET);
                            musb_writew(musb->endpoints[0].regs,
                                    MUSB_CSR0, MUSB_CSR0_TXPKTRDY);
                            DBG(2, "musb:testmode sending test packet\n");
                    }
    ................

    }

    Look for driver/usb/musb/musb_core.c

    /* for high speed test mode; see USB 2.0 spec 7.1.20 */
    static const u8 musb_test_packet[53] = {
            /* implicit SYNC then DATA0 to start */

            /* JKJKJKJK x9 */
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            /* JJKKJJKK x8 */
            0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
            /* JJJJKKKK x8 */
            0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee, 0xee,
            /* JJJJJJJKKKKKKK x8 */
            0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
            /* JJJJJJJK x8 */
            0x7f, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd,
            /* JKKKKKKK x10, JK */
            0xfc, 0x7e, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd, 0x7e

            /* implicit CRC16 then EOP to end */
    };

    void musb_load_testpacket(struct musb *musb)
    {
            musb_ep_select(musb, musb->mregs, 0);
            musb->ops->write_fifo(musb->control_ep,
                            sizeof(musb_test_packet), musb_test_packet);
    }

    Hope this will be useful.

    Regards

    Ravi B

  • Hi Sir,

        I try this on OMAP1808, however, I can not get the test_packet send out. 

        SDK version: linux-2.6.37-psp03.21.00.04.sdk

        Any hint for this?

     

    Best Regards,

    Voice Shen