Changes between Version 1 and Version 2 of ventana/gw5200usb
- Timestamp:
- 01/09/2018 10:56:51 PM (7 years ago)
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 = 4 2 The 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 == 5 This can be done with settings in the bootloader as shown here: GW52xx Bootloader Configuration 6 7 == Option 2 - Command Line == 10 8 The 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 13 10 Setting 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 > /sys/class/gpio/export 16 echo out > /sys/class/gpio/gpio2/direction 17 echo 1 > /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 12 echo 2 > /sys/class/gpio/export 13 echo out > /sys/class/gpio/gpio2/direction 14 echo 1 > /sys/class/gpio/gpio2/value 15 }}} 16 17 Additionally, to accomplish this switching back and forth during run time, please use the script below: 18 {{{#!bash 19 #!/bin/sh 22 20 # 23 21 # GW52xx: … … 30 28 echo "setup" 31 29 devmem 0x20e0224 32 0x15 # hack to set SION bit in case we want read-back 32 echo 2 >/sys/class/gpio/export33 echo out >/sys/class/gpio/gpio2/direction30 echo 2 > /sys/class/gpio/export 31 echo out > /sys/class/gpio/gpio2/direction 34 32 } 35 33 case "$1" in 36 fp) echo 0 >/sys/class/gpio/gpio2/value;;37 pci) echo 1 >/sys/class/gpio/gpio2/value;;34 fp) echo 0 > /sys/class/gpio/gpio2/value;; 35 pci) echo 1 > /sys/class/gpio/gpio2/value;; 38 36 esac 39 37 # set GPIO_2 pad-mux to GPIO1__IO2 to effectively let OTG_ID go interally go … … 43 41 # attached cable and trigger a mode-switch to host-mode and thus enumerate 44 42 devmem 0x20e0210 32 0x3 45 </pre46 43 }}}