[DEV] USB host mode

Search This thread

hololight

Senior Member
Dec 18, 2010
278
166
DMESG output....

PM me if you think you can help out...

Think of this as an open 'team' invite, not looking for an answer to specific question.


musb_hdrc: hw_ep 7rx, max 512
musb_hdrc: hw_ep 8tx, max 512
musb_hdrc: hw_ep 8rx, max 512
musb_hdrc: hw_ep 9tx, max 512
musb_hdrc: hw_ep 9rx, max 512
musb_hdrc: hw_ep 10tx, max 512
musb_hdrc: hw_ep 10rx, max 512
musb_hdrc: hw_ep 11tx, max 512
musb_hdrc: hw_ep 11rx, max 512
musb_hdrc: hw_ep 12tx, max 512
musb_hdrc: hw_ep 12rx, max 512
musb_hdrc: hw_ep 13tx, max 512
musb_hdrc: hw_ep 13rx, max 512
musb_hdrc: hw_ep 14shared, max 1024
musb_hdrc: hw_ep 15shared, max 1024
musb_hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
NET: Registered protocol family 2
IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
TCP established hash table entries: 65536 (order: 7, 524288 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 65536 bind 65536)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs... it is
Freeing initrd memory: 176K
dspbridge_init: 600000 bytes @ 81200000
boxer_wifi_init: start
Enabling VAUX for wifi
omap-iommu omap-iommu.0: isp registered
NetWinder Floating Point Emulator V0.97 (double precision)
ashmem: initialized
msgmni has been set to 976
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler cfq registered (default)
OMAP DSS rev 2.0
OMAP RFBI rev 1.0
OMAP DISPC rev 3.0
OMAP DSI rev 1.0
Enabling power for LCD
spi_probe mode : 0, per_word 16, chip_select 0, speed 375000, master_bus 4,master_cs 1
brd: module loaded
loop: module loaded
Linux video capture interface: v2.00
omap-previewer omap-previewer: omap-previewer: Registered preview wrapper
omap3isp omap3isp: Revision 15.0 found
omap-iommu omap-iommu.0: isp: version 1.1
Saving csi2 context
Restoring csi2 context
Saving csi2 context
i2c /dev entries driver
DSP Bridge driver loaded
Driver 'sd' needs updating - please use bus_type methods
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci_hcd: block sizes: qh 128 qtd 96 itd 160 sitd 96
android init
android_probe pdata: c04a77f0
android_bind
android_bind_config
mass_storage_function_add
fsg_probe pdata: c04a8244
android_usb gadget: Number of LUNs=2
adb_function_add
android_usb gadget: android_usb ready
musb_hdrc musb_hdrc: MUSB HDRC host driver
musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
usb usb1: default language 0x0409
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: MUSB HDRC host driver
usb usb1: Manufacturer: Linux 2.6.29-omap1 musb-hcd
usb usb1: SerialNumber: musb_hdrc
usb usb1: uevent
usb usb1: usb_probe_device
usb usb1: configuration #1 chosen from 1 choice
usb usb1: adding 1-0:1.0 (config #1, interface 0)
usb 1-0:1.0: uevent
hub 1-0:1.0: usb_probe_interface
hub 1-0:1.0: usb_probe_interface - got id
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
hub 1-0:1.0: standalone hub
hub 1-0:1.0: individual port power switching
hub 1-0:1.0: no over-current protection
hub 1-0:1.0: power on to power good time: 10ms
hub 1-0:1.0: 100mA bus power budget for each child
hub 1-0:1.0: local power source is good
hub 1-0:1.0: enabling power on all ports
input: TWL4030 Keypad as /devices/platform/i2c_omap.1/i2c-adapter/i2c-1/1-004a/twl4030_keypad/input/input0
input: gpio-keys as /devices/platform/gpio-keys/input/input1
cyttsp_init:Cypress TrueTouch(R) Standard Product
cyttsp_init:I2C Touchscreen Driver (Built Mar 29 2011 @ 13:26:30)
cyttsp_probe:Reseting TMA340
cyttsp_probe:Start Probe 1.2

cyttsp::found BL, Overriding maxx & maxy
cyttsp_initialize:cyttsp-i2c: Register input device
input: cyttsp-i2c as /devices/platform/i2c_omap.2/i2c-adapter/i2c-2/2-0022/input/input2
cyttsp_initialize:cyttsp_initialize: Create sysfs_group successfully!
cyttsp_probe:Start Probe PASS
cyttsp_power_on:BL101: f=00 s=11 err=00 bl=010B bld=010B R=16
cyttsp_power_on:BL102: tver=1100 a_id=AA1D aver=0006
cyttsp_power_on:BL103: c_id=C0C1C2
cyttsp_power_on:BL104: f=04 s=00 err=00 bl=0000 bld=0000
 
Last edited:

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
TN
linuxhacker.ru
If you mean you enabled OTG mode in the kernel config, it's not that easy.
I was not able to get vbus out of it for example.
Also forced host mode patches from N900 guys are a pain to apply to the newer driver in .29 kernel from B&N.

I am playing with it separately, but that project is on hold for now until I get microUSB-A cable. It's probably not strictly necessary, but seeing all the troubles N900 guys went through without it I better wait. Should arrive next week.
 

hololight

Senior Member
Dec 18, 2010
278
166
So here's where I'm at. My USB keyboard shows up in kernel messages. Doesn't actually do anything yet, but as soon as I saw it was enumerated I decided to call it a night.

No vbus, using a y cable to supply power from wall wart.

No kernel source as I made no changes to dal's kernel yet.

Just wanted people to know it was/ is/ will be possible.

Sent from my Desire HD using XDA App
 

joenathane

Senior Member
Oct 19, 2010
1,332
537
Phoenix
I suggest posting your changes on github and letting others help rather than posting dmesg and asking for PMs.

Off topic, but what happens when your thanks meter fills up? I think it means you win at life, and get a free pony of your choice but what do I know...

Still lots of issues to solve but, USB keyboard works. Going to upload a YouTube video in a few.

Sent from my Desire HD using XDA App

Very nice, congrats on the accomplishment! Looking forward to what all this brings....
 
Jun 1, 2009
14
0
I am really looking forward to this working. I have a nice powered usb docking station I picked up at a yard sale today for 75 cents. A couple usb ports plus ps/2 ports, serial, parallel, ethernet, and usb transfer ports.

Could this be the way we finally get audio input? Add a usb webcam and you've got skype video calls.
 

hololight

Senior Member
Dec 18, 2010
278
166
I am really looking forward to this working. I have a nice powered usb docking station I picked up at a yard sale today for 75 cents. A couple usb ports plus ps/2 ports, serial, parallel, ethernet, and usb transfer ports.

Could this be the way we finally get audio input? Add a usb webcam and you've got skype video calls.
Anything that has drivers should work at this point, but ihave only tested a keyboard. At the moment I am mostly concerned with getting vbus up (followed by 'otg'-like functionality) . There is little to no chance of automatic switching between host and device, but I'd be happy with an app to trigger state changes.

Also on a side note, no vbus could be viewed as a feature by some, as the nook will charge while using the y cable.
 

hololight

Senior Member
Dec 18, 2010
278
166
Spoke a bit too soon I guess. Just tried a flash drive; while it was detected, it was not configured as the kernel thinks there is 'not enough power'.

Basically either vbus needs to be fixed, or there will need to be a work around so that the kernel believes it has current available.... average wall charger is 500ma, so i'd go with that. I think usb spec is 500ma anyway.

Chris
 

verygreen

Senior Member
Feb 13, 2011
1,305
2,637
TN
linuxhacker.ru
How did that happen? Since V+ is being connected to the normal charge circuit, shy of shorting V+ to the data lines I can't see what you could have done.

I am not entirely sure what caused it either.
I had a patch to enable certain twl4030 properties that were more suitable for host mode (+ forced host mode via the sysfs mode setting + force ID pin in twl4030-otg link state detect).
then plugged in a keyboard into Y cable (from my usb harddisk), one side of the Y cable going into my usb hub (unpowered), another into a keyboard and third into the nook.

Since then I am a little bit worried about replicating this experiment. ;)
Do I get it right that you just enabled usb host + OTG mode in the kernel config (.32 I assume?) + Y cable and it sort of works without any kernel changes?

I really don't want to go through nook replacement again ;)
 
  • Like
Reactions: poofyhairguy

Top Liked Posts

  • There are no posts matching your filters.
  • 13
    And Video time ;)

    http://www.youtube.com/watch?v=Bovg4aBFnA8

    Now I guess I need to find out how to write an app to switch the modes (don't really program in userspace much)
    9
    DMESG output....

    PM me if you think you can help out...

    Think of this as an open 'team' invite, not looking for an answer to specific question.


    musb_hdrc: hw_ep 7rx, max 512
    musb_hdrc: hw_ep 8tx, max 512
    musb_hdrc: hw_ep 8rx, max 512
    musb_hdrc: hw_ep 9tx, max 512
    musb_hdrc: hw_ep 9rx, max 512
    musb_hdrc: hw_ep 10tx, max 512
    musb_hdrc: hw_ep 10rx, max 512
    musb_hdrc: hw_ep 11tx, max 512
    musb_hdrc: hw_ep 11rx, max 512
    musb_hdrc: hw_ep 12tx, max 512
    musb_hdrc: hw_ep 12rx, max 512
    musb_hdrc: hw_ep 13tx, max 512
    musb_hdrc: hw_ep 13rx, max 512
    musb_hdrc: hw_ep 14shared, max 1024
    musb_hdrc: hw_ep 15shared, max 1024
    musb_hdrc: USB OTG mode controller at fa0ab000 using DMA, IRQ 92
    NET: Registered protocol family 2
    IP route cache hash table entries: 16384 (order: 4, 65536 bytes)
    TCP established hash table entries: 65536 (order: 7, 524288 bytes)
    TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
    TCP: Hash tables configured (established 65536 bind 65536)
    TCP reno registered
    NET: Registered protocol family 1
    checking if image is initramfs... it is
    Freeing initrd memory: 176K
    dspbridge_init: 600000 bytes @ 81200000
    boxer_wifi_init: start
    Enabling VAUX for wifi
    omap-iommu omap-iommu.0: isp registered
    NetWinder Floating Point Emulator V0.97 (double precision)
    ashmem: initialized
    msgmni has been set to 976
    alg: No test for stdrng (krng)
    io scheduler noop registered
    io scheduler cfq registered (default)
    OMAP DSS rev 2.0
    OMAP RFBI rev 1.0
    OMAP DISPC rev 3.0
    OMAP DSI rev 1.0
    Enabling power for LCD
    spi_probe mode : 0, per_word 16, chip_select 0, speed 375000, master_bus 4,master_cs 1
    brd: module loaded
    loop: module loaded
    Linux video capture interface: v2.00
    omap-previewer omap-previewer: omap-previewer: Registered preview wrapper
    omap3isp omap3isp: Revision 15.0 found
    omap-iommu omap-iommu.0: isp: version 1.1
    Saving csi2 context
    Restoring csi2 context
    Saving csi2 context
    i2c /dev entries driver
    DSP Bridge driver loaded
    Driver 'sd' needs updating - please use bus_type methods
    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    ehci_hcd: block sizes: qh 128 qtd 96 itd 160 sitd 96
    android init
    android_probe pdata: c04a77f0
    android_bind
    android_bind_config
    mass_storage_function_add
    fsg_probe pdata: c04a8244
    android_usb gadget: Number of LUNs=2
    adb_function_add
    android_usb gadget: android_usb ready
    musb_hdrc musb_hdrc: MUSB HDRC host driver
    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
    usb usb1: default language 0x0409
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: MUSB HDRC host driver
    usb usb1: Manufacturer: Linux 2.6.29-omap1 musb-hcd
    usb usb1: SerialNumber: musb_hdrc
    usb usb1: uevent
    usb usb1: usb_probe_device
    usb usb1: configuration #1 chosen from 1 choice
    usb usb1: adding 1-0:1.0 (config #1, interface 0)
    usb 1-0:1.0: uevent
    hub 1-0:1.0: usb_probe_interface
    hub 1-0:1.0: usb_probe_interface - got id
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    hub 1-0:1.0: standalone hub
    hub 1-0:1.0: individual port power switching
    hub 1-0:1.0: no over-current protection
    hub 1-0:1.0: power on to power good time: 10ms
    hub 1-0:1.0: 100mA bus power budget for each child
    hub 1-0:1.0: local power source is good
    hub 1-0:1.0: enabling power on all ports
    input: TWL4030 Keypad as /devices/platform/i2c_omap.1/i2c-adapter/i2c-1/1-004a/twl4030_keypad/input/input0
    input: gpio-keys as /devices/platform/gpio-keys/input/input1
    cyttsp_init:Cypress TrueTouch(R) Standard Product
    cyttsp_init:I2C Touchscreen Driver (Built Mar 29 2011 @ 13:26:30)
    cyttsp_probe:Reseting TMA340
    cyttsp_probe:Start Probe 1.2

    cyttsp::found BL, Overriding maxx & maxy
    cyttsp_initialize:cyttsp-i2c: Register input device
    input: cyttsp-i2c as /devices/platform/i2c_omap.2/i2c-adapter/i2c-2/2-0022/input/input2
    cyttsp_initialize:cyttsp_initialize: Create sysfs_group successfully!
    cyttsp_probe:Start Probe PASS
    cyttsp_power_on:BL101: f=00 s=11 err=00 bl=010B bld=010B R=16
    cyttsp_power_on:BL102: tver=1100 a_id=AA1D aver=0006
    cyttsp_power_on:BL103: c_id=C0C1C2
    cyttsp_power_on:BL104: f=04 s=00 err=00 bl=0000 bld=0000
    9
    A lot of thanks go to hololight for the original proof of concept that got me thinking in another direction than I was originally pursuing.
    9
    Disregard that previous message with the patch, I just got TWL to drive proper 5V vbus voltage and have fully self-contained host mode working.
    8
    Its usefulness was small without vbus, and that was all verygreen. Grats man.


    Sent from my Desire HD using XDA App