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.

USB 2.0 test mode & TEST_PACKET

Hi,

a question about the test mode hook of the USB 2.0 driver, with reference to the “musb driver debugfs” paragraph at the bottom part of this wiki:

http://processors.wiki.ti.com/index.php/Usbgeneralpage

 

No problems at all regarding the first three standard tests: TEST_SE0NAK, TEST_J, TEST_K

but when it comes to TEST_PACKET, we tried the following sequence, with no results:

#mount -t debugfs none /sys/kernel/debug/
#echo "test packet" > /sys/kernel/debug/testmode

however, the Netra TRM (sprugx8.pdf) reports that, for executing Test Packet correctly, the steps are:

1. Start a session (if the core is being used in Host mode).
2. Write the standard test packet (shown below) to the Endpoint 0 FIFO.
3. Write 8h to the TESTMODE register (TEST_PACKET = 1) to enter Test_Packet test mode.
4. Set the TxPktRdy bit in the HOST/PERI_CSR0 register (bit 1).

as far as we can understand, the debugfs interface allows to perform steps 2 and 3, what about the preliminary step 1 and the ending step 4?
can them be done from userland as well?

Thanks, best regards

Massimo

  • Massimo

    Can you try with this patch at

    http://arago-project.org/git/projects/?p=linux-omap3.git;a=blobdiff;f=drivers/usb/musb/musb_debugfs.c;h=5954f439b5da16231c87ef95c906f109f362fcbf;hp=f7414a8aeb7e544d339dd3bcb1a6b1b13d6844e8;hb=6edd759603326629589f2b17e694989996239733;hpb=0364d983efb570de798d295531ed1e32edba4316

    Regards

    Ravi B

  • Hi Ravi,

    I am the Linux BSP engineer that asked Massimo for help:

    my aim is having the USB I/F transmit the standard test packet continuously,

    so that my hardware team colleagues can carry out some eye-diagram measurements

    unfortunately, I tried the patch that you suggested, but still I cannot see any transition on D+/D-

    my test scenario is as follows:

    - boot my proprietary DM8168 board until linux prompt (BTW my reference PSP is 04.01.01.13)

    - login (the MUSB I/F is up and running now, any plugged device will be probed and mounted)

    - issue the following two commands:

      root@phoenix# mount -t debugfs none /sys/kernel/debug/

      root@phoenix# echo "test packet" > /sys/kernel/debug/testmode

    am I missing some step?

    Best Regards

  • Have you checked with procfs command, in the below sequence

    echo F > /proc/driver/musb_hdrc.0 or 1

    echo T > /proc/driver/musb_hdrc.0 or 1

    Regards

    Ravi B

  • Hi Ravi,

    doing that via the procfs interface works!

    we are now able to perform eye-diagram measurements

    Many thanks

  • Hi Ravi,

    I use same commend to test usb eye diagram on usb0 and usb1 separately. But I encounter the fail result on usb1. Please refer below test report and related commands.

    1. USB0 Test Command :

    #echo F > /proc/driver/musb_hdrc.0

    #echo T > /proc/driver/musb_hdrc.0

    #mount -t debugfs none /sys/kernel/debug/

    #echo "test J" > /sys/kernel/debug/musb/testmode

    System reboot,

    #echo F > /proc/driver/musb_hdrc.0

    #echo T > /proc/driver/musb_hdrc.0

    #mount -t debugfs none /sys/kernel/debug/

    #echo "test K" > /sys/kernel/debug/musb/testmode

    ===========================================

     2. USB1 Test Command :

    #echo F > /proc/driver/musb_hdrc.1

    #echo T > /proc/driver/musb_hdrc.1

    #mount -t debugfs none /sys/kernel/debug/

    #echo "test J" > /sys/kernel/debug/musb/testmode

    System reboot,

    #echo F > /proc/driver/musb_hdrc.1

    #echo T > /proc/driver/musb_hdrc.1

    #mount -t debugfs none /sys/kernel/debug/

    #echo "test K" > /sys/kernel/debug/musb/testmode

     

     B.R.

    OC

  • Hi OC,

    Somehow we found that there are two testmode for each USB

    /sys/kernel/debug/musb/testmode --> USB0
    /sys/kernel/debug/testmode --> USB1

    I verified that the USB test modes registers (0x4740140F for USB0 and 0x47401C0F for USB1) are changed accordingly.

     

    Regards,

    Anfernee