Changes between Version 1 and Version 2 of USB


Ignore:
Timestamp:
01/30/2018 12:39:39 PM (4 months ago)
Author:
Tim Harvey
Comment:

restore wiki markup from html backup

Legend:

Unmodified
Added
Removed
Modified
  • USB

    v1 v2  
    1 {{{#!html
    2           <div id="wikipage" class="trac-content"><p>
    3 </p><div class="wiki-toc">
    4 <ol>
    5   <li>
    6     <a href="#UniversalSerialBusUSB"><b style="color:#000;background:#66ffff">Universal Serial Bus (USB</b>)</a>
    7     <ol>
    8       <li>
    9         <a href="#Versions">Versions</a>
    10       </li>
    11       <li>
    12         <a href="#HostControllers">Host Controllers</a>
    13       </li>
    14       <li>
    15         <a href="#USBSpeeds"><b style="color:#000;background:#ffff66">USB</b> Speeds</a>
    16       </li>
    17       <li>
    18         <a href="#USBTransfertypes"><b style="color:#000;background:#ffff66">USB</b> Transfer types</a>
    19       </li>
    20       <li>
    21         <a href="#USBDeviceClasses"><b style="color:#000;background:#ffff66">USB</b> Device Classes</a>
    22       </li>
    23       <li>
    24         <a href="#HumanInterfaceDevice">Human Interface Device</a>
    25       </li>
    26       <li>
    27         <a href="#VendorSpecific">Vendor Specific</a>
    28       </li>
    29       <li>
    30         <a href="#GateworksUSBdevices">Gateworks <b style="color:#000;background:#ffff66">USB</b> devices</a>
    31       </li>
    32       <li>
    33         <a href="#USBSteering"><b style="color:#000;background:#ffff66">USB</b> Steering</a>
    34       </li>
    35       <li>
    36         <a href="#USBReset"><b style="color:#000;background:#ffff66">USB</b> Reset</a>
    37         <ol>
    38           <li>
    39             <a href="#VBUSreset">VBUS reset</a>
    40           </li>
    41           <li>
    42             <a href="#Softresetviasysfsbindunbindre-enumerate">Soft reset via sysfs bind/unbind (re-enumerate)</a>
    43           </li>
    44           <li>
    45             <a href="#Softresetviaioctl">Soft reset via ioctl</a>
    46           </li>
    47         </ol>
    48       </li>
    49     </ol>
    50   </li>
    51 </ol>
    52 </div><p>
    53 </p>
    54 <h1 id="UniversalSerialBusUSB"><b style="color:#000;background:#66ffff">Universal Serial Bus (USB</b>)</h1>
    55 <p>
    56 <b style="color:#000;background:#66ffff">Universal Serial Bus (USB</b>) is an industry standard developed in the mid-90's that defines cables, connectors and communication protocols used in a bus between computers and peripherals.
    57 </p>
    58 <p>
     1[[PageOutline]]
     2
     3= Universal Serial Bus (USB) =
     4Universal Serial Bus (USB) is an industry standard developed in the mid-90's that defines cables, connectors and communication protocols used in a bus between computers and peripherals.
     5
    596References:
    60 </p>
    61 <ul><li><a class="ext-link" href="http://www.cypress.com/?docID=50830"><span class="icon">​</span>AN57294 - <b style="color:#000;background:#ffff66">USB</b> 101: An Introduction to Universal Serial Bus 2.0</a> - Cypress App Note does a good job of summarizing
    62 </li><li><a class="ext-link" href="http://en.wikipedia.org/wiki/USB"><span class="icon">​</span>http://en.wikipedia.org/wiki/<b style="color:#000;background:#ffff66">USB</b></a>
    63 </li></ul><h2 id="Versions">Versions</h2>
    64 <ul><li><b style="color:#000;background:#ffff66">USB</b> 1.0 - <strong><b style="color:#000;background:#ffff66">USB</b> LowSpeed (1.5mbps)</strong> and <b style="color:#000;background:#ffff66">USB</b> <strong>FullSpeed (12mbps)</strong>
    65 </li><li><b style="color:#000;background:#ffff66">USB</b> 2.0 - adds <strong><b style="color:#000;background:#ffff66">USB</b> HighSpeed (480mbps)</strong>
    66 </li><li><b style="color:#000;background:#ffff66">USB</b> 3.0 - adds <strong><b style="color:#000;background:#ffff66">USB</b> SuperSpeed (10gbps)</strong>
    67 </li></ul><h2 id="HostControllers">Host Controllers</h2>
    68 <p>
    69 The following types of <b style="color:#000;background:#ffff66">USB</b> host controllers exist:
    70 </p>
    71 <ul><li><strong>Universal Host Controller Interface (UHCI)</strong>: Produced by Intel for <b style="color:#000;background:#ffff66">USB</b> 1.0 and <b style="color:#000;background:#ffff66">USB</b> 1.1. Using UHCI requires a license from Intel. This controller supports both LowSpeed and Full-Speed.
    72 </li><li><strong>Open Host Controller Interface (OHCI)</strong>: Produced for <b style="color:#000;background:#ffff66">USB</b> 1.0 and 1.1 by Compaq, Microsoft, and National Semiconductor. Supports Low-Speed and Full-Speed and tends to be more efficient then UHCI by performing more functionality in hardware.
    73 </li><li><strong>Extended Host Controller Interface (EHCI)</strong>: Created for <b style="color:#000;background:#ffff66">USB</b> 2.0 after <b style="color:#000;background:#ffff66">USB</b>-IF requested that a single host controller specification be created. EHCI is used for HighSpeed transactions and delegates Low-Speed and FullSpeed transactions to an OHCI or UHCI sister controller.
    74 </li></ul><h2 id="USBSpeeds"><b style="color:#000;background:#ffff66">USB</b> Speeds</h2>
    75 <p>
    76 The following is a set of supported speeds per <b style="color:#000;background:#ffff66">USB</b> specification:
    77 </p>
    78 <ul><li><strong><b style="color:#000;background:#ffff66">USB</b> LowSpeed (1.5mbps)</strong> (<b style="color:#000;background:#ffff66">USB</b> 1.0 UHCI/OHCI) - Only supports Control and Interrupt transfer types
    79 </li><li><strong><b style="color:#000;background:#ffff66">USB</b> FullSpeed (12mbps)</strong> (<b style="color:#000;background:#ffff66">USB</b> 1.0 UHCI/OHCI)
    80 </li><li><strong><b style="color:#000;background:#ffff66">USB</b> HighSpeed (480mbps)</strong> (<b style="color:#000;background:#ffff66">USB</b> 2.0 EHCI)
    81 </li><li><strong><b style="color:#000;background:#ffff66">USB</b> SuperSpeed (10gbps)</strong> (<b style="color:#000;background:#ffff66">USB</b> 3.0 XHCI)
    82 </li></ul><h2 id="USBTransfertypes"><b style="color:#000;background:#ffff66">USB</b> Transfer types</h2>
    83 <p>
    84 There are four types of transfers in <b style="color:#000;background:#ffff66">USB</b>:
    85 </p>
    86 <ul><li><strong>Control Transfers</strong> Used for sending commands to the device, make inquiries, and configure the device. This transfer uses the control pipe.
    87 </li><li><strong>Interrupt Transfers</strong> Used for sending small amounts of bursty data that requires a guaranteed minimum latency. This transfer uses a data pipe.
    88 </li><li><strong>Bulk Transfers</strong> Used for large data transfers that use all available <b style="color:#000;background:#ffff66">USB</b> bandwidth with no guarantee on transfer speed or latency. This transfer uses a data pipe.
    89 </li><li><strong>Isochronous Transfers</strong> Used for data that requires a guaranteed data delivery rate. Isochronous transfers are capable of this guaranteed delivery time due to their guaranteed latency, guaranteed bus bandwidth, and lack of error correction. Without the error correction, there is no halt in transmission while packets containing errors are resent. This transfer uses a data pipe.
    90 </li></ul><h2 id="USBDeviceClasses"><b style="color:#000;background:#ffff66">USB</b> Device Classes</h2>
    91 <p>
    92 <b style="color:#000;background:#ffff66">USB</b> has a list of recognized and approved <b style="color:#000;background:#ffff66">USB</b> device classes in order to simplify driver development. The most common device classes are:
    93 </p>
    94 <ul><li>Human Interface Device (HID):
    95 <ul><li>Supports Control and Interrupt transfer types
    96 </li><li>has a max FullSpeed rate of ~64KB/s
    97 </li><li>standard driver in all modern OS
    98 </li></ul></li><li>Mass Storage Device (MSD)
    99 <ul><li>standard driver in all modern OS
    100 </li></ul></li><li>Communication Device Class (CDC)
    101 <ul><li>Supports Bulk and Isochronous transfer types
    102 </li><li>has a max FullSpeed rate of ~80KB/s
    103 </li><li>standard driver in all modern OS
    104 </li></ul></li><li>Vendor (Vendor Specific)
    105 <ul><li>Supports all four transfer types
    106 </li><li>has a max FullSpeed rate of ~1MB/s
    107 </li><li>requires custom driver (but can be userspace through libusb)
    108 </li></ul></li></ul><h2 id="HumanInterfaceDevice">Human Interface Device</h2>
    109 <p>
    110 Often vendors choose <strong>HID device class</strong> to allow control via userspace applications without needing a OS specific driver (as all modern OS's have an HID driver).
    111 </p>
    112 <p>
    113 The <a class="ext-link" href="http://www.signal11.us/oss/hidapi/"><span class="icon">​</span>HIDAPI</a> (open-source and cross-platform Linux/Windows/MacOS) provides simple <b style="color:#000;background:#ffff66">USB</b> HID enumeration, read and write functions.
    114 </p>
    115 <p>
     7 * ​[http://www.cypress.com/?docID=50830 AN57294 - USB 101: An Introduction to Universal Serial Bus 2.0] - Cypress App Note does a good job of summarizing
     8 * ​http://en.wikipedia.org/wiki/USB
     9
     10== Versions ==
     11Summary of USB versions:
     12 * USB 1.0 - USB !LowSpeed (1.5mbps) and USB !FullSpeed (12mbps)
     13 * USB 2.0 - adds USB !HighSpeed (480mbps)
     14 * USB 3.0 - adds USB !SuperSpeed (10gbps)
     15
     16== Host Controllers ==
     17The following types of USB host controllers exist:
     18 * **Universal Host Controller Interface (UHCI)**: Produced by Intel for USB 1.0 and USB 1.1. Using UHCI requires a license from Intel. This controller supports both !LowSpeed and Full-Speed.
     19 * **Open Host Controller Interface (OHCI)**: Produced for USB 1.0 and 1.1 by Compaq, Microsoft, and National Semiconductor. Supports Low-Speed and Full-Speed and tends to be more efficient then UHCI by performing more functionality in hardware.
     20 * **Extended Host Controller Interface (EHCI)**: Created for USB 2.0 after USB-IF requested that a single host controller specification be created. EHCI is used for !HighSpeed transactions and delegates !LowSpeed and !FullSpeed transactions to an OHCI or UHCI sister controller.
     21
     22
     23[=#speed]
     24== USB Speeds ==
     25The following is a set of supported speeds per USB specification:
     26 * **USB !LowSpeed** (1.5mbps) (USB 1.0 UHCI/OHCI) - Only supports Control and Interrupt transfer types
     27 * **USB !FullSpeed** (12mbps) (USB 1.0 UHCI/OHCI)
     28 * **USB !HighSpeed** (480mbps) (USB 2.0 EHCI)
     29 * **USB !SuperSpeed** (10gbps) (USB 3.0 XHCI)
     30
     31
     32== USB Transfer types ==
     33There are four types of transfers in USB:
     34 * **Control Transfers** Used for sending commands to the device, make inquiries, and configure the device. This transfer uses the control pipe.
     35 * **Interrupt Transfers** Used for sending small amounts of bursty data that requires a guaranteed minimum latency. This transfer uses a data pipe.
     36 * **Bulk Transfers** Used for large data transfers that use all available USB bandwidth with no guarantee on transfer speed or latency. This transfer uses a data pipe.
     37 * **Isochronous Transfers** Used for data that requires a guaranteed data delivery rate. Isochronous transfers are capable of this guaranteed delivery time due to their guaranteed latency, guaranteed bus bandwidth, and lack of error correction. Without the error correction, there is no halt in transmission while packets containing errors are resent. This transfer uses a data pipe.
     38
     39
     40[=#class]
     41== USB Device Classes ==
     42USB has a list of recognized and approved USB device classes in order to simplify driver development. The most common device classes are:
     43 * Human Interface Device (HID):
     44  - Supports Control and Interrupt transfer types
     45  - has a max !FullSpeed rate of ~64KB/s
     46  - standard driver in all modern OS
     47 * Mass Storage Device (MSD)
     48  - standard driver in all modern OS
     49 * Communication Device Class (CDC)
     50  - Supports Bulk and Isochronous transfer types
     51  - has a max !FullSpeed rate of ~80KB/s
     52  - standard driver in all modern OS
     53 * Vendor (Vendor Specific)
     54  - Supports all four transfer types
     55  - has a max !FullSpeed rate of ~1MB/s
     56  - requires custom driver (but can be userspace through libusb)
     57
     58
     59[=#hid]
     60== Human Interface Device ==
     61Often vendors choose **HID device class** to allow control via userspace applications without needing a OS specific driver (as all modern OS's have an HID driver).
     62
     63The ​[http://www.signal11.us/oss/hidapi/ HIDAPI] (open-source and cross-platform !Linux/Windows/MacOS) provides simple USB HID enumeration, read and write functions.
     64
    11665The HID device class uses HID reports to describe details about the data input and output a device supports. The sub class can be 'Generic HID' and the report type can be 'Vendor Defined' which makes it generic. The maximum report size is 64B.
    117 </p>
    118 <h2 id="VendorSpecific">Vendor Specific</h2>
    119 <p>
    120 Vendors sometimes choose to implement a <strong>Vendor specific</strong> device which has an undefined class.
    121 </p>
    122 <p>
    123 The <a class="ext-link" href="http://www.libusb.org/"><span class="icon">​</span>libusb</a> (open-source and cross-platform Linux/Windows/MacOS) can be used for generic <b style="color:#000;background:#ffff66">USB</b> communication. Vendor specific commands can be implemented.
    124 </p>
    125 <p>
    126 <span class="wikianchor" id="usb-devices"></span>
    127 </p>
    128 <h2 id="GateworksUSBdevices">Gateworks <b style="color:#000;background:#ffff66">USB</b> devices</h2>
    129 <p>
     66
     67
     68== Vendor Specific ==
     69Vendors sometimes choose to implement a Vendor specific device which has an undefined class.
     70
     71The ​[http://www.libusb.org/ libusb] (open-source and cross-platform !Linux/Windows/MacOS) can be used for generic USB communication. Vendor specific commands can be implemented.
     72
     73
     74== Gateworks USB devices ==
    13075In an effort to define these options available to developers, Gateworks has created the following table with the fields as follows:
    131 </p>
    132 <ul><li><strong>Family</strong>: Board Product family.
    133 </li><li><strong>SBC</strong>: The base SBC (Single Board Computer) model that the proceeding rows apply to.
    134 </li><li><strong><b style="color:#000;background:#ffff66">USB</b> Port</strong>: The particular <b style="color:#000;background:#ffff66">USB</b> port and controller in question.
    135 </li><li><strong>Ref</strong>: The reference part designator that can be found on the PCB silkscreen (white lettering).
    136 </li><li><strong>Reset Type</strong>: How the <b style="color:#000;background:#ffff66">usb</b> device is re-enumerated and/or reset, which will be either:
    137 <ul><li><em>Soft</em> - Both data lines of the <b style="color:#000;background:#ffff66">usb</b> bus are driven low, signalling a reset condition that is handled differently from device to device.
    138 </li><li><em>VBUS</em> - The 5V power rail of the port is brought down (when indicated with the manual control of a gpio).
    139 </li></ul></li><li><strong>Bus-Device[.Port]</strong>: The bus, device, and port (if behind a hub) of the port in question.
    140 </li><li><strong>Bus Steering</strong>: The conditions for the bus to be electrically steered to this port if applicable.
    141 </li></ul><p>
     76 * **Family**: Board Product family.
     77 * **SBC**: The base SBC (Single Board Computer) model that the proceeding rows apply to.
     78 * **USB Port**: The particular USB port and controller in question.
     79 * **Ref**: The reference part designator that can be found on the PCB silkscreen (white lettering).
     80 * **Reset Type**: How the usb device is re-enumerated and/or reset, which will be either:
     81  - ''Soft'' - Both data lines of the usb bus are driven low, signalling a reset condition that is handled differently from device to device.
     82  - ''VBUS'' - The 5V power rail of the port is brought down (when indicated with the manual control of a gpio).
     83 * **Bus-Device[.Port]**: The bus, device, and port (if behind a hub) of the port in question.
     84 * **Bus Steering**: The conditions for the bus to be electrically steered to this port if applicable.
     85
    14286In all cases the miniPCIe slots get their VBUS directly from the board power rail, which has no power control.
    143 </p>
    144 <p>
    145 Gateworks <b style="color:#000;background:#ffff66">USB</b> device Table:
    146 </p>
    147 <table class="wiki">
    148 <tr><th style="text-align: left"><strong>Family</strong> </th><th> <strong>SBC</strong> </th><th> <strong><b style="color:#000;background:#ffff66">USB</b> Port</strong>         </th><th> <strong>Ref</strong>   </th><th> <strong>Reset</strong>      </th><th> <strong>Bus-Device[.Port]</strong> </th><th> <strong>Bus Steering</strong>
    149 </th></tr><tr><td style="text-align: center">  Ventana      </td><td style="text-align: center">  GW51xx     </td><td> Front Panel OTG          </td><td style="text-align: center">  J20          </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td>
    150 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> miniPCIe <b style="color:#000;background:#ffff66">USB</b> EHCI        </td><td style="text-align: center">  J6           </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td>
    151 </td></tr><tr><td>
    152 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW52xx     </td><td> Front Panel OTG          </td><td style="text-align: center">  J15          </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td> gpio2 low (default)
    153 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot Right miniPCIe EHCI  </td><td style="text-align: center">  J7           </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td>
    154 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot Left miniPCIe OTG    </td><td style="text-align: center">  J8           </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td> gpio2 high         
    155 </td></tr><tr><td>
    156 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW53xx     </td><td> Front Panel OTG          </td><td style="text-align: center">  J20          </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td>
    157 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J18          </td><td style="text-align: center">  Soft/VBUS         </td><td> 2-1.1                     </td><td>
    158 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot Left miniPCIe EHCI   </td><td style="text-align: center">  J9           </td><td style="text-align: center">  Soft              </td><td> 2-1.2                     </td><td>
    159 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot Center miniPCIe EHCI </td><td style="text-align: center">  J8           </td><td style="text-align: center">  Soft              </td><td> 2-1.3                     </td><td>
    160 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot Right miniPCIe EHCI  </td><td style="text-align: center">  J6           </td><td style="text-align: center">  Soft              </td><td> 2-1.4                     </td><td>
    161 </td></tr><tr><td>
    162 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW54xx     </td><td> Front Panel OTG          </td><td style="text-align: center">  J23          </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td>
    163 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot Right miniPCIe EHCI  </td><td style="text-align: center">  J6           </td><td style="text-align: center">  Soft              </td><td> 2-1.1                     </td><td>
    164 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Top Right miniPCIe EHCI  </td><td style="text-align: center">  J9           </td><td style="text-align: center">  Soft              </td><td> 2-1.2                     </td><td>
    165 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Top Left miniPCIe EHCI   </td><td style="text-align: center">  J7           </td><td style="text-align: center">  Soft              </td><td> 2-1.3                     </td><td>
    166 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J21          </td><td style="text-align: center">  Soft/VBUS         </td><td> 2-1.4                     </td><td>
    167 </td></tr><tr><td>
    168 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW551x     </td><td> Adapter Board OTG        </td><td>J3 (J9 on Adapter)</td><td style="text-align: center">  Soft           </td><td> 1-1                       </td><td>
    169 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot miniPCIe EHCI        </td><td style="text-align: center">  J2           </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td>
    170 </td></tr><tr><td>
    171 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW552x     </td><td> Bot Left miniPCIe EHCI   </td><td style="text-align: center">  J6           </td><td style="text-align: center">  Soft              </td><td> 1-1.1                     </td><td>
    172 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Bot Right miniPCIe EHCI  </td><td style="text-align: center">  J5           </td><td style="text-align: center">  Soft              </td><td> 1-1.2                     </td><td>
    173 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J10 (Top)    </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1.3                     </td><td>
    174 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J10 (Bot)    </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1.4                     </td><td>
    175 </td></tr><tr><td>
    176 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW553x     </td><td> Front Panel OTG          </td><td style="text-align: center">  J8           </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td>
    177 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> miniPCIe EHCI            </td><td style="text-align: center">  J5           </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td>
    178 </td></tr><tr><td>
    179 </td></tr><tr><td style="text-align: center">  Laguna       </td><td style="text-align: center">  GW2380     </td><td> MiniPCIe EHCI            </td><td style="text-align: center">  J5           </td><td style="text-align: center">  Soft              </td><td> 1-1                       </td><td>
    180 </td></tr><tr><td>
    181 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW2382     </td><td> Front Panel EHCI         </td><td style="text-align: center">  J4           </td><td>  Soft/VBUS (gpio9) </td><td> 1-1                       </td><td> gpio10 high (default)
    182 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCIe EHCI            </td><td style="text-align: center">  J5           </td><td style="text-align: center">  Soft              </td><td> 1-1                       </td><td> gpio10 low
    183 </td></tr><tr><td>
    184 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW2383     </td><td> Front Panel OTG          </td><td style="text-align: center">  J4           </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td>
    185 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCIe EHCI            </td><td style="text-align: center">  J6           </td><td style="text-align: center">  Soft              </td><td> 1-2                       </td><td>
    186 </td></tr><tr><td>
    187 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW2387     </td><td> Front Panel OTG          </td><td style="text-align: center">  J12 (Top)    </td><td>  Soft/VBUS (gpio6) </td><td> 1-1                       </td><td>
    188 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J12 (Bot)    </td><td>  Soft/VBUS (gpio6) </td><td> 2-1                       </td><td> gpio5 low (default)
    189 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCI EHCI             </td><td style="text-align: center">  J5  (Bot)    </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td> gpio5 high         
    190 </td></tr><tr><td>
    191 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW2388     </td><td> Front Panel OTG          </td><td style="text-align: center">  J19 (Top)    </td><td>  Soft/VBUS (gpio6) </td><td> 1-1                       </td><td> (loading option)<sup></sup><sup>(1)</sup><sup></sup>
    192 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J19 (Bot)    </td><td>  Soft/VBUS (gpio6) </td><td> 2-1                       </td><td> (loading option)<sup></sup><sup>(1)</sup><sup></sup>
    193 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCI EHCI <sup></sup><sup>(1)</sup><sup></sup>   </td><td style="text-align: center">  J4 (Bot)     </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td> (resistor loading option)<sup></sup><sup>(1)</sup><sup></sup>
    194 </td></tr><tr><td>
    195 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW2391     </td><td> Front Panel OTG          </td><td style="text-align: center">  J14 (Top)    </td><td>  Soft/VBUS (gpio6) </td><td> 1-1                       </td><td> gpio5 low (default)
    196 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J14 (Bot)    </td><td>  Soft/VBUS (gpio6) </td><td> 2-1                       </td><td> gpio7 low (default)
    197 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCIe OTG             </td><td style="text-align: center">  J4 (Bot)     </td><td style="text-align: center">  Soft              </td><td> 1-1                       </td><td> gpio5 high
    198 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCIe EHCI            </td><td style="text-align: center">  J3 (Top)     </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td> gpio7 high
    199 </td></tr><tr><td>
    200 </td></tr><tr><td style="text-align: center">  Cambria      </td><td style="text-align: center">  GW2350     </td><td> Front Panel EHCI         </td><td style="text-align: center">  J9 (Top)     </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td>
    201 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J9 (Bot)     </td><td style="text-align: center">  Soft/VBUS         </td><td> 2-1                       </td><td>
    202 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCI EHCI <sup></sup><sup>(1)</sup><sup></sup>   </td><td style="text-align: center">  J4           </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td style="text-align: right"> (resistor loading option)<sup></sup><sup>(1)</sup><sup></sup>
    203 </td></tr><tr><td>
    204 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">  GW2358     </td><td> Front Panel EHCI         </td><td style="text-align: center">  J16 (Top)    </td><td style="text-align: center">  Soft/VBUS         </td><td> 1-1                       </td><td>
    205 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J16 (Bot)    </td><td style="text-align: center">  Soft/VBUS         </td><td> 2-1                       </td><td>
    206 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCI EHCI  <sup></sup><sup>(1)</sup><sup></sup>  </td><td style="text-align: center">  J8           </td><td style="text-align: center">  Soft              </td><td> 2-1                       </td><td style="text-align: right"> (resistor loading option)<sup></sup><sup>(1)</sup><sup></sup>
    207 </td></tr><tr><td>
    208 </td></tr><tr><td style="text-align: center">  Avila        </td><td style="text-align: left">GW2348-SP107 </td><td> Front Panel EHCI         </td><td style="text-align: center">  J18 (Top)     </td><td style="text-align: center">  Soft/VBUS        </td><td> 1-1                       </td><td>
    209 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> Front Panel EHCI         </td><td style="text-align: center">  J18 (Bot)     </td><td style="text-align: center">  Soft/VBUS        </td><td> 2-1                       </td><td>
    210 </td></tr><tr><td style="text-align: center">               </td><td style="text-align: center">             </td><td> MiniPCI EHCI  <sup></sup><sup>(1)</sup><sup></sup>  </td><td style="text-align: center">  J4            </td><td style="text-align: center">  Soft             </td><td> 2-1                       </td><td style="text-align: right"> (resistor loading option)<sup></sup><sup>(1)</sup><sup></sup>
    211 </td></tr></table>
    212 <ol><li>This is a loading option available on specials - contact ​sales@…
    213 <ul><li>Cambria GW2350 (Bottom MiniPCI socket J4)
    214 <ul><li>R164, R163 = Load to route <b style="color:#000;background:#ffff66">USB</b> to MiniPCI connector J8 (bottom slot)
    215 </li></ul></li><li>Cambria GW2358 (Bottom MiniPCI socket J8)
    216 <ul><li>R146, R153 = Load to route <b style="color:#000;background:#ffff66">USB</b> to MiniPCI connector J8 (bottom slot)
    217 </li><li>R138, R140 = Load to route <b style="color:#000;background:#ffff66">USB</b> to frontpanel connector J16 (top <b style="color:#000;background:#ffff66">USB</b> port)
    218 </li></ul></li><li>Laguna GW2388-D+ (Bottom MiniPCI socket J4)
    219 <ul><li>R240, R244 = Load to route <b style="color:#000;background:#ffff66">USB</b> to MiniPCI connector J4 (bottom slot) (default on GW2388-4)
    220 </li><li>R241, R242 = Load to route <b style="color:#000;background:#ffff66">USB</b> to frontpanel connector J19 (top <b style="color:#000;background:#ffff66">USB</b> port) (default on GW2388-SP208, SP212 and SP213 w/front panel <b style="color:#000;background:#ffff66">USB</b> loaded)
    221 </li></ul></li></ul></li></ol><p>
    222 <span class="wikianchor" id="steering"></span>
    223 </p>
    224 <h2 id="USBSteering"><b style="color:#000;background:#ffff66">USB</b> Steering</h2>
    225 <p>
    226 Some boards allow <b style="color:#000;background:#ffff66">USB</b> to be steered via a software controlled gpio. Refer to the 'bus steering' column for details which show which gpio to use, what the default is set to (via bootloader), and where it can be steered to. Typically a bus may be steerable between a front-panel connector and a miniPCIe socket in which case the front-panel is always the default configured by the bootloader. You can change the steering at run-time if you whish which would be like physically removing a <b style="color:#000;background:#ffff66">USB</b> device from the bus and adding another (re-enumerates).
    227 </p>
    228 <p>
     87
     88Gateworks USB device Table:
     89||= Family =||= SBC =||= USB Port =||= Ref =||= Reset =||= Bus-Device[.Port] =||= Bus Steering =||
     90|| Ventana || GW51xx || Front Panel OTG || J20 || Soft/VBUS || 1-1 || ||
     91||         ||        || miniPCIe USB EHCI || J6 || Soft || 2-1 || ||
     92||||
     93||         || GW52xx || Front Panel OTG || J15 || Soft/VBUS || 1-1 || gpio2 low (default)
     94||         ||        || Bot Right miniPCIe EHCI || J7 || Soft || 2-1 || ||     
     95||         ||        || Bot Left miniPCIe OTG   || J8 || Soft || 2-1 || gpio2 high ||
     96||||
     97||         || GW53xx || Front Panel OTG         || J20 || Soft/VBUS || 1-1 || ||       
     98||         ||        || Front Panel EHCI        || J18 || Soft/VBUS || 2-1.1 || ||     
     99||         ||        || Bot Left miniPCIe EHCI  || J9  || Soft      || 2-1.2 || ||     
     100||         ||        || Bot Center miniPCIe EHCI || J8 || Soft      || 2-1.3 || ||     
     101||         ||        || Bot Right miniPCIe EHCI || J6  || Soft      || 2-1.4 || ||     
     102||         ||        || GW54xx  Front Panel OTG || J23 || Soft/VBUS || 1-1   || ||     
     103||         ||        || Bot Right miniPCIe EHCI || J6  || Soft      || 2-1.1 || ||     
     104||         ||        || Top Right miniPCIe EHCI || J9  || Soft      || 2-1.2 || ||     
     105||         ||        || Top Left miniPCIe EHCI  || J7  || Soft      || 2-1.3 || ||     
     106||         ||        || Front Panel EHCI        || J21 || Soft/VBUS || 2-1.4 || ||     
     107||||
     108||         || GW551x || Adapter Board OTG       || J3 (J9 on Adapter) || Soft || 1-1 || ||     
     109||         ||        || Bot miniPCIe EHCI       || J2  || Soft      || 2-1 || ||       
     110||         ||        || GW552x  Bot Left miniPCIe EHCI || J6 || Soft || 1-1.1 || ||
     111||         ||        || Bot Right miniPCIe EHCI || J5  || Soft      || 1-1.2 || ||     
     112||         ||        || Front Panel EHCI        || J10 (Top) || Soft/VBUS || 1-1.3 || ||       
     113||         ||        || Front Panel EHCI        || J10 (Bot) || Soft/VBUS || 1-1.4 || ||       
     114||||
     115||         || GW553x || Front Panel OTG         || J8  || Soft/VBUS || 1-1 || ||       
     116||         ||        || miniPCIe EHCI           || J5  || Soft      || 2-1 || ||
     117||||
     118|| Laguna  || GW2380 || MiniPCIe EHCI           || J5  || Soft      || 1-1 || ||       
     119||||
     120||         || GW2382 || Front Panel EHCI        || J4  || Soft/VBUS (gpio9) || 1-1 || gpio10 high  (default) ||
     121||         ||        || MiniPCIe EHCI           || J5  || Soft      || 1-1 || gpio10 low ||
     122||||
     123||         || GW2383 || Front Panel OTG         || J4  || Soft/VBUS || 1-1 || ||       
     124||         ||        || MiniPCIe EHCI           || J6  || Soft      || 1-2 || ||
     125||||
     126||         || GW2387 || Front Panel OTG         || J12 (Top) || Soft/VBUS (gpio6) || 1-1 || || 
     127||         ||        || Front Panel EHCI        || J12 (Bot) || Soft/VBUS (gpio6) || 2-1 || gpio5 low  (default) ||
     128||         ||        || MiniPCI EHCI            || J5 (Bot)  || Soft || 2-1 || gpio5 high ||
     129||||
     130||         || GW2388 || Front Panel OTG         || J19 (Top) || Soft/VBUS (gpio6) || 1-1 || (loading option)^^^(1)^^^ ||
     131||         ||        || Front Panel EHCI        || J19 (Bot) || Soft/VBUS (gpio6) || 2-1 || (loading option)^^^(1)^^^ ||
     132||         ||        || MiniPCI EHCI ^^^(1)^^^        || J4 (Bot)  || Soft || 2-1 || (resistor loading option)^^^(1)^^^ ||
     133||||
     134||         || GW2391 || Front Panel OTG         || J14 (Top) || Soft/VBUS (gpio6) || 1-1 || gpio5 low (default) ||
     135||         ||        || Front Panel EHCI        || J14 (Bot) || Soft/VBUS (gpio6) || 2-1 || gpio7 low (default) ||
     136||         ||        || MiniPCIe OTG            || J4 (Bot)  || Soft || 1-1 || gpio5 high ||
     137||         ||        || MiniPCIe EHCI           || J3 (Top)  || Soft || 2-1 || gpio7 high ||
     138||||
     139|| Cambria || GW2350 || Front Panel EHCI        || J9 (Top)  || Soft/VBUS || 1-1 || ||
     140||         ||        || Front Panel EHCI        || J9 (Bot)  || Soft/VBUS || 2-1 || ||
     141||         ||        || MiniPCI EHCI ^^^(1)^^^        || J4        || Soft || 2-1 || (resistor loading option)^^^(1)^^^ ||
     142||||
     143||         || GW2358 || Front Panel EHCI        || J16 (Top) || Soft/VBUS || 1-1 || || 
     144||         ||        || Front Panel EHCI        || J16 (Bot) || Soft/VBUS || 2-1 || ||
     145||         ||        || MiniPCI EHCI ^^^(1)^^^        || J8        || Soft || 2-1 || (resistor loading option)^^^(1)^^^ ||
     146||||
     147|| Avila   || GW2348-SP107 || Front Panel EHCI  || J18 (Top) || Soft/VBUS || 1-1 || || 
     148||         ||        || Front Panel EHCI        || J18 (Bot) || Soft/VBUS || 2-1 || ||
     149||         ||        || MiniPCI EHCI ^^^(1)^^^        || J4        || Soft || 2-1 || (resistor loading option)^^^(1)^^^ ||
     150 1. This is a loading option available on specials - contact ​sales@…
     151  * Cambria GW2350 (Bottom MiniPCI socket J4)
     152   - R164, R163 = Load to route USB to MiniPCI connector J8 (bottom slot)
     153  * Cambria GW2358 (Bottom MiniPCI socket J8)
     154   - R146, R153 = Load to route USB to MiniPCI connector J8 (bottom slot)
     155   - R138, R140 = Load to route USB to frontpanel connector J16 (top USB port)
     156  * Laguna GW2388-D+ (Bottom MiniPCI socket J4)
     157   - R240, R244 = Load to route USB to MiniPCI connector J4 (bottom slot) (default on GW2388-4)
     158   - R241, R242 = Load to route USB to frontpanel connector J19 (top USB port) (default on GW2388-SP208, SP212 and SP213 w/front panel USB loaded)
     159
     160
     161[=#steering]
     162== USB Steering ==
     163Some boards allow USB to be steered via a software controlled gpio. Refer to the 'bus steering' column for details which show which gpio to use, what the default is set to (via bootloader), and where it can be steered to. Typically a bus may be steerable between a front-panel connector and a miniPCIe socket in which case the front-panel is always the default configured by the bootloader. You can change the steering at run-time if you whish which would be like physically removing a USB device from the bus and adding another (re-enumerates).
     164
    229165Examples:
    230 </p>
    231 <ul><li>Ventana GW52xx: steer the <b style="color:#000;background:#ffff66">USB</b> OTG bus to the miniPCIe socket (device-mode only) which uses gpio2:
    232 <div class="code"><pre><span class="c"># export and configure the GPIO as an output high
    233 </span><span class="nb">echo </span>2 &gt; /sys/class/gpio/export
    234 <span class="nb">echo </span>out &gt; /sys/class/gpio/gpio2/direction
    235 <span class="nb">echo </span>1 &gt; /sys/class/gpio/gpio2/value <span class="c"># 0=front-panel 1=miniPCIe-j8
    236 </span></pre></div></li><li>Laguna GW2387/GW2388/GW2391: steer <b style="color:#000;background:#ffff66">USB</b> OTG bus to miniPCIe socket (device mode only) which uses gpio 5:
    237 <div class="code"><pre><span class="nb">echo </span>1 &gt; /sys/class/gpio/gpio5/value <span class="c"># 0=front-panel 1=miniPCIe
    238 </span></pre></div></li></ul><p>
    239 <span class="wikianchor" id="reset"></span>
    240 </p>
    241 <h2 id="USBReset"><b style="color:#000;background:#ffff66">USB</b> Reset</h2>
    242 <p>
    243 The best way to reset a <b style="color:#000;background:#ffff66">USB</b> device is to 'hot plug' the device by physically removing and reinserting it. However this is not typically possible and there are other options.
    244 </p>
    245 <p>
    246 Note that <a class="wiki" href="/wiki/USB#steering">BUS Steering</a> can sometimes be a useful alternative to resetting a device as it forces a re-enumeration of the device.
    247 </p>
    248 <p>
    249 <span class="wikianchor" id="vbus-reset"></span>
    250 </p>
    251 <h3 id="VBUSreset">VBUS reset</h3>
    252 <p>
    253 The next best thing to physically removing and re-inserting a <b style="color:#000;background:#ffff66">USB</b> device is to toggle power to that device. While this is not possible on the <b style="color:#000;background:#ffff66">USB</b> bus routed to miniPCIe sockets (which run off an always 3.3V power rail) this is possible on:
    254 </p>
    255 <ul><li>OTG ports with Host capability (because they must have the ability to turn on and off their VBUS)
    256 </li><li>Front panel ports that have over-current/fault-detect capability
    257 </li><li>Ports that have a gpio controlled VBUS
    258 </li></ul><p>
    259 Ports provided by a <b style="color:#000;background:#ffff66">USB</b> OTG controller ('OTG' in <b style="color:#000;background:#ffff66">USB</b> Port name) which support host mode can have their VBUS reset by unbinding and rebinding the host controller via sysfs:
    260 </p>
    261 <ul><li>Ventana (where the OTG controller is '2184000.<b style="color:#000;background:#ffff66">usb</b>'):
    262 <div class="code"><pre><span class="nb">echo </span>2184000.<b style="color:#000;background:#ffff66">usb</b> &gt; /sys/bus/platform/drivers/imx_<b style="color:#000;background:#ffff66">usb</b>/unbind
    263 sleep 1
    264 <span class="nb">echo </span>2184000.<b style="color:#000;background:#ffff66">usb</b> &gt; /sys/bus/platform/drivers/imx_<b style="color:#000;background:#ffff66">usb</b>/bind
    265 </pre></div></li><li>Laguna (where the OTG controlleris 'dwc2.0'):
    266 <div class="code"><pre><span class="nb">echo </span>dwc2.0 &gt; /sys/bus/platform/drivers/dwc2/unbind
    267 sleep 1
    268 <span class="nb">echo </span>dwc2.0 &gt; /sys/bus/platform/drivers/dwc2/bind
    269 </pre></div></li></ul><p>
    270 Ports provided by a <b style="color:#000;background:#ffff66">USB</b> Hub's (will have a '.&lt;port&gt;' in their bus-device.port entry in the table above) with over-current/fault detection such as those found on a GW530x/GW540x can have their VBUS reset by unbinding their upstream bus-dev from the <b style="color:#000;background:#ffff66">USB</b> bus:
    271 </p>
    272 <div class="code"><pre><span class="nb">echo </span>2-1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/unbind
    273 sleep 1
    274 <span class="nb">echo </span>2-1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/bind
    275 </pre></div><ul><li>this is not possible for MiniPCIe sockets as their VBUS comes from the 3.0V rail
    276 </li></ul><p>
     166 * Ventana GW52xx: steer the USB OTG bus to the miniPCIe socket (device-mode only) which uses gpio2:
     167{{{#!bash
     168# export and configure the GPIO as an output high
     169echo 2 > /sys/class/gpio/export
     170echo out > /sys/class/gpio/gpio2/direction
     171echo 1 > /sys/class/gpio/gpio2/value # 0=front-panel 1=miniPCIe-j8
     172}}}
     173 * Laguna GW2387/GW2388/GW2391: steer USB OTG bus to miniPCIe socket (device mode only) which uses gpio 5:
     174{{{#!bash
     175echo 1 > /sys/class/gpio/gpio5/value # 0=front-panel 1=miniPCIe
     176}}}
     177
     178
     179[=#reset]
     180== USB Reset ==
     181The best way to reset a USB device is to 'hot plug' the device by physically removing and reinserting it. However this is not typically possible and there are other options.
     182
     183Note that [wiki:USB#steering BUS Steering] can sometimes be a useful alternative to resetting a device as it forces a re-enumeration of the device.
     184
     185
     186=== VBUS reset ===
     187The next best thing to physically removing and re-inserting a USB device is to toggle power to that device. While this is not possible on the USB bus routed to miniPCIe sockets (which run off an always 3.3V power rail) this is possible on:
     188 * OTG ports with Host capability (because they must have the ability to turn on and off their VBUS)
     189 * Front panel ports that have over-current/fault-detect capability
     190 * Ports that have a gpio controlled VBUS
     191
     192Ports provided by a USB OTG controller ('OTG' in USB Port name) which support host mode can have their VBUS reset by unbinding and rebinding the host controller via sysfs:
     193 * Ventana (where the OTG controller is '2184000.usb'):
     194{{{#!bash
     195echo 2184000.usb > /sys/bus/platform/drivers/imx_usb/unbind
     196sleep 1
     197echo 2184000.usb > /sys/bus/platform/drivers/imx_usb/bind
     198}}}
     199 * Laguna (where the OTG controlleris 'dwc2.0'):
     200{{{#!bash
     201echo dwc2.0 > /sys/bus/platform/drivers/dwc2/unbind
     202sleep 1
     203echo dwc2.0 > /sys/bus/platform/drivers/dwc2/bind
     204}}}
     205
     206Ports provided by a USB Hub's (will have a '.<port>' in their bus-device.port entry in the table above) with over-current/fault detection such as those found on a GW530x/GW540x can have their VBUS reset by unbinding their upstream bus-dev from the USB bus:
     207{{{#!bash
     208echo 2-1 > /sys/bus/usb/drivers/usb/unbind
     209sleep 1
     210echo 2-1 > /sys/bus/usb/drivers/usb/bind
     211}}}
     212 * this is not possible for MiniPCIe sockets as their VBUS comes from the 3.0V rail
     213
     214
    277215Ports with GPIO controlled VBUS such as the Laguna boards can be reset by turning them on/off via gpio control:
    278 </p>
    279 <ul><li>GW2382 (gpio9):
    280 <div class="code"><pre><span class="nb">echo </span>0 &gt; /sys/class/gpio/gpio9/value <span class="c"># de-assert GW2382 VUSB_EN
    281 </span>sleep 1
    282 <span class="nb">echo </span>1 &gt; /sys/class/gpio/gpio9/value <span class="c"># assert GW2382 VUSB_EN
    283 </span></pre></div></li><li>GW2387/GW2388/GW2391 (gpio6):
    284 <div class="code"><pre><span class="nb">echo </span>0 &gt; /sys/class/gpio/gpio9/value <span class="c"># de-assert GW2387/GW2388/GW2391 VUSB_EN
    285 </span>sleep 1
    286 <span class="nb">echo </span>1 &gt; /sys/class/gpio/gpio9/value <span class="c"># assert  GW2387/GW2388/GW2391 VUSB_EN
    287 </span></pre></div></li></ul><p>
    288 Refer to the <b style="color:#000;background:#ffff66">USB</b> device table above for the bus-dev and/or VBUS capabilities per board.
    289 </p>
    290 <p>
    291 <span class="wikianchor" id="sysfs-reset"></span>
    292 </p>
    293 <h3 id="Softresetviasysfsbindunbindre-enumerate">Soft reset via sysfs bind/unbind (re-enumerate)</h3>
    294 <p>
    295 In some scenarios (ie Mini-PCIe modem) having command line options to reset these devices via sysfs is preferable and can be found via modern kernel drivers. Refer to the <b style="color:#000;background:#ffff66">USB</b> Device Table above for the bus-device.port reference for your board/port.
    296 </p>
    297 <p>
    298 Note that commands targeting a hub cause a soft reset for all child devices which include the front panel and any pcie ports with "<b style="color:#000;background:#ffff66">usb</b>" on the silk screen. VBUS is only brought down on the front panel port(s) connected to the internal hub.
    299 </p>
    300 <p>
     216 * GW2382 (gpio9):
     217{{{#!bash
     218echo 0 > /sys/class/gpio/gpio9/value # de-assert GW2382 VUSB_EN
     219sleep 1
     220echo 1 > /sys/class/gpio/gpio9/value # assert GW2382 VUSB_EN
     221}}}
     222 * GW2387/GW2388/GW2391 (gpio6):
     223{{{#!bash
     224echo 0 > /sys/class/gpio/gpio9/value # de-assert GW2387/GW2388/GW2391 VUSB_EN
     225sleep 1
     226echo 1 > /sys/class/gpio/gpio9/value # assert  GW2387/GW2388/GW2391 VUSB_EN
     227}}}
     228
     229Refer to the USB device table above for the bus-dev and/or VBUS capabilities per board.
     230
     231
     232[=#binding]
     233=== Soft reset via sysfs bind/unbind (re-enumerate) ===
     234In some scenarios (ie Mini-PCIe modem) having command line options to reset these devices via sysfs is preferable and can be found via modern kernel drivers. Refer to the USB Device Table above for the bus-device.port reference for your board/port.
     235
     236Note that commands targeting a hub cause a soft reset for all child devices which include the front panel and any pcie ports with "usb" on the silk screen. VBUS is only brought down on the front panel port(s) connected to the internal hub.
     237
    301238Examples:
    302 </p>
    303 <ul><li>Reset GW54xx Front panel OTG device (bus-device 1-1). Note this will cause VBUS to be toggled for a full power reset - see above:
    304 <div class="code"><pre><span class="nb">echo </span>1-1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/unbind
    305 sleep 1
    306 <span class="nb">echo </span>1-1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/bind
    307 </pre></div></li><li>Reset GW54xx EHCI devices by unbinding/binding the <b style="color:#000;background:#ffff66">USB</b> hub (bus-device 2-1). The bot right, top right, top left miniPCIe sockets will get a 'soft reset' (because they power off 3P3V which can't be toggled) and front panel EHCI will get a full VBUS power cycle:
    308 <div class="code"><pre><span class="nb">echo </span>2-1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/unbind
    309 sleep 1
    310 <span class="nb">echo </span>2-1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/bind
    311 </pre></div></li><li>Reset GW54xx EHCI device in the top right miniPCIe socket J6 (bus-device 2-1.1):
    312 <div class="code"><pre><span class="nb">echo </span>2-1.1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/unbind
    313 sleep 1
    314 <span class="nb">echo </span>2-1.1 &gt; /sys/bus/<b style="color:#000;background:#ffff66">usb</b>/drivers/<b style="color:#000;background:#ffff66">usb</b>/bind
    315 </pre></div></li></ul><p>
    316 <span class="wikianchor" id="ioctl-reset"></span>
    317 </p>
    318 <h3 id="Softresetviaioctl">Soft reset via ioctl</h3>
    319 <p>
    320 There are also ioctls that can accomplish the same results programmaticlly and in some cases give even finer control than the above table. An example of a simple program that uses some of these ioctls is the <tt>usbreset</tt> command (present in <a class="wiki" href="/wiki/OpenWrt">OpenWrt</a>):
    321 </p>
    322 <ul><li><a class="ext-link" href="https://github.com/Gateworks/openwrt/blob/16.02/package/utils/usbreset/src/usbreset.c"><span class="icon">​</span>usbreset.c</a>
    323 </li></ul><p>
    324 Further information regarding these ioctls can be found throughout the Linux source <a class="ext-link" href="http://lxr.free-electrons.com/source/Documentation/"><span class="icon">​</span>documentation</a>.
    325 </p>
    326 }}}
     239 * Reset GW54xx Front panel OTG device (bus-device 1-1). Note this will cause VBUS to be toggled for a full power reset - see above:
     240{{{#!bash
     241echo 1-1 > /sys/bus/usb/drivers/usb/unbind
     242sleep 1
     243echo 1-1 > /sys/bus/usb/drivers/usb/bind
     244}}}
     245 * Reset GW54xx EHCI devices by unbinding/binding the USB hub (bus-device 2-1). The bot right, top right, top left miniPCIe sockets will get a 'soft reset' (because they power off 3P3V which can't be toggled) and front panel EHCI will get a full VBUS power cycle:
     246{{{#!bash
     247echo 2-1 > /sys/bus/usb/drivers/usb/unbind
     248sleep 1
     249echo 2-1 > /sys/bus/usb/drivers/usb/bind
     250}}}
     251 * Reset GW54xx EHCI device in the top right miniPCIe socket J6 (bus-device 2-1.1):
     252{{{#!bash
     253echo 2-1.1 > /sys/bus/usb/drivers/usb/unbind
     254sleep 1
     255echo 2-1.1 > /sys/bus/usb/drivers/usb/bind
     256}}}
     257
     258
     259=== Soft reset via ioctl ===
     260There are also ioctls that can accomplish the same results programmaticlly and in some cases give even finer control than the above table. An example of a simple program that uses some of these ioctls is the {{{usbreset}}} command (present in OpenWrt):
     261 * [https://github.com/Gateworks/openwrt/blob/16.02/package/utils/usbreset/src/usbreset.c usbreset.c]
     262
     263Further information regarding these ioctls can be found throughout the ​[http://lxr.free-electrons.com/source/Documentation/ Linux source documentation].
     264