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.

OMAP35x USB Compliance test procedure for USB Host with external hub

Other Parts Discussed in Thread: OMAP3525, OMAP-L138

Hello champions,

 

We are using OMAP3525's USB Host(EHCI) port with an external USB-Hub

and we need information about Host Compliance Testing.

We know how to force the device to go into TEST_PACKET test mode,

but we don't know how to enter into test mode when the EHCI port is connected to a USB-Hub.

 

I found a good document for OMAP-L138's Downstream Host Compliance Testing here.

But there is no such document on OMAP35x ,

can we refer this document for OMAP3525's "Host Compliance Testing" also?

 

and please let me know if there is any procedure or sample program to force 

USB Host port(with USB-Hub) into  test mode.

 

Thank you for the support.

 

Regards.

Paddu

  • Paddu,

    when connected to USB hub then host controller needs to send SET_FEATURE command to hub to enter into test mode.

    You can also refer below page on this.

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/int-dm3x/f/102/p/8800/35697.aspx#35697

    Regards,
    Ajay

  • Hello Ajay,

    Thank you.

    The link you have shown says "Group Not Found"

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/int-dm3x/f/102/p/8800/35697.aspx#35697

    I understood that SET_FEATURE command is required to hub to enter into test mode,

    is there any test code or any reference regarding this procedure?

    Could you please let me know if there are any test code.


    Best Regards.

    Paddu.

  • Paddu,

    Please refer the below patch which needs to be applied to linux source to put the hub downstream port into test mode.

    1. Apply the patch

    2. Change the appropriate port number in set_port_in_test_mode()

    3. Make USBHOST and EHCI HCD as module

    4. Compile and boot.

    5. insmod usbcore.ko hubintestmode=<1 to 6 based on test mode to be tested>

    6. insmod ehci-hcd.ko

    Regards,

    Ajay

    --------------------------- patch ---------------------------

    --- drivers/usb/core/hub.c.old_old 2009-12-14 16:35:16.000000000 +0530

    +++ drivers/usb/core/hub.c         2009-12-15 18:00:43.000000000 +0530

    @@ -50,6 +50,11 @@ static int blinkenlights = 0;

     module_param (blinkenlights, bool, S_IRUGO);

     MODULE_PARM_DESC (blinkenlights, "true to cycle leds on hubs");

     

    +/* Placing the HUB in test mode */

    +static int hubintestmode = 0;

    +module_param (hubintestmode, int, S_IRUGO | S_IWUSR);

    +MODULE_PARM_DESC (hubintestmode, "non-zero value to place HUB in test mode");

    +

     /*

      * As of 2.6.10 we introduce a new USB device initialization scheme which

      * closely resembles the way Windows works.  Hopefully it will be compatible

    @@ -129,14 +134,34 @@ static int clear_port_feature(struct usb

                            NULL, 0, 1000);

     }

     

    +static int set_port_in_test_mode(struct usb_device *hdev, int port1)

    +{

    +          printk("set_port_feature - portID = %d, hubintestmode = %d\n", port1, hubintestmode);

    +          switch (hubintestmode) {

    +          case 01: printk("Setting HUB to send Test_J\n");

    +                         break;

    +                case 02: printk("Setting HUB to send Test_K\n");

    +                         break;

    +                case 03: printk("Setting HUB to send Test_SE0_NAK\n");

    +                         break;

    +                case 04: printk("Setting HUB to send Test_Packet\n");

    +                         break;

    +                case 05: printk("Setting HUB to send Test_Force_Enable\n");

    +                         break;

    +        }

    +        return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),

    +                        USB_REQ_SET_FEATURE, USB_RT_PORT, USB_PORT_FEAT_TEST, ((hubintestmode << 8) | port1),

    +                        NULL, 0, 1000);

    +}

    +

     /*

      * USB 2.0 spec Section 11.24.2.13

      */

     static int set_port_feature(struct usb_device *hdev, int port1, int feature)

     {

                return usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),

    -                       USB_REQ_SET_FEATURE, USB_RT_PORT, feature, port1,

    -                       NULL, 0, 1000);

    +                                  USB_REQ_SET_FEATURE, USB_RT_PORT, feature, port1,

    +                                  NULL, 0, 1000);

     }

     

     /*

    @@ -450,6 +475,17 @@ static void hub_power_on(struct usb_hub

     

                /* Wait at least 100 msec for power to become stable */

                msleep(max(pgood_delay, (unsigned) 100));

    +

    +          if (hubintestmode > 0 && hubintestmode < 6)

    +          {

    +                      /* Set port 3 in test mode */

    +                      port1 = set_port_in_test_mode(hub->hdev, 3);

    +                      if(port1) {

    +                                  printk("Placing port in test mode failed with value = %d\n", port1);

    +                      } else {

    +                                  printk("Placing port in test mode passed\n");

    +                      }

    +          }

     }

     

     static inline void __hub_quiesce(struct usb_hub *hub)

    ------------------------------------- end -------------------------------------

  • Hello Ajay,

     

    Thank you.

     

    Unfortunately we are not able to generate the test packet 

    with all the necessary settings. 

     

    We assume that the below option would generate the test packet, 

    but there was no change in the state as well as no test packet generated. 

    (same problem with hubintestmode=1 and hubintestmode=2 option also). 

    " insmod usbcore.ko hubintestmode=5 "

    " insmod ehci-hcd.ko " 

     

    Currently we are using USB Hub with 3 ports

    and we have tried with different values(1 to 3) in the below code, with no success. 

    /* Set port 3 in test mode */ 

    port1 = set_port_in_test_mode(hub->hdev, 3); 

     

    Could you please let us know if there is any details about test requirement 

    (like how to perform the test, number of hub ports...) and if there are any log files of successful test. 

     

    Just in case I am attaching the the Log  details below.

     

    LOG: 

     kernel: usb 1-1: khubd timed out on ep0in len=0/64

    kernel: ehci-omap ehci-omap.0: GetStatus port 1 status 04100a POWER sig=se0 PEC CSC

    kernel: hub 1-0:1.0: unable to enumerate USB device on port 1

    kernel: ehci-omap ehci-omap.0: remove, state 1

    kernel: ehci-omap ehci-omap.0: roothub graceful disconnect

    kernel: usb usb1: USB disconnect, address 1

    kernel: usb usb1: unregistering device

    kernel: usb usb1: usb_disable_device nuking all URBs

    kernel: ehci-omap ehci-omap.0: shutdown urb ccac1bc0 ep1in-intr

    kernel: usb usb1: unregistering interface 1-0:1.0

    kernel: usb 1-0:1.0: uevent

    kernel: usb usb1: uevent

    kernel: ehci-omap ehci-omap.0: stop

    kernel: ehci-omap ehci-omap.0: reset command 01000a (park)=0 ithresh=1 period=256 Reset HALT

    kernel: ehci-omap ehci-omap.0: irq normal 0 err 0 reclaim 0 (lost 3)

    kernel: ehci-omap ehci-omap.0: complete 1 unlink 2

    kernel: ehci-omap ehci-omap.0: ehci_stop completed status 1000 Halt

    kernel: ehci-omap ehci-omap.0: USB bus 1 deregistered

    kernel: ehci-omap ehci-omap.0: stopping TI EHCI USB Controller

    kernel: ehci-omap ehci-omap.0: Clock to USB host has been disabled

    kernel: usbcore: deregistering device driver usb

    kernel: usbcore: deregistering interface driver usbfs

    kernel: usbcore: khubd exiting

    kernel: usbcore: deregistering interface driver hub

    kernel: usbcore: registered new interface driver usbfs

    kernel: usbcore: registered new interface driver hub

    kernel: usbcore: registered new device driver usb

    kernel: ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

    kernel: ehci_hcd: block sizes: qh 60 qtd 96 itd 160 sitd 96

    kernel: ehci-omap ehci-omap.0: failed to get ehci port0 regulator

    kernel: ehci-omap ehci-omap.0: starting TI EHCI USB Controller

    kernel: ehci-omap ehci-omap.0: TLL RESET DONE

    kernel: ehci-omap ehci-omap.0: OMAP3 ES version > ES2.1

    kernel: ehci-omap ehci-omap.0: UHH setup done, uhh_hostconfig=31c

    kernel: ehci-omap ehci-omap.0: OMAP-EHCI Host Controller

    kernel: drivers/usb/core/inode.c: creating file 'devices'

    kernel: drivers/usb/core/inode.c: creating file '001'

    kernel: ehci-omap ehci-omap.0: new USB bus registered, assigned bus number 1

    kernel: ehci-omap ehci-omap.0: park 0

    kernel: ehci-omap ehci-omap.0: irq 77, io mem 0x48064800

    kernel: ehci-omap ehci-omap.0: reset command 090b02 park=3 ithresh=9 period=1024 Reset HALT

    kernel: ehci-omap ehci-omap.0: init command 010009 (park)=0 ithresh=1 period=256 RUN

    kernel: ehci-omap ehci-omap.0: USB 2.0 started, EHCI 1.00

    kernel: usb usb1: default language 0x0409

    kernel: usb usb1: udev 1, busnum 1, minor = 0

    kernel: usb usb1: New USB device found, idVendor=1d6b, idProduct=0002

    kernel: usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1

    kernel: usb usb1: Product: OMAP-EHCI Host Controller

    kernel: usb usb1: Manufacturer: Linux 2.6.32 ehci_hcd

    kernel: usb usb1: SerialNumber: ehci-omap.0

    kernel: usb usb1: uevent

    kernel: usb usb1: usb_probe_device

    kernel: usb usb1: configuration #1 chosen from 1 choice

    kernel: usb usb1: adding 1-0:1.0 (config #1, interface 0)

    kernel: usb 1-0:1.0: uevent

    kernel: hub 1-0:1.0: usb_probe_interface

    kernel: hub 1-0:1.0: usb_probe_interface - got id

    kernel: hub 1-0:1.0: USB hub found

    kernel: hub 1-0:1.0: 3 ports detected

    kernel: hub 1-0:1.0: standalone hub

    kernel: hub 1-0:1.0: individual port power switching

    kernel: hub 1-0:1.0: individual port over-current protection

    kernel: hub 1-0:1.0: power on to power good time: 20ms

    kernel: hub 1-0:1.0: local power source is good

    kernel: hub 1-0:1.0: enabling power on all ports

    kernel: set_port_feature - portID = 1, hubintestmode = 5

    kernel: Setting HUB to send Test_Force_Enable

    kernel: Placing port in test mode passed

    kernel: drivers/usb/core/inode.c: creating file '001'

    kernel: ehci-omap ehci-omap.0: ...powerup ports...

    kernel: ehci-omap ehci-omap.0: GetStatus port 1 status 051803 POWER sig=j CSC CONNECT

    kernel: hub 1-0:1.0: port 1: status 0501 change 0001

    kernel: hub 1-0:1.0: state 7 ports 3 chg 0002 evt 0000

    kernel: hub 1-0:1.0: port 1, status 0501, change 0000, 480 Mb/s

    kernel: ehci-omap ehci-omap.0: port 1 high speed

    kernel: ehci-omap ehci-omap.0: GetStatus port 1 status 051005 POWER sig=se0 PE CONNECT

    kernel: usb 1-1: new high speed USB device using ehci-omap and address 2

    kernel: usb 1-1: khubd timed out on ep0in len=0/64

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 1

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 2

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 3

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 4

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 5

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 6

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 7

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 8

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 9

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 10

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 11

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 12

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 13

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 14

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 15

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 16

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 17

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 18

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 19

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 20

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 21

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 22

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 23

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 24

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 25

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 26

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 27

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 28

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 29

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 30

    kernel: ehci-omap ehci-omap.0: detected XactErr len 0/8 retry 31

    kernel: ehci-omap ehci-omap.0: devpath 1 ep0in 3strikes

    kernel: usb 1-1: khubd timed out on ep0in len=0/64

    kernel: ehci-omap ehci-omap.0: GetStatus port 1 status 05100e POWER sig=se0 PEC PE CSC

    kernel: hub 1-0:1.0: unable to enumerate USB device on port 1 

     

    Best Regards.

    Paddu

  • Paddu,

    As per the log it seems first a device is disconnected or rmmod is done and then insmod is done. Later in the log EHCI controller gets initialized and "root hub is detected"

    [kernel: hub 1-0:1.0: USB hub found, kernel: hub 1-0:1.0: 3 ports detected] and test mode is wrongly being tried on "root hub" and not the external hub.

    We need to have a logic to perform test mode only for external hub. Please try below change and report back.

    -     if (hubintestmode > 0 && hubintestmode < 6)

    +     if (hub->tt.multi && hubintestmode > 0 && hubintestmode < 6)

    Regards,

    Ajay

  • Hello Ajay,

     

    Thank you,

     

    If possible could you please try to have a look at this query,

     

    We understood the above procedure(adding the patch to the kernel).

    We would like to know,

    is it also possible to put the USB Hub into test mode from the "User Space" (say some user API)

    instead of kernel space.

     

    Regards.

    Paddu 

  • Paddu,

    Could you test the suggested change and did it work for you? As of now there is no userspace layer control on this but can be added if we can make sure it works on kernel mode first.

    Regards,
    Ajay

  • hello Ajay,

    Sorry for the delay.

     

    It seems our customer successfully did the testing,

    they used a program in the userspace, with USB Control transfer + HUB CLASS / FETURE_SET

    they were able to put USB-Hub into test mode.

     

    Thank you for the support.

     

    Regards.

    paddu.

  •  

    Dear Paddu and Ajay,

    Could u plz share how to put USB-Hub into test mode ?!

     

    As I know, Embedded system need HSEHET (High-speed Embedded Host Electrical Test device) to trigger Host to enter test mode.

    (http://www.usb.org/developers/hsehetboard/)

     

    >>a program in the userspace, with USB Control transfer + HUB CLASS / FETURE_SET

    what is "program in the userspace" ?? and what is the "USB Control transfer" ??

     

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

    "USB2.0 Spec 11.24.2.13 Set Port Feature" :  Test mode of a downstream facing port can only be used in

    a well defined sequence of hub states. 

    Sequence:

    1) ...

    2) A SetPortFeature(PORT_TEST) request must be issued to the downstream facing port to be tested.

    Only a single downstream facing port can be in test_mode at a time.  The transition to test mode

    must be complete no later than 3 ms after the completion of the status stage of the request.

    ==>Should there any device be plugged into external Hub or not ??  Plug HSEHET ??

    ==>Did you follow this hub state sequence ??

     

    There are some references, but I still don't understand how to put external Hub into test mode.

    http://www.usb.org/developers/docs#comp_test_procedures

    USB-IF Embedded Host Compliance Procedures (http://www.usb.org/developers/onthego/EHSET_v1.01.pdf)

    Embedded High-speed Host Electrical Test Procedure (http://www.usb.org/developers/onthego/EHSET_v1.01.pdf)

    USB-IF Embedded Host Compliance Plan (http://www.usb.org/developers/docs/EH_Compliance_v1_0.pdf)

    On-The-Go Supplement to the USB 2.0 Specification 6.4 (http://www.usb.org/developers/onthego/USB_OTG_and_EH_2-0.pdf) 

    USB 2.0 Specification 7.1.20 and 11.24.2.13 (http://www.usb.org/developers/docs)

    High Speed Embedded Host Electrical Test Board (http://www.allion.com/TestTool/Allion-HSEHET-User-Manual.pdf)

  • Hello chen,

     

    Did you try the kernel patch discussed above?

     

    I haven't done the test myself, this query was from our customer.

    Actually our customer said that, they didn't go for kernel patch

    and tried with some user apllication which puts the USB to test mode.

    They are using TI's DVSDK(linux).

     

    Unfortunately, our customer may not provide us their user apllication,

    I heard that they have used Hub Class SET FEATURE command to put the USB to test mode,

    and I think they have used a USB device while testing.

     

    I believe you can create some user program where you can use the SET FEATURE command.

     

    http://www.usb.org/developers/hsehetboard/

    >To activate a test mode, the USB 2.0 specification defines the SetFeature() command as the desired interface.

    >This requires software with a user interface to run on the host system.

     

    I will let you know if I can provide to additional details.

     

    Regards.

    Paddu