UEFI Tool for HS USB Host Mode Electrical Testing v2.0

# UEFI Tool for HS USB Host Mode Electrical Testing

### Change History

- [02/2018] v2.1 Port changes from boot.xf.2.0 and boot.xf.2.2.
- [09/2017] v2.1 Added support to enable SS TX compliance testing, updated command line interface.
- [06/2013] v2.0 Added support for Xhci host controller, updated command line interface.
- [07/2012] v1.5 Add support of multiple USB host controllers and testing of downstream hub ports. Please reset the hub/device after each test.
- [01/2012] v1.0 Initial release

### Introduction

USB electrical testing typically involves a software HSETT developed by Intel. Most of the test equipment vendors like Agilent/Tektronics base their USB electrical testing procedures on HSETT. The problem with HSETT is that it does not run natively in DUT, thus not possible to use for Host mode electrical testing.

This page introduces a UEFI command line tool/application "UsbHostPortTestApp.efi" that can be used as HSETT for high-speed host mode electrical testing. The tool was developed during the process of testing 8960/8064/8974 EA high-speed USB in host mode, and the scope is Agilent Infinnium. The following test cases are supported for the testing of roothub ports:

- Host Hi-Speed Signal Quality
- Host Controller Packet Parameters
- Host CHIRP Timing
- Host Suspend/Resume Timing
- Host Test J/K, SE0_NAK
- Host Disconnect Detect
- Host SS compliance tests

And the following test cases are supported for non-root hub downstream ports (i.e. hub ports):

- Hub Hi-Speed Signal Quality Test - Downstream Facing Ports
- Hub Jitter Test - Downstream Facing Ports
- Hub Test J/K, SE0_NAK - Downstream Facing Ports

Following sections explains the tool's CLI interface and the procedures to conduct each tests list above.

### Command Line Interface of UsbHostPortTestApp

After booting into UEFI shell, type "exit" to quit into SBL shell. Then type "cd fv1:" to enter the firmware volume where the command line application resides. Run the command with no options to display the list of available options.

        Qcom fv1:\> start UsbHostPortTestApp
        ERROR: at least 2 arguments required (0 supplied)
        High-speed USB Host Mode Electrical Test Tool version 2.0
        Usage: UsbHostPortTestApp "CONTROLLER_ID TEST_MODE_ID [HUB_PORT_ID]"
          Controllers:
            ID  Description
             0  Ehci PortTest protocol on core 0
                  Has 3 port hub (1 based index)
             1  Xhci PortTest protocol on core 128
          Test Modes:
            ID  Description
             0  TEST_DISABLE
             1  TEST_J_STATE
             2  TEST_K_STATE
             3  TEST_SE0/NAK
             4  TEST_PACKET
             5  TEST_FORCE_ENABLE
             6  SS compliance - enable
             7  SS compliance - advance test pattern
            10  Suspend
            11  Resume
            12  Single step get device descriptor (HC packet parameters)
            13  Suspend+reset (Chirp timing)
           101  TEST_J_STATE (Hub)
           102  TEST_K_STATE (Hub)
           103  TEST_SE0/NAK (Hub)
           104  TEST_PACKET (Hub)
           105  TEST_FORCE_ENABLE (Hub)

Notes:

- All arguments must be placed in a single set of quotes (see Usage line of help).
- The controllers listed and any hubs on their root ports are dynamically populated at runtime, however, the controller ID values will be consistent across multiple runs.
- Options 1-5 are open-ended in that once the DUT is put into certain test mode it will stay in that mode till option 0 (TEST_DISABLE) is issued. An exception is that options 1-3 can be issued in tandem for "Host Test J/K, SE0_NAK".
- The HUB_PORT_ID argument is only required for the hub test modes (101-105) and will be ignored if supplied with other test modes.

### High-speed USB Host Mode Electrical Testing

USB test instructions often refer to the screenshots of HSETT. To make it easier to correlate HSETT instructions with UsbHostPortTestApp command line options, users are recommended to read Agilent USB Electrical testing notes: http://www.usb.org/developers/docs/USB_Electrical_Testing_Notes.pdf. Following sections will list Agilent instructions along side the instructions for UsbHostPortTestApp.efi. Don't worry if you don't have Agilent scope in your lab because all vendors refer to the same HSETT in their documents.

Notes:

- The following examples use the Xhci controller's root port for testing, so the CONTROLLER_ID used is 1.
- For each test, if previous tests involve any of the UsbHostPortTestApp options 1-5, use option 0 to reset first.

#### Host Hi-Speed Signal Quality

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | Test instructions Part1 (P134) | In scope Click OK to close the Test Instruction dialog.
2 | Test Instructions Part2 (P135) | Run 'UsbHostPortTestApp.efi "1 4"' in console. Then in scope click OK to close the Test Instruction dialog.

#### Host Controller Packet Parameters

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | Test instructions Part1 (P139) | Do nothing.
2 | Test Instructions Part2 (P140) | Run 'UsbHostPortTestApp.efi "1 12"' in console. After seeing "Press enter to send next control transfer stage", press enter once. Then in scope click OK to close the Test Instruction dialog.
3 | Test instructions Part3 (P141) | Press Enter twice in console. Then in scope click OK to close the Test Instruction dialog.
4 | Test instructions for EL_55 SOF EOP Width Test (P143) | In scope click OK to close the Test Instruction dialog. After scope is done with the test, press any key to exit UsbHostPortTestApp.

#### Host CHIRP Timing

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | Test Instructions Part2 (P150) | Run 'UsbHostPortTestApp.efi "1 13"' in console. Then in scope click OK to close the Test Instruction dialog.

#### Host Suspend/Resume Timing

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | Test instructions (P154) | Run 'UsbHostPortTestApp.efi "1 10"' in console. Then in scope Click OK to close the Test Instruction dialog.
2 | Test Instructions (P155) | Run 'UsbHostPortTestApp.efi "1 11"' in console. Then in scope click OK to close the Test Instruction dialog.

#### Host Test J/K, SE0_NAK

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | EL_8 J Test (P158) | Run 'UsbHostPortTestApp.efi "1 1"' in console. Then in scope click OK to close the Test Instruction dialog. Enter the voltage measurements.
2 | EL_8 K Test (P159) | Run 'UsbHostPortTestApp.efi "1 2"' in console. Then in scope click OK to close the Test Instruction dialog. Enter the voltage measurements.
3 | EL_9 SE0_NAK Test (P160) | Run 'UsbHostPortTestApp.efi "1 3"' in console. Then in scope click OK to close the Test Instruction dialog. Enter the voltage measurements.

#### Host Disconnect Detect

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | EL_37 Disconnect Detect Test at 525mV Threshold (P146) | Run 'UsbHostPortTestApp.efi "1 5"' in console. Press enter and a line will be displayed on whether disconnect is detected. Then enter the result in scope.
2 | EL_38 Disconnect Detect Test at 625mV Threshold (P146) | After change the Test switch to Normal position, press Enter again in console. The tool will check connection status again and display the result. Enter the result in scope.

- Note: Disconnect detect is no longer required for USB electrical compliance, according to this compliance update.

### Hub Port Test Modes

Notes:

- The following examples use the Ehci controller's hub port 1 for testing, so the CONTROLLER_ID used is 0 and the HUB_PORT_ID is 1.
- The hub will need to be reset between each test run.

#### Hub Hi-Speed Signal Quality - Downstream Facing Ports

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | Test Instructions (P71) | Run 'UsbHostPortTestApp.efi "0 104 1"' in console. Then in scope click OK to close the Test complete dialog. Reset the hub/device after test.

#### Hub Jitter Test - Downstream Facing Ports

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | Test instructions (P75) | Run 'UsbHostPortTestApp.efi "0 105 1"' in console, followed by "UsbHostPortTestApp.efi 0 4". Then in scope click OK to close the Test Instruction dialog. Reset the hub/device after test.

#### Hub Test J/K, SE0_NAK - Downstream Facing Ports

Step | Agilent Instructions | UsbHostPortTestApp Instructions
1 | EL_8 J Test (P127) | Run 'UsbHostPortTestApp.efi "0 101 1"' in console. Then in scope click OK to close the Test Instruction dialog. Enter the voltage measurements.
2 | EL_8 K Test (P128) | Run 'UsbHostPortTestApp.efi "0 102 1"' in console. Then in scope click OK to close the Test Instruction dialog. Enter the voltage measurements.
3 | EL_9 SE0_NAK Test (P129) | Run 'UsbHostPortTestApp.efi "0 103 1"' in console. Then in scope click OK to close the Test Instruction dialog. Enter the voltage measurements. Reset the hub/device after test.

### Super-speed USB Host Mode Electrical Testing

Notes:

- For each test, if previous tests involve any of the UsbHostPortTestApp options 1-5, use option 0 to reset first.
- Procedure to enable SS compliance:
  - 1. Controller needs to be running/active (RS bit set)
  - 2. Detach downstream test dongle.
  - 3. Run UsbHostPortTestApp "0 6" to enable SS compliance mode.
  - 4. Attach downstream dongle. Please verify DUT transmitting CP0 pattern.
  - 5. Please verify DUT transmitting CP0 pattern.
  - 6. Run tests.
  - 7. Optional - Advance test pattern CP1, CP2, etc. using UsbHostPortTestApp "0 7" command.

Copyright © 2011 - 2019 Qualcomm Technologies, Inc. All rights reserved.