![]() |
Re: N900 will not allow USB OTG!
Quote:
Slightly off topic, and a bit dangerous (cause of NOLO), but does anyone have 2 N900s to try flashing the other using the on board flasher? (or if flasher-3.5 works for the N8x0 then someone with an N8x0 could try connecting the device to the N900 and running flasher (flasher, not flasher-3.5)) |
Re: N900 will not allow USB OTG!
Odd and a bit off-topic, but why when I tried scrolling back a few pages in this thread I ended up being in http://forum.internettablettalk.com, and not http://talk.maemo.org? odd stuff... Did they change the domain? because if I replace the internettablettalk address with the talk.maemo address, I still get the exact same thread.
|
Re: N900 will not allow USB OTG!
Quote:
Back on topic... |
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
Quite obviously attachment of a device to N900 can not be detected unless N900 is in hostmode. So any popup requester offering a hostmode option ("host ( docking station )") is rather nonsense. The whole hassle about VBUS-supply from N900 is just because we are not in a clean plain hostmode, and tricking the OTG statemachine from B-state into A-state includes a rather complex negotiation scheme about which of both OTG devices supposed to form the session is responsible now for providing VBUS power (if any of both) - so the OTG statemachine has quite a number of useless and partially nonfunctional tests like OTG_STATE-A_VBUS_RISE etc pp (exact names may differ), and we need to do a lot of messing around with VBUS supply to make these useless tests succeed. For a plain vanilla correctly implemented hostmode, all those tests are moot and should be disabled. and again what I believe will become my mantra and signature for the next few dozen posts: We need to put "echo host >mode" to work, we need to switch PHY chip to host config which is 2* pulldown R. |
Re: N900 will not allow USB OTG!
I can now successfully mount my USB stick and here is how I did it:
Warning: only for experts!! It may damage your USB device. This not the real hostmode. It is an unstable hack to get some debug information. 1. install the kernel from (removed. insiders know where to find it) (contains MohammadAG patch and hcm's i2c debug patch) 2. boot and connect N900 via USB cable to PC, select PC suite mode 3. execute the script http://maemory.com/N900/kernel/usb/usb 4. connect your stick via USB F/F adapter to N900, wait a moment The resulting syslog excerpt is here http://maemory.com/N900/kernel/usb/syslog.gz for this I enabled USB debugging 5 before connecting to PC, so that we know what the driver does when switching to peripheral mode. |
Re: N900 will not allow USB OTG!
1 Attachment(s)
now, I have logged the I2C communication to BQ24150 for a whole charge-discharge-cycle.
I deleted lots of unnecessary lines from the logfile, but kept some stuff which is not directly related to i2c. All i2c entries are just to device 0x6b (ensured by if-statement in the kernel sourcefile, logging all i2c-messages would be way too much to analyze) I found out the following times which might be interesting: - 00:29:07 started charging - 02:16:23 battery is full (after that: sometimes charging, sometimes not => patented battery management :) ) - 09:07:11 unplugged charger - 19:28:19 shutdown because of empty battery the whole day, nothing was plugged into the usb port (I only played lots of videos to discharge the battery quickly ;) ) attached you find an image from batterygraph showing the charge/discharge. the log is too large, therefor its here (2,5MB) |
Re: N900 will not allow USB OTG!
Quote:
Note that I'm not sure what I'm talking about when I say "powered down." It might be low power ulpi protocol, it might be really powered down (but 1707 is connected to vbat?), ... |
Re: N900 will not allow USB OTG!
Quote:
BUT i want a docking station with 7 usb A receptacle capable to power N900 while is in host mode . I want charge battery because the charging hardware is independent from usb controller i can write a module doing what i want as appendices to a n900 in plain host mode with all vbus code removed i don't give up on this as a proof of concept i post a picture with a ACA with mini A receptacles for data and charger . this device can power and charge a device while this device is in plain host . in fact i don't know if this board can handle otg voltages & states and i don't care 2 month ago i tried on n900 this adapter but F..bme was in place http://talk.maemo.org/showpost.php?p...5&postcount=17 |
Re: N900 will not allow USB OTG!
Quote:
ID PULLUP may be missed sometime but DM and DP are pulldowned. |
Re: N900 will not allow USB OTG!
afik if both data lines are low level this mean SE0 and ANY device peripheral or host ( even host ) can't use data channel.
if a peripheral is inserted into a host receptacle this is signaled by pulling d+ up so this differential "1" mean session can be started. from peripheral POV those :R keep d- low for charger detection and d+ low for not initiate SRP because phy is MASTER on ulpi ( DIR signal is output on phy ) so all make sense |
Re: N900 will not allow USB OTG!
Quote:
EDIT: at least it looks like. |
Re: N900 will not allow USB OTG!
Quote:
It is theoretically feasible to be _always_ on this especial state, but I wonder about battery life... Of course since you plan to use a self powered "docking station" you could use vbus sense for the task. |
Re: N900 will not allow USB OTG!
Quote:
i want to differentiate attachment to pc or attacment to self powered charging capable docking station even in manually activated host mode vbus sense can trigger without manual selection charging mode some misunderstandings because my english knowledge is limited |
Re: N900 will not allow USB OTG!
Quote:
The use of madwifi (or other wifi drivers) would be with a USB wifi stick; among benefits over the N900's wifi are 802.11a/n 5GHz band, and packet injection for aircrack-in-a-pocket. This (aircrack stuff) was done by some people on the N8x0 after OTG arrived, search about for exact details... |
Re: N900 will not allow USB OTG!
Ha!
I found why N900 on USB-to-PC has a constant frequency 500MHz while USB cable from PC (not fast charger) is connected - ../../../arch/arm/mach-omap2/board-rx51.c:156: omap_pm_set_min_mpu_freq(dev, set ? 500000000 : 0); ... and it is called while resuming power for USB to communicate with gadget. |
Re: N900 will not allow USB OTG!
maybe try using easy debian? its a hole different os and also when i go to folder media it has mmc1, mmc2, and usb folders in it (i donts know if that helps)
|
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
|
Re: N900 will not allow USB OTG!
http://mxr.maemo.org/fremantle/sourc...b_procfs.c#661
Code:
656 case 'H': |
Re: N900 will not allow USB OTG!
unfortunately it doesn't work. I already uncommented it during our last IRC session
and verified that one cannot force the chip to hostmode. It ignores the flag even if you properly also change the flag in the context register that is normally restored as suspend or during connect. some other conditions need to fulfilled (device connected as peripheral?) for this flag to be effective. Quote:
|
Re: N900 will not allow USB OTG!
just to keep you up to date (quite some kernel patches were used, including FORCE_HOSTMODE for SoC musb. NO kickstart host PC involved).
for reference: [2010-05-24 03:59:09] <javispedro> plug b-device into [2010-05-24 03:59:39] <javispedro> n8x0: [2010-05-24 03:59:40] <javispedro> [25277.234375] musb_stage0_irq 645: CONNECT (a_host) devctl 5d [2010-05-24 03:59:40] <javispedro> [25277.234375] hub 1-0:1.0: state 8 ports 1 chg 0000 evt 0000 [2010-05-24 03:59:40] <javispedro> [25277.234375] usb usb1: usb auto-resume [2010-05-24 03:59:40] <javispedro> [25277.234375] usb usb1: finish resume [2010-05-24 03:59:40] <javispedro> [25277.234375] hub 1-0:1.0: hub_resume [2010-05-24 03:59:43] <javispedro> ... [2010-05-24 03:59:56] <javispedro> Status: MHDRC, Mode=Host (Power=f0, DevCtl=5d) [2010-05-24 03:59:57] <javispedro> OTG state: a_host; active N900: [2010-05-24 04:35:46] <javispedro> Status: MHDRC, Mode=Host (Power=60, DevCtl=5f) [2010-05-24 04:35:47] <javispedro> OTG state: a_host; active [2010-05-24 04:35:50] <javispedro> that [2010-05-24 04:35:55] <javispedro> devctl changed after pumping power [2010-05-24 04:35:58] <DocScrutinizer> STRIKE! [2010-05-24 04:36:14] <javispedro> [20987.088165] generic_interrupt [2010-05-24 04:36:14] <javispedro> [20987.088256] musb_interrupt [2010-05-24 04:36:14] <javispedro> [20987.088287] musb_interrupt 1818: ** IRQ host usb000d tx0000 rx0000 [2010-05-24 04:36:14] <javispedro> [20987.088317] musb_stage0_irq [2010-05-24 04:36:14] <javispedro> [20987.088348] musb_stage0_irq 580: <== Power=60, DevCtl=c4, int_usb=0x5 [2010-05-24 04:36:15] <javispedro> [20987.088378] musb_stage0_irq 764: SUSPEND (b_idle) devctl c4 power 60 [2010-05-24 04:36:17] <javispedro> [20987.088439] musb_stage0_irq 960: BABBLE devctl: c4 [2010-05-24 04:36:21] <javispedro> interrupts!!! [2010-05-24 04:36:24] <javispedro> my beloved interrupts. [2010-05-24 04:39:02] <javispedro> 5f is "session started" [2010-05-24 04:39:07] <javispedro> 5d isn't [2010-05-24 04:41:04] <javispedro> I am stable in devctl=5f as long as I keep running i2cset |
Re: N900 will not allow USB OTG!
Does the new commit for meego help at all?
http://meego.gitorious.org/+meego-ar...7f2aca16d605e3 |
Re: N900 will not allow USB OTG!
Quote:
This are patches to expose a few values (of questionable relevance) from low level hardware stuff to sysfs-nodes, and similar. The whole purpose is to make bme blob work (or test if it does), under meego. Nevertheless many thanks for sharing the pointer :-) cheers jOERG |
Re: N900 will not allow USB OTG!
At least it's a bit cleaned up.
|
Re: N900 will not allow USB OTG!
So.. Impossible?
|
Re: N900 will not allow USB OTG!
Quote:
BTW, can you publish your actual commands to configure chip - it may help? |
Re: N900 will not allow USB OTG!
i prepare for receiving tomatoes on my face ....
preface, facts as i understand on n900 there is 4 usb channels the first one is otg capable and the last 3 are pure hosts. isp1707 chip is connected to first channel ( otg ) until now nothing new so concentrate to this otg controller i read a mentor datasheet saying this controller is made with ~50.000 logical gates . this assembly may work stand alone or with help of core microprocessor like cheap soft "controllers", i don't care. some logic is inside this and kernel drivers must fit this. if designers of this controller follow the otg specifications saying otg session ( & state machine ) start from peripheral i wonder how can force this state machine with almost generic kernel routines trying to trick this blackbox if phy would be connected to host only port i don't have any problem, host kernel routines may fit well. so if any hacker who attempt doing host work don't have full access to full datasheet of this controller to have a clear idea how it work, which command force host and which prerequisites are necessary we grope in the dark my english prevent me to develop this ideas i watched this thread and tried to help but i don't "see" anybody wonder about what is real otg controller until now any success of host mode don't trick the specifications saying : start from peripheral mode & vbus valid ( over 4.4 V) is host working on meego ? |
Re: N900 will not allow USB OTG!
Quote:
Some snippets... Read / Set 1707 registers: Code:
case 'm':Code:
case '2':And configuring the bq vbus pump was done via user space as per DocScrutinizer instructions. Note: after seeing all this myself I don't feel this is the right way. It's hard for me to explain a feeling, but basically, it's getting interrupts that would case the state machine to move on the n8x0, but it's not moving on the n900 -- for example one that wasn't quoted was a SESSION REQUEST while in a_wait_bcon. Nothing happened, while on the N8x0 it would mean the state machine moves on to a_host state. After a while, when I killed the 5V pump, I got the BABBLE as the device died but the musb state machine didn't move either. |
Re: N900 will not allow USB OTG!
im sorry if it has been posted before but this seems to be a good alternative till some one gets the usb host working on n900.
http://www.airstash.com//support/index.html At 99$ i think its worth it considering it features. |
Re: N900 will not allow USB OTG!
Unfortunately I was not getting email notifications for this thread so I didn't realize there was work going on. This is awesome!
I am trying to quickly digest what all has happened since I looked last, there has been more than 20 pages of posts, so please excuse me for repeats. To summarize, it looks like 1. It is possible to force VBUS on by controlling bq24150 (I need to do some more reading here.) 2. host mode works by connecting to PC, use HNP, and then connecting to another device within 5 seconds (moving the state machine to b_host) 3. It is not yet possible to enter host mode without connecting to a PC first as described above. Is this correct? Is there a wrapup of kernel patches somewhere? Where I left off was getting a connection by forcing host mode w/ a power injecting cable, but the state machine entered the suspend state. Found some obvious places where that could cause problems but I haven't sat down to play with it again yet. Thanks in advance. |
Re: N900 will not allow USB OTG!
Quote:
There are no kernel patches yet that would really help in entering hostmode directly. All patching so far was more like testing how the whole thing reacts, nothing of that will result in a kernel patch needed to put hostmode to work - probably even nothing of that is needed for the HNP fake hostmode stuff in the end. |
Re: N900 will not allow USB OTG!
OK. As I said, I was pursuing forced host mode which AFAIK does require kernel patches. I have those posted back a ways though I do not know if it's the right strategy or not. Have you had a chance to look at those?
|
Re: N900 will not allow USB OTG!
Quote:
If you got full real hostmode working with a Y-cable for feeding VBUS, then we're already done, as we got the VBUS thing working by now (more or less, bme needs a kick in the a...) :-) cheers jOERG |
Re: N900 will not allow USB OTG!
HNP isn't workng for me; musb core goes into host mode but I don't get any urb or anything. Is a custom kernel actually required?
|
Re: N900 will not allow USB OTG!
Yes, the whitelist and blacklist options should be set to n, I'll PM you a precompiled zImage
|
Re: N900 will not allow USB OTG!
@egoshin & joerg
please try attempt to enter host mode following bellow sequence ! 1 apply vbus from bq 2 set r15k 3 force session 4 clear R D+ 5 force session end ( clear SESSION ) at this point bus must be SE0 6 force host 7 check / set r15k 8 clear fifo buffers( FLUSHFIFO ) 9 apply vbus 5v bq 10 set R D+ ( fake peripheral ) 11 set session bit 12 clear session bit ( no device on bus ) |
Re: N900 will not allow USB OTG!
from http://www.usb.org/developers/docs/usb_20_052510.zip i analize again ( n times) USB OTG and EH 2-0.pdf
for start FORGET a-device or embedded host state diagram because it is initialized by ID = 0 even twl4030 have an functional & valid id signal look closer to otg B_device ( fig 7.3 - otg b device state diagram ) from start state machine will enter to b_idle state ( reason : id =1 ) the only one path to b_host state is through 2 intermediate stages b_peripheral & b_wait_acon to reach b_peripheral the only one condition is b_sess_vld and this is TRUE when the B-device above VOTG_SESS_VLD ( 0.8 - 4 V ) so attach to a pc and 3.5 v from any source is sufficient to reach this stage let go further b_wait_acon the conditions to advance to this stage are: b_bus_req TRUE during the time that the Application running on the B-device wants to use the bus & b_hnp_en TRUE when the B-device has accepted the SetFeature(b_hnp_enable) & a_bus_suspend ( real life : disconnect from pc and leave usb bus to settle down ) to enter b_host the condition is detection of a peripheral performing srp ( a_conn ) it is f.. simple . we can't see forest behind trees. egoshin follow this path with success so limitaton on real n900 device with not id pin hardwired : any a-state machine can not start, and bme with charger check procedure prevent bus to enter suspend state and my final conclusions are as nokia deliver n900 ( with glorious bme ) can't perform otg as everybody know that the only host hope for us is b_host and i am confident it can be reached without a pc |
Re: N900 will not allow USB OTG!
I have started to wonder if Nokia is actually not allowed to assist in these efforts to determine how to manually turn the USB controller to hostmode, due to USB Consortium crap, or if its just due to the bme system being closed-source. Does the partial OTG software implementation in the drivers provide any actual benefits beyond pure peripheral mode? Or is it there because they started work on OTG and realized they couldn't finish it, and reworked that code instead of removing all the OTG-ness.
I have been wondering about literally hacking the bme. basically, the program would not change, and maybe with the magic of LD_PRELOAD and some tracing, we'd fake out the syscalls/library calls it would make (akin to how rootkits hide themselves). |
Re: N900 will not allow USB OTG!
FYI: I had a_host working (after connecting to PC) but it was difficult to reproduce
EDIT: oops. just noticed javispredo also mentioned in his post... IRC log from last week: Code:
musb_stage0_irq 580: <== Power=e9, DevCtl=dd, int_usb=0x10Quote:
|
| All times are GMT. The time now is 15:09. |
vBulletin® Version 3.8.8