![]() |
Re: N900 will not allow USB OTG!
yes, I did see the log message. maybe my USB A F/F adapter is broken? or my USB hub??
here's the script I used: Code:
#!/bin/sh Quote:
|
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
i found why otg state machine skip some states
from http://mxr.maemo.org/fremantle/sourc...usb/omap2430.c 155 static void omap_set_vbus(struct musb *musb, int is_on) 156 { 157 u8 devctl; 158 /* HDRC controls CPEN, but beware current surges during device 159 * connect. They can trigger transient overcurrent conditions 160 * that must be ignored. 161 */ 162 163 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); 164 165 if (is_on) { 166 musb->is_active = 1; 167 musb->xceiv->default_a = 1; 168 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 169 devctl |= MUSB_DEVCTL_SESSION; 170 171 MUSB_HST_MODE(musb); 172 } else { 173 musb->is_active = 0; 174 175 /* NOTE: we're skipping A_WAIT_VFALL -> A_IDLE and 176 * jumping right to B_IDLE... 177 */ 178 179 musb->xceiv->default_a = 0; 180 musb->xceiv->state = OTG_STATE_B_IDLE; 181 devctl &= ~MUSB_DEVCTL_SESSION; 182 183 MUSB_DEV_MODE(musb); 184 } 185 musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); 186 187 DBG(1, "VBUS %s, devctl %02x " 188 /* otg %3x conf %08x prcm %08x */ "\n", 189 otg_state_string(musb), 190 musb_readb(musb->mregs, MUSB_DEVCTL)); 191 } i run around this code and from http://mxr.maemo.org/fremantle/sourc...usb/tusb6010.c 1141 if (is_host_enabled(musb)) 1142 musb->board_set_vbus = tusb_source_power; 1143 if (is_peripheral_enabled(musb)) 1144 xceiv.set_power = tusb_draw_power; workaround : can we put some #ifdef ...board_rx-51 ... code for charge vbus from bq24150 ? omap_set_vbus need more attention line 167 : wait to rise vbus over 4.4 V and after that at line 171 we have host enabled 220 #define MUSB_HST_MODE(_musb)\ 221 { (_musb)->is_host = true; } i think this host mode can be sustained by vbus above 4.4v or by session valid as i found here http://talk.maemo.org/showpost.php?p...&postcount=783 latest specifications allow peripherals detection in absence of vbus . this must be checked on isp1707 case |
Re: N900 will not allow USB OTG!
Quote:
WE NEED PLAIN HOSTMODE [edit] As javispedro made clear to me, this is a little ambiguous. So let me elaborate... Code:
musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; We need to avoid OTG state machine, we want Code:
echo host >mode Correctly here means:
|
Re: N900 will not allow USB OTG!
but lines 1141-1142 from tusb6010 don't ring a bell ?
|
Re: N900 will not allow USB OTG!
Quote:
Code:
musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; Rationale: a plain vanilla USB host has a "always on" 5V VBUS supply (sometimes literally, just hooked up to system's main 5V rail), and there is no such thing like handling VBUS for a simple host, that's all OTG which we want to avoid after all. |
Re: N900 will not allow USB OTG!
I understand that OTG is not our end goal, but hasn't the progress so far in putting the N900 into a host role and communicating with USB devices been by using what was left in the kernel or drivers for the purposes of OTG?
It seems that there are a few approaches being taken towards connecting the N900 to USB devices (as devices), so perhaps the relevent wiki page http://wiki.maemo.org/N900_Hardware_USB_Host needs to be updated? There is a lot of information that repeatedly get clarification, which might be easier to organize in a single page rather than reading through every post. |
Re: N900 will not allow USB OTG!
Friends,
We need first to set USB H/W in host mode without Host Negotiation Protocol invocation. I tried (briefly) FORCE_HOST mode but 1707 doesn't recognize a device connect. It is needed to eliminate initial PC connection from picture. It may be: a) incorrect pulldown - and I am reading USB protocols to find which should be used and how. 1707 or other side may not able to read correctly with incorrect pulldowns. b) a hub is not required to support any connection-style USB protocol (i used HUB to get USB stick mounted) - it should be in constant connect mode and send a periodic updates. I plan to repeat a FORCE_HOST mode test with external Hard Disk which may support a "connection" protocol. But I also browse through my electronic equipment which has microusb - it SHOULD support "connect" message. EDIT: if ARM USB gets "connect" message (actually - "session started") then musb driver works - my experiment proves that! Also I try to figure out - is "connection" signaling is needed to switch USB in a real host mode or is not - the problem is that then I used FORCE_HOST mode then the slave device doesn't react on any write or read transfer - looked like other side is dead. Finally, a driver doesn't support ADP at all but I think with manual host mode setup it should be not an issue for us. |
Re: N900 will not allow USB OTG!
Quote:
Quote:
Quote:
EDIT: from USB docs it seems that ADP is needed only as a signal to switch VBUS on. And other docs says that ADP flip-flop and recogntion are manual - and it is a reason why it is absent from musb (nobody wrote it :)) Quote:
|
Re: N900 will not allow USB OTG!
Quote:
Quote:
Quote:
For lockup please refer to musb_core.c line 2496 "/* resets the controller..." |
All times are GMT. The time now is 18:21. |
vBulletin® Version 3.8.8