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)

egoshin 2010-04-30 23:59

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by joerg_rw (Post 635411)
Sorry I'm not sure what you want to ask me. Please elaborate

/jOERG

You want to fix a driver, right?

So - what driver can do with charger chip to switch to HOST mode?

I see the usage of i2cset command but if you explain a bit more I could set this in driver and if you explain a little more clear how bcm returns device mode (or how to continue HOST mode if timer-in-chip is an issue) I could prevent it in driver.

EDIT: why VBUS is going to GAIA? I suspect it may be a way to start battery charging with dead operating system...
EDIT2: No, I think it services a re-flash...

egoshin 2010-05-01 00:44

Re: N900 will not allow USB OTG!
 
It looks like I located a stuff in driver...

isp1301_set_host(), file drivers/usb/otg/isp1301_omap.c excludes handling of mini-B as host :

/* If this has a Mini-AB connector, this mode is highly
* nonstandard ... but can be handy for testing, especially with
* the Mini-A end of an OTG cable. (Or something nonstandard
* like MiniB-to-StandardB, maybe built with a gender mender.)
*/
isp1301_set_bits(isp, ISP1301_OTG_CONTROL_1, OTG1_VBUS_DRV);

This code is excluded by definition of CONFIG_USB_OTG during compilation. Not sure is it safe to remove CONFIG_USB_OTG from configuration, needs testing.

The same is in isp1301_set_peripheral(), BTW.

joerg_rw 2010-05-01 01:00

Re: N900 will not allow USB OTG!
 
Last point first, more later (after a short offtime ;) )
Quote:

Originally Posted by egoshin (Post 635660)
why VBUS is going to GAIA? I suspect it may be a way to start battery charging with dead operating system...

Battery charging without system assistance is done by the CRG_DET->OTG link from 1707 PHY chip to bq24150 bat charger.
The GAIA connection is to initiate system boot when VBUS is detected and high enough voltage, and also will probably signal the already booted system about VBUS being applied (plug in detection, /sys/bus/i2c/devices/1-0048/twl4030_usb/vbus)

More tomorrow
/j

egoshin 2010-05-01 05:14

Re: N900 will not allow USB OTG!
 
After looking with attention I discovered that N900 uses TWL4030 chip driver but not ISP1301. Sorry for confusion.

And driver for TWL4030 doesn't have any attempt to enforce HOST/OTG mode actually. It just prepare a software support for peripheral devices in case of OTG/HOST setup. It is a reason why writing word 'host' to /sys/.../mode file changes nothing.

EDIT: Actually, the configuration option CONFIG_USB_MUSB_HOST has no code in TWL4030. The driver is clearly designed for OTG-via-cable host-mode usage.

joerg_rw 2010-05-01 06:04

Re: N900 will not allow USB OTG!
 
So that's exactly where the problem starts.
Do you think you could fix that? Don't bother about powering VBUS for now, it's not that simple, not that important, and probably best managed independently of the logical switch to hostmode (imagine hostmode and nevertheless powering device via USB, by using an external Y-cable)

cheers
jOERG

egoshin 2010-05-01 06:58

Re: N900 will not allow USB OTG!
 
I need some description - what to do with both chips. Right now I am reading this thread but it is still vague for me.

If I understand what can be done with 4030 (actually tps65950 ?) and 170x when I could fix a driver.

Is any chance to see a difference between isp1301 and isp1707?

maxximuscool 2010-05-01 07:07

Re: N900 will not allow USB OTG!
 
so how long until we see OTG working on N900 with a few mode and hack?

This project just keep on surprise me!

egoshin 2010-05-01 07:25

Re: N900 will not allow USB OTG!
 
I found a manual on ISP1704A and I see in it -

Table 25.
OTG_CTRL - OTG Control register (address R = 0Ah to 0Ch, W = 0Ah, S = 0Bh, C = 0Ch) bit description:


6. Drive VBUS External: Controls the external charge pump or 5 V supply by the PSW pin.
0b — PSW is LOW
1b — PSW is HIGH
DRV_VBUS_EXT

I also see in RX51 schematics that VBUS is connected to ISP1707 via 1kOhm. So?

BTW, kernel does work with ISP1704, register OTG_CTRL in musb driver and usb omap2430.c by Nokia. But only for charging and power saving/restore. No attempt to enforce 'host' mode, looks like they assume that it can be controlled by cable...

clasificado 2010-05-01 14:24

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by maxximuscool (Post 635829)
so how long until we see OTG working on N900 with a few mode and hack?

if you can understand what egoshin is talking about then you can figure it by yourself :P

if not, you should patiently wait as the rest of us for this and PR1.2 :D

joerg_rw 2010-05-01 17:57

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by egoshin (Post 635688)
It looks like I located a stuff in driver...

isp1301_set_host(), file drivers/usb/otg/isp1301_omap.c excludes handling of mini-B as host :

/* If this has a Mini-AB connector, this mode is highly
* nonstandard ... but can be handy for testing, especially with
* the Mini-A end of an OTG cable. (Or something nonstandard
* like MiniB-to-StandardB, maybe built with a gender mender.)
*/
isp1301_set_bits(isp, ISP1301_OTG_CONTROL_1, OTG1_VBUS_DRV);

This code is excluded by definition of CONFIG_USB_OTG during compilation. Not sure is it safe to remove CONFIG_USB_OTG from configuration, needs testing.

The same is in isp1301_set_peripheral(), BTW.

unsorted add:
For 1707 pulldown R:
the pulldowns are bits 1 and 2 on the OTG control register that is 0Ah to 0Ch read, 0Ah write, 0Bh set and 0Ch clear

ID pin of 1707 is hardwired to 3V3, should have been GND or even ID. But maybe we don't really need the automatic modeswitch. In fact we're borked if we need as there are no B-plugs with ID grounded


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

vBulletin® Version 3.8.8