![]() |
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/shQuote:
|
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 >modeCorrectly 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..." |
Re: N900 will not allow USB OTG!
because some functions of kernel seems to be in place the single problem i see is vbus power management in host mode as i see host mode depend on this
on N900 vbus power management is broken because it use another asic OUTSIDE tusb6010 for which driver is not written. on N810 this driver work so somebody must check with a patched driver ( with removed sections of vbus power ) if any device can work without vbus. after that we can hope n900 will do the same vbus will and can be a future option in driver / selection mode software few weeks ago ( beginning of march ) i tried to inject vbus & session_valid on phy asic http://talk.maemo.org/showpost.php?p...&postcount=619 ( i will post a picture with test board ) i never believe the driver and HNP can be so grossly as manual removal of device from pc i try the same thing as egoshin ( conect / disconect from a hub ) . http://talk.maemo.org/showpost.php?p...&postcount=624 . tight usb timings blinded me .i have no success because i did not stop ( nasty word here ) bme |
Re: N900 will not allow USB OTG!
Applied the patches (they only seem to add a kernel message when echoing host), kernel built and flashed.
Raised power output to 5V using joerg_rw's command. However I still can't get it to work, the flash drive gets rejected. Code:
[ 3129.551940] kb_lock (GPIO 113) is now closed |
Re: N900 will not allow USB OTG!
please have a close look to
http://mxr.maemo.org/fremantle/sourc...sb/musb_core.c 145 static inline int musb_verify_charger(void __iomem *addr) ff 207 for seemingly working handling of the pullup/pulldown Rs (the MAIN most IMPORTANT config in PHY for hostmode) |
Re: N900 will not allow USB OTG!
Quote:
61 * HP's USB bus-powered keyboard has only one configuration ff in http://mxr.maemo.org/fremantle/sourc...core/generic.c Code:
61 * HP's USB bus-powered keyboard has only one configurationCode:
135 if (insufficient_power > 0)[edit] ok, seems we killed that issue by patching out a few rather useless checks in kernel. Probably MohammadAG will come up with a small and dirty patch eventually. No big thing though. Still the fake hostmode by tricking OTG statemachine, I.E needs laptop to simulate the yet missing switch of PHY to host config (2 pulldowns) |
Re: N900 will not allow USB OTG!
1 Attachment(s)
guys, I have some news about bme's i2c communication with bq24150.
Be aware that this is ALL communication to bq24150 through the kernel. Not necessarily only by BME. initialisation (contains some nonsense IMHO): Code:
i2c-2 (W): 0x3b, (R) 1 bytes, // read register 0x3b (wraps to 0x03, datasheet states otherwise!)Code:
i2c-2 (W): 0x00 0x80, // reset safety timerThe diff for my printk's are attached. |
Re: N900 will not allow USB OTG!
those messages are obtained with high power charger attached , right ?
so nothing special , bme reset 32 s timer 4 times per minute . too often i think but in charge mode any battery savings is nonsense. bme don't destroy vbus , simply bme have no idea ( and code ) about vbus and host mode status. code is written only for charging mode not charge or boost vbus |
Re: N900 will not allow USB OTG!
Quote:
681 if (int_usb & MUSB_INTR_VBUSERROR) { 682 int ignore = 0; 683 684 /* During connection as an A-Device, we may see a short 685 * current spikes causing voltage drop, because of cable 686 * and peripheral capacitance combined with vbus draw. 687 * (So: less common with truly self-powered devices, where 688 * vbus doesn't act like a power supply.) 689 * 690 * Such spikes are short; usually less than ~500 usec, max 691 * of ~2 msec. That is, they're not sustained overcurrent 692 * errors, though they're reported using VBUSERROR irqs. 693 * 694 * Workarounds: (a) hardware: use self powered devices. 695 * (b) software: ignore non-repeated VBUS errors. 696 * 697 * REVISIT: do delays from lots of DEBUG_KERNEL checks 698 * make trouble here, keeping VBUS < 4.4V ? 699 */ 700 switch (musb->xceiv->state) { 701 case OTG_STATE_A_HOST: 702 /* recovery is dicey once we've gotten past the 703 * initial stages of enumeration, but if VBUS 704 * stayed ok at the other end of the link, and 705 * another reset is due (at least for high speed, 706 * to redo the chirp etc), it might work OK... 707 */ |
Re: N900 will not allow USB OTG!
We might want to operate hostmode without burning battery for VBUS boost, by using an externally powered hub.
Yeah we want to give our baby more energy, not take energy from it. 04-26-10 , 01:47 PM Posts: 82 | Thanked: 9 times | Joined on Nov 2009 @ leicester UK Report This | #1 Someone on one of the forums mentioned that the 'Memorex Travellink' could be used to transfer files from the n900 to a USB memory stick so I bought one. Needless to say it did not work first time, but I thought it was still worth it because I could read and copy the SD card with it, so it would still be usable when I start travelling later on in the year. Somebody posted an app to mount an exterior partition, so I downloaded it, plugged a USB stick into the Travellink and the n900 USB link 'coz I thought I could mount the stick with the downloaded app. Much to my pleasant surprise, the Travellink was able to see files on my n900 and transfer them to my USB memory stick without the use of a PC or laptop, also it not did not need the mounter wizard. What might have happened the first time is, I tried to do it without a fully charged battery, this time I tried with a fully charged battery, the perfect accessory for the traveller who wants to shoot lots of videos and store them on the road without carrying lots of kit. The Travellink runs on three AA batteries, which I would imagine can be bought all over the planet. |
Re: N900 will not allow USB OTG!
Compiled a kernel that works (finally! - thanks to joerg_rw for pointing out how to stop any power limits - my flash apparently needs more power).
I'll post a patch shortly. I also got an HDD working, using the laptop as a power source, and without any "real" hub in between (using a Y cable though). The echo host > ... part is redundant and doesn't do anything, so it can be left out. Not sure about the patches, but it seems they only add messages to the kernel messages. Also I had to edit the .config file directly not the one in arch/arm/configs, since that didn't change anything (thanks to javispedro for that one) Code:
[ 1617.796691] g_nokia gadget: high speed config #1: nokia1http://i47.tinypic.com/wmkll4.jpg http://i46.tinypic.com/m82rmq.jpg http://i48.tinypic.com/1zxbq6g.jpg |
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
CPU frequency doesn't change, and HID devices shouldn't alter frequency. It's most probably the LEDs as SpeedEvil said. It's also a plain HDD, nothing that should cause 'boost' events. |
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
EDIT: without it the scaling governor boosts frequency only after 75millisec. |
Re: N900 will not allow USB OTG!
Can we use WiMax usb modem with this host mode? madwifi drivers theoretically can be easy compiled for N900.
|
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
No Y cable here :) (The cable was for the HDD, which I tried after testing if echo host is necessary or not) |
Re: N900 will not allow USB OTG!
http://i48.tinypic.com/2uyr9u1.jpg
Bad quality (10MP cameras these days...), but you get the idea (E: yellow light was solid when the drive was connected) Code:
[38724.031738] usb 1-1: new high speed USB device using musb_hdrc and address 2Connected it to the PS3 to get more power (which kicked it back into speed - still though, nothing in /dev) However it didn't show up as a node in /dev, so I couldn't mount it. E: Also tried a Wireless-N Wi-Fi USB adapter, it didn't power up but I have two guesses: 1. It's using too much power 2. It causes a kernel panic on my PC, so it might be borked :) E2: Connecting the AC charger and running the pcsuite-enable.sh script causes the "Connected to USB device" dialog to pop up. E3: requested... http://i50.tinypic.com/2s8o8jn.jpg Code:
[45571.000640] usb 1-1: new full speed USB device using musb_hdrc and address 29E4: requested: Code:
[48481.302795] input: Microsoft Microsoft� 2.4GHz Transceiver v4.0 as /class/input/input4 |
Re: N900 will not allow USB OTG!
1 Attachment(s)
Patch to disable limits on power:
Code:
--- drivers/usb/core/generic.c 2008-12-25 01:26:37.000000000 +0200Code:
--- arch/arm/configs/rx51_defconfig 2010-05-20 14:56:18.000000000 +0300Build with make bzImage. |
Re: N900 will not allow USB OTG!
Looks wonderful, but what does these advancements here really mean if we speak just about reading/writing simple usb-stick?
- Do I need to patched kernel? - What hardware/cables do I need -- Does it matter how fast / on what order I connect cables+stick - Is it mounted automatically -- is fat32 the safest bet? |
Re: N900 will not allow USB OTG!
Quote:
- Only an F-F adapter and the stock USB cable. - It's just a bug at the moment that requires a connection to a PC first, fixing the driver should make it work without a PC. - No, not at the moment - File system doesn't matter, all should work, as long as the N900 supports them |
Re: N900 will not allow USB OTG!
where to copy this config file :D? some howto plz?
|
Re: N900 will not allow USB OTG!
Too early to give out instructions, it's still not fully working (needs a PC connection, needs a voltage boost etc...).
|
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
Basically everything accessing twl4030 GAIA is a bug wrt hostmode, no matter if it's the real hostmode or the "fake hostmode" we're talking about here in the past some weeks |
Re: N900 will not allow USB OTG!
Quote:
as i understand from specs in charge or boost mode for sustaining those functions, some activity on i2c bus is needed. if NO CHARGE mode why i2c read / writes activity ?. this useless activity drain the precious battery. i will look closer on specs for a decent reason. if vbus sensing for mode selection pop-up is needed instead of pulling status of BQ24k vbus sensing from 4030 via interrupt is preferred. popup usb mode selection is not in bme or mce . what code is doing this selection ? |
Re: N900 will not allow USB OTG!
Quote:
cat'ing the language files shows that Mass storage mode and PC Suite are in hildon-status-bar-usb, which as far as I know is closed source. e: as for the actual buttons, they're scripts, in /usr/sbin as I mentioned above. pcsuite-enable.sh for PC suite mode osso-usb-mass-storage-enable.sh for Mass storage mode. Same for disabling them (unplugging), just replace enable with disable. If you're thinking about executing pcsuite-enable.sh to trick it into host mode it won't work, you have to connect it to a real host till the driver is fixed. |
Re: N900 will not allow USB OTG!
i wish a new one with:
pc suite mode ( never used ) mass storage host ( docking station ) printer for photos ( pict bridge ) ..... |
Re: N900 will not allow USB OTG!
Quote:
Just add the echo H > command to the end of the pcsuite-enable.sh script (NOT tested, but in theory it SHOULD work) It's quite useless however, since the 'plug into PC' part is still present, which kind of defeats the purpose, again, till the driver is fixed. |
Re: N900 will not allow USB OTG!
Quote:
|
| All times are GMT. The time now is 15:09. |
vBulletin® Version 3.8.8