Changes between Version 1 and Version 2 of ventana/gw5200usb


Ignore:
Timestamp:
01/09/2018 10:56:51 PM (7 years ago)
Author:
Tim Harvey
Comment:

convert restored html to wiki markup

Legend:

Unmodified
Added
Removed
Modified
  • ventana/gw5200usb

    v1 v2  
    1 {{{#!html
    2           <div id="wikipage" class="trac-content"><h1 id="GW52xxUSBSteering"><b style="color:#000;background:#66ffff">GW52xx USB Steering</b></h1>
    3 <p>
     1= GW52xx USB Steering =
    42The GW52xx has the ability to route the OTG USB between a Mini-PCIe slot J8 and the front panel micro connector. This can be controlled through software.
    5 </p>
    6 <h2 id="Option1-Bootloader-Recommended">Option 1 - Bootloader - Recommended</h2>
    7 <ul><li><strong>Recommended</strong>- This can be done with settings in the bootloader as shown here: <a class="wiki" href="/wiki/ventana/bootloader#USBFront-panelvsPCIesocketrouting">GW52xx Bootloader Configuration</a>
    8 </li></ul><h2 id="Option2-CommandLine">Option 2 - Command Line</h2>
    9 <p>
     3
     4== Option 1 - Bootloader - Recommended ==
     5This can be done with settings in the bootloader as shown here: GW52xx Bootloader Configuration
     6
     7== Option 2 - Command Line ==
    108The steering is controlled via GPIO2. This can be controlled in Linux at the command line once the board is booted and access to the serial console is acquired.
    11 </p>
    12 <p>
     9
    1310Setting the GPIO high will route to the Mini-PCIe slot and setting the GPIO low (0) will route it to the front panel connector:
    14 </p>
    15 <pre class="wiki">echo 2 &gt; /sys/class/gpio/export
    16 echo out &gt; /sys/class/gpio/gpio2/direction
    17 echo 1 &gt; /sys/class/gpio/gpio2/value
    18 </pre><p>
    19 Additionally, to accomplish this switching back and forth <strong>during run time</strong>, please use the script below:
    20 </p>
    21 <pre class="wiki">#!/bin/sh
     11{{{#!bash
     12echo 2 > /sys/class/gpio/export
     13echo out > /sys/class/gpio/gpio2/direction
     14echo 1 > /sys/class/gpio/gpio2/value
     15}}}
     16
     17Additionally, to accomplish this switching back and forth during run time, please use the script below:
     18{{{#!bash
     19#!/bin/sh
    2220#
    2321# GW52xx:
     
    3028  echo "setup"
    3129  devmem 0x20e0224 32 0x15 # hack to set SION bit in case we want read-back
    32   echo 2 &gt; /sys/class/gpio/export
    33   echo out &gt; /sys/class/gpio/gpio2/direction
     30  echo 2 > /sys/class/gpio/export
     31  echo out > /sys/class/gpio/gpio2/direction
    3432}
    3533case "$1" in
    36   fp)  echo 0 &gt; /sys/class/gpio/gpio2/value;;
    37   pci) echo 1 &gt; /sys/class/gpio/gpio2/value;;
     34  fp)  echo 0 > /sys/class/gpio/gpio2/value;;
     35  pci) echo 1 > /sys/class/gpio/gpio2/value;;
    3836esac
    3937# set GPIO_2 pad-mux to GPIO1__IO2 to effectively let OTG_ID go interally go
     
    4341# attached cable and trigger a mode-switch to host-mode and thus enumerate
    4442devmem 0x20e0210 32 0x3
    45 </pre
    4643}}}