Bananian Linux - Bananian Linux
View Issue Details
0000014Bananian Linux[All Projects] Kernelpublic2014-09-02 12:072014-09-07 11:25
Nico 
Nico 
normalminorhave not tried
resolvedfixed 
 
14.08 
14.0914.09 
0000014: USB OTG support
modify script.bin/fex to enable USB OTG

http://forum.lemaker.org/3077-1-1-otg_support_by_bananian.html [^]
No tags attached.
related to 0000006resolved Nico rewrite bananian-config 
Issue History
2014-09-02 12:07NicoNew Issue
2014-09-02 14:13administratorAssigned To => Nico
2014-09-02 14:13administratorStatusnew => assigned
2014-09-05 19:49NicoNote Added: 0000011
2014-09-05 19:49NicoNote Edited: 0000011bug_revision_view_page.php?bugnote_id=11#r9
2014-09-05 20:01NicoNote Added: 0000012
2014-09-05 20:01NicoStatusassigned => resolved
2014-09-05 20:01NicoFixed in Version => 14.09
2014-09-05 20:01NicoResolutionopen => fixed
2014-09-05 20:01NicoTarget Version => 14.09
2014-09-05 21:47NicoRelationship addedrelated to 0000006
2014-09-06 12:04NicoNote Added: 0000019
2014-09-06 12:04NicoStatusresolved => feedback
2014-09-06 12:04NicoResolutionfixed => reopened
2014-09-06 12:08NicoNote Added: 0000020
2014-09-06 12:08NicoStatusfeedback => assigned
2014-09-06 12:09NicoNote Added: 0000021
2014-09-06 12:14NicoNote Added: 0000022
2014-09-06 12:14NicoStatusassigned => resolved
2014-09-06 12:14NicoResolutionreopened => fixed
2014-09-07 11:25NicoNote Edited: 0000012bug_revision_view_page.php?bugnote_id=12#r13

Notes
(0000011)
Nico   
2014-09-05 19:49   
changed in script.fex (http://wiki.lemaker.org/Kernel_drivers_porting_and_configuration#Porting_USB_OTG_Driver [^]):
[usbc0]
usb_used = 1
usb_port_type = 2
usb_detect_type = 1
usb_id_gpio = port:PH04<0><1><default><default>
usb_det_vbus_gpio = port:PH05<0><0><default><default>
usb_drv_vbus_gpio = port:PB09<1><0><default><0>
usb_restric_gpio = port:PH00<1><0><default><0>
usb_host_init_state = 0
usb_restric_flag = 0
usb_restric_voltage = 3550000
usb_restric_capacity = 5

(0000012)
Nico   
2014-09-05 20:01   
(edited on: 2014-09-07 11:25)
added OTG support to (default) script.bin

script.bin files on /dev/mmcblk0p1:
--------------------------------------------------
script.bin --> standard version with OTG enabled
script.bin.otg-off --> without OTG support
script.bin.otg-on --> same as standard file
--------------------------------------------------

Just copy script.bin.no-otg to script.bin to disable OTG

(0000019)
Nico   
2014-09-06 12:04   
OTG support causes load >= 1.00
(0000020)
Nico   
2014-09-06 12:08   
usb-hardware-sc goes in D state and load goes up to 1.00

root@bananapi /mnt # ps aux | awk '$8 ~ /D/ { print $0 }'
root 23 0.0 0.0 0 0 ? D 09:21 0:00 [usb-hardware-sc]
(0000021)
Nico   
2014-09-06 12:09   
fixed with:
diff --git a/Bananapi_otg.fex.load-bug b/Bananapi_otg.fex
index 2e2837a..f16d33e 100644
--- a/Bananapi_otg.fex.load-bug
+++ b/Bananapi_otg.fex
@@ -818,13 +818,13 @@ kp_out7 = port:PH27<4><1><default><default>
 
 [usbc0]
 usb_used = 1
-usb_port_type = 2
-usb_detect_type = 1
+usb_port_type = 1
+usb_detect_type = 0
 usb_id_gpio = port:PH04<0><1><default><default>
 usb_det_vbus_gpio = port:PH05<0><0><default><default>
 usb_drv_vbus_gpio = port:PB09<1><0><default><0>
 usb_restric_gpio = port:PH00<1><0><default><0>
-usb_host_init_state = 0
+usb_host_init_state = 1
 usb_restric_flag = 0
 usb_restric_voltage = 3550000
 usb_restric_capacity = 5
(0000022)
Nico   
2014-09-06 12:14   
for details see: https://www.olimex.com/forum/index.php?topic=1757.msg7974#msg7974 [^]