maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   N900 will not allow USB OTG! (https://talk.maemo.org/showthread.php?t=31921)

testarc 2009-12-08 11:27

Re: N900 will not allow USB OTG!
 
on dev forum : Re: N900 usb host + power charge

it seems that someone have idea for OTG capabilities... perhaps an issue

twoboxen 2009-12-08 13:54

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by testarc (Post 416277)
on dev forum : Re: N900 usb host + power charge

it seems that someone have idea for OTG capabilities... perhaps an issue

You mean this?

qole 2009-12-08 18:39

Re: N900 will not allow USB OTG!
 
That discussion looks very much like the one we had over here a month or two ago in this thread.

testarc 2009-12-08 20:08

Re: N900 will not allow USB OTG!
 
absolutly... i see the project Push n900 too .. but complicated

Thor 2009-12-08 20:14

Re: N900 will not allow USB OTG!
 
hmmm I wonder what the application in devel is all about ?

testarc 2009-12-08 21:00

Re: N900 will not allow USB OTG!
 
an usbhost to serial adapter for example :) ...

i'm to :(:confused: that the n900 OTG or Usbhost hasn't been ready.
i try to find an SDcard reader to bluetooth or wifi : no
usbhost to BT or wifi : no
OTG to BT or WIFI : no ...
no product seems to exist :(

only the part in dev section can help, Paul Fertser we stand for your reply and test http://maemo.org/community/maemo-dev..._power_charge/ :rolleyes:

thecursedfly 2009-12-08 21:08

Re: N900 will not allow USB OTG!
 
I still have to understand if this would provide the USB/ethernet support: http://talk.maemo.org/showpost.php?p...&postcount=268
[ see the three edits ]

sarahn 2009-12-09 05:06

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by qole (Post 417075)
That discussion looks very much like the one we had over here a month or two ago in this thread.

It's a tad difficult to find things in a 53 page thread.

I recall people talking about the ID pin etc. but I didn't recall people talking about HNP.

testarc 2009-12-09 07:27

Re: N900 will not allow USB OTG!
 
Sarah,

I yhink the best way actually is to create a maemo project on the garage and ask team of Push project and Paul Fertser too
and make a unique thread with all idea ?

excuse me , because i'm not a n900 user, i stand for money :D

sarahn 2009-12-09 18:05

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by testarc (Post 418235)
Sarah,

I yhink the best way actually is to create a maemo project on the garage and ask team of Push project and Paul Fertser too
and make a unique thread with all idea ?
:D

That's beyond my level of commitment and certainty. However I don't mind working with people casually.

testarc 2009-12-09 20:03

Re: N900 will not allow USB OTG!
 
Sarah ,have you try the test at the end of the dev pos http://maemo.org/community/maemo-dev..._power_charge/ :p

qole 2009-12-09 20:08

Re: N900 will not allow USB OTG!
 
Quote:

If i had an n900 in my hands, i would use the "mode" sysfs node of the musb driver, valid parameters are "host", "peripheral" and "otg". I'd switch it to the host mode and measured with DMM if there's power on the Vbus and checked the resistance between DM/DP and GND (should be ~15k). I'd connect what's lacking externally and tried attaching some mass-storage device or a mouse.
You can't switch the N900 to host mode via software. It will immediately switch back to "b_idle" from "host".

testarc et al: Seriously. Give it up. Unless you're an electrical engineer or a kernel hacker with an N900 to test with, you're probably not going to add anything new to this topic.

testarc 2009-12-09 20:17

Re: N900 will not allow USB OTG!
 
yes qole ... i'm a ***, but i'm too geek too :)
i let this thread , and stand a real reply from a good devlopper from the other thread i reference up, or from push project too.

have a nice hack :rolleyes:

twoboxen 2009-12-09 22:41

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by testarc (Post 419529)
yes qole ... i'm a ***, but i'm too geek too :)
i let this thread , and stand a real reply from a good devlopper from the other thread i reference up, or from push project too.

have a nice hack :rolleyes:

Was that english?

testarc 2009-12-10 07:21

Re: N900 will not allow USB OTG!
 
i'm a frenchy user .. haa yes , wine and bread :p

testarc 2009-12-11 08:36

Re: N900 will not allow USB OTG!
 
does anyboday has try the Mobidapter (see on this thread ?)

testarc 2009-12-14 18:52

Re: N900 will not allow USB OTG!
 
any new test of OTG or usb hosting ?

Otaku 2010-01-03 02:22

Re: N900 will not allow USB OTG!
 
Hi,

Just wondering, has anyone gotten any further with investigating USB OTG support?

I haven't quite made up my mind to buy the N900 yet... the open question about USB OTG is one of thing things holding me back for now, especially with the next Maemo device scheduled to come out this year.

Otaku 2010-01-03 03:00

Re: N900 will not allow USB OTG!
 
I'm no EE, but I was under the impression from the December 2009 activity in this thread that it still seems like there is a good chance that the hardware supports USB OTG, even though it may need a custom kernel and/or some cable trickery.

twoboxen 2010-01-03 03:39

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by Otaku (Post 450691)
I'm no EE, but I was under the impression from the December 2009 activity in this thread that it still seems like there is a good chance that the hardware supports USB OTG, even though it may need a custom kernel and/or some cable trickery.

It seems like those guys know more about the internals than anyone on this thread. Perhaps someone would be willing to work with the last guy on his test. Anyone?

andree 2010-01-03 13:47

Re: N900 will not allow USB OTG!
 
today I did some research (before I've seen this thread's new posts :-) ), and came do similar conclusions as in the thread referenced above..

The usb part of twl4030/omap3430 is handled using musb_hrdc module. Aaccording to omap3 reference manual, omap3430 is a implementation of the musb_hrdc "standard", thus the universal driver is used - and we can assume from that, that nokia didn't probably do any special tricks to the omap3 platform...

Unfortunately, the proposed host-setting solution, using

echo host > /sys/devices/platform/musb_hdrc/mode

won't work here, because of the ID pin not being attached to usb port of n900 (this disables autodetection usb mode) - and maybe because of other stuff too..

From what I've found, I think that forcing the usb controller into hostmode isn't possible with current kernel either.

HOWEVER:

The musb_hdrc module registers a file /proc/driver/musb_hdrc , that contains some debug info. By echoing misc. stuff into that file, one can change some settings of the controller.

For example

echo H > /proc/driver/musb_hdrc

stands for "request host mode". And

echo h > /proc/driver/musb_hdrc

for "cancel host mode" request...

The code for this can be found in kernel source code:

kernel-source/drivers/usb/musb/musb_procfs.c (lines 590-699)

Didn't try, whether this works - and it probably won't.

HOWEVER2 :)

The current implementation of musb_hrdc doesn't use the TESTMODE register bit MUSB_TEST_FORCE_HOST .... This should put the controller into hostmode, no matter how the ID pin is connected (text from omap3430 documentation):

The Force Host test mode enables the user to instruct the core to operate in Host mode, regardless of
whether it is actually connected to any peripheral i.e. the state of the CID input and the LINESTATE and
HOSTDISCON signals are ignored. (While in this mode, the state of the HOSTDISCON signal can be read
from bit 7 of the DevCtl register.)

This mode, which is selected by setting bit 7 within the Testmode register, allows implementation of the
USB TEST_FORCE_ENABLE (7.1.20). It can also be used for debugging PHY problems in hardware.

While the FORCE_HOST bit remains set, the core will enter Host mode when the Session bit is set and
remain in Host mode until the Session bit is cleared even if a connected device is disconnected during the
session. The operating speed while in this mode is determined for the setting of the FORCE_HS and
FORCE_FS bits of the Testmode register in Section 23.1.4.11.


I didn't find any useful sysfile to control the TESTMODE register from current kernel, so I suppose a kernel recompile is required (as musb_hrdc isn't compiled as a module), with the following added to the musb_proc_write function switch:

Code:

        case 'M':
                if (mbase) {
                        reg = musb_readb(mbase, MUSB_TESTMODE);
                        reg |= MUSB_TEST_FORCE_HOST;
                        musb_writeb(mbase, MUSB_TESTMODE, reg);
                }
                break;

        case 'm':
                if (mbase) {
                        reg = musb_readb(mbase, MUSB_TESTMODE);
                        reg &= ~MUSB_TEST_FORCE_HOST;
                        musb_writeb(mbase, MUSB_TESTMODE, reg);
                }
                break;

(PS, maybe also some option to set MUSB_TEST_FORCE_HS/FS should be added)

and after that

echo M > /proc/driver/musb_hdrc

should force controller to work in host mode... Didn't test it, don't now whether it'll work (e.g. with the proposed powered-hub workaround).. Hope someone will test this (and the previous H/h parameter) - I myself currently don't have enough time to play with it, and no custom usb cable... :)

cb22 2010-01-03 15:51

Re: N900 will not allow USB OTG!
 
Just recompiled and flashed a kernel with the changes above, unfortunately doing an
Code:

echo M > /proc/driver/musb_hdrc
for me had no effect whatsoever.

lardman 2010-01-03 16:02

Re: N900 will not allow USB OTG!
 
Not even any useful dmesg output? Shame

cb22 2010-01-03 16:08

Re: N900 will not allow USB OTG!
 
Nope... Nothing. I even added a printk to verify that it was being called, and it was.

andree 2010-01-03 16:50

Re: N900 will not allow USB OTG!
 
in that case the debugging will be a little harder, I guess... wish I had some more knowledge about electric circuits... cb22, if you have some time left, you could also try some combinations of

echo host > /sys/devices/platform/musb_hdrc/mode
echo H > /proc/driver/musb_hdrc
echo M > /proc/driver/musb_hdrc

... or also adding the FORCE_FS/FORCE_HS options to the switch (and testing that)...

did you try this with powered hub? it's possible, that we won't get any power from n900 itself...

maybe the echo M > ... isn't enough - the controller may be switched to host mode, but for some reason, the host mode information isn't propagated back to the musb_hdrc driver (does it show "host" somewhere in the sys files?)..

cb22 2010-01-03 17:23

Re: N900 will not allow USB OTG!
 
Hmm, just tried all of those and the FORCE_FS/FORCE_HS options, all seem to have no effect. Also, plugging the phone into a computer still works as normal.

andree 2010-01-03 20:29

Re: N900 will not allow USB OTG!
 
oh well, I guess we will need beagleboard or something - to debug what exactly is happening with the usb bus, when connected... crap.. ;-(

wouldn't be bad to have some nokia developer to tell us, how's it connected internally - and spare us some time...

sarahn 2010-01-05 04:54

Re: N900 will not allow USB OTG!
 
beagleboard has a pile of patches for musb http://cgit.openembedded.org/cgit.cg...ap-2.6.29/musb I don't know though if otg host mode is working on the beagleboard with that kernel.

My point is that even if some kind of off-spec host mode is supported by hardware, the driver may still be broken and/or the hardware may be buggy and require workarounds.

FYI, by default the kernel has hubs disabled. However IIRC at sufficient debug verbosity you might get an error message when you connect the hub if the hub is detected. Recompiling the kernel can get around that.

EugeneS 2010-01-06 10:39

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by andree (Post 451601)
oh well, I guess we will need beagleboard or something - to debug what exactly is happening with the usb bus, when connected... crap.. ;-(

wouldn't be bad to have some nokia developer to tell us, how's it connected internally - and spare us some time...

Possible you can reach
Felipe Balbi <felipe.balbi@nokia.com>

Recently he sent many patches about musb and OTG mode:

[RFC/PATCH 0/5] usb transceiver notifier
RFC/PATCH 1/5 - usb: otg: add notifier support
[RFC/PATCH 3/5] usb: musb: add support for ulpi block [RFC/PATCH 4/5] usb: musb: isp1704: add registers from isp1704
[RFC/PATCH 5/5] usb: musb: musb supports otg notifier

--

twoboxen 2010-01-06 13:30

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by EugeneS (Post 455334)
Recently he sent many patches about musb and OTG mode:

Patched what, Maemo? If so, that would be awesome. And, perhaps only one of us should email him :) No need to piss him off!

sarahn 2010-01-06 17:42

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by cb22 (Post 451282)
Just recompiled and flashed a kernel with the changes above, unfortunately doing an
Code:

echo M > /proc/driver/musb_hdrc
for me had no effect whatsoever.


Is this forcing the twl4030 in addition to the omap3?

Siggen 2010-01-06 21:43

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by twoboxen (Post 455503)
Patched what, Maemo? If so, that would be awesome. And, perhaps only one of us should email him :) No need to piss him off!

I could not wait, I emailed him.
If anyone else does, or wants to that's up to you, but you are reading right here that its all ready been done :)

I will post an update if I get an answer :)

And to answer your question, it would be patching the Linux kernel to support USB OTG or USB functionality on the twl4030 chip :)

captainqtp 2010-01-06 22:40

Re: N900 will not allow USB OTG!
 
Sounds hopeful at least... I was wondering... why is there a program called usbcontrol in extras-devel? The description is "Enables USB Host port to use e.g. memory sticks, keyboards and mice." version 1.03, 5kb.

Was this only intended for the n8xx series?

Siggen 2010-01-06 22:51

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by captainqtp (Post 456373)
Sounds hopeful at least... I was wondering... why is there a program called usbcontrol in extras-devel? The description is "Enables USB Host port to use e.g. memory sticks, keyboards and mice." version 1.03, 5kb.

Was this only intended for the n8xx series?

As far as I know yes, but it was upped on the N900 repo's on a assumption it would work. Though I have only been active here for one or two days now, after I ordered my first maemo device ever the N900.

Siggen 2010-01-07 16:51

Re: N900 will not allow USB OTG!
 
On Wed, Jan 06 I wrote:
Quote:

Hello i am sorry to bother you, but do you know if the twl4030 USB chipset that is in the N900 supports USB OTG or being a USB host on hardware level?
I am basically asking if we will ever see USB host functionality on the N900 in the future.
This would help a lot in my humble homebrew coding and homebrew hardware development.
The reply was as follows:
Quote:

no it won't support host mode. ID pin is missing on that board and there's no way to force it to ground on SW side.

--
balbi

I have sent a new mail to ask about an external wire from the usb port to ground on the battery but my guess is to no avail :(

go1dfish 2010-01-07 17:01

Re: N900 will not allow USB OTG!
 
Given how weakly mounted the USB port seems to be I'm not so sure you want to be connecting/disconnecting peripherals much from it regardless:
http://talk.maemo.org/showthread.php?t=37107&page=9

Especially considering it is the only way to charge short of an external charger.

Siggen 2010-01-07 17:46

Re: N900 will not allow USB OTG!
 
Im only looking personally to connect a ps3 controller, pair it, and use it via bluetooth. (no not controll the ps3 with the n900)

this only reqires a short ammount of time, one time to pair, but requires host capability

andree 2010-01-07 23:03

Re: N900 will not allow USB OTG!
 
Siggen: could you add to the question, if Felipe knows about the TESTMODE register and esp. FORCE_HOST bit...? (It's described in section 23.1.4.11 of OMAP3430 tech. ref. manual, rev. D)... I'd ask myself, but I don't want to spam him...

titan 2010-01-09 09:22

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by cb22 (Post 451302)
Nope... Nothing. I even added a printk to verify that it was being called, and it was.

could you printk the register before and after setting the bit? does it change?

Siggen 2010-01-09 23:01

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by andree (Post 458347)
Siggen: could you add to the question, if Felipe knows about the TESTMODE register and esp. FORCE_HOST bit...? (It's described in section 23.1.4.11 of OMAP3430 tech. ref. manual, rev. D)... I'd ask myself, but I don't want to spam him...

Well it cant force the ID pin to ground anyway, so we are still not able to get host. :(

I'm sorry, he still has yet to answer my second e-mail. I will ask him if he is interested to talk about it though.


All times are GMT. The time now is 15:09.

vBulletin® Version 3.8.8