|
2011-12-03
, 15:08
|
Posts: 2,154 |
Thanked: 8,464 times |
Joined on May 2010
|
#922
|
|
2011-12-03
, 18:53
|
Posts: 36 |
Thanked: 9 times |
Joined on Apr 2010
@ Phoenix, Arizona
|
#923
|
|
2011-12-03
, 19:20
|
|
Posts: 2,222 |
Thanked: 12,651 times |
Joined on Mar 2010
@ SOL 3
|
#924
|
|
2011-12-03
, 20:04
|
Posts: 306 |
Thanked: 566 times |
Joined on Jan 2010
@ Romania
|
#925
|
@blue_led
the userland autospeed has one problem: it needs to either depend on sysklogd being installed or use kmsg directly. You need to support both cases, or rdepend on ksyslogd pkg.
You are aware you can find about lowspeed vs high/fullspeed devices by reading out the status registers of PHY, and IIRC they are even printed in syslog. on one the D+ is low while on other the D- is low (see USB 101 about lowspeed vs full/highspeed signalling via pullup R) [maybe the prev isn't all correct as I haven't re-read the specs myself just now, it's a while since I last looked into them]
Great to see your progress, while I clearly suck delivering that stuff :-D
Keep in mind it may take quite some time after disabling boost mode until VBUS drops to a sane level so you can switch speed. Maybe testing VBUS voltage may give a clue, or just insert a short (some 5..15s) charging phase so bq24150 will try to pull power and thus discharges VBUS rail. Otherwise musb_core might not allow proper changing of speed.
jOERG
|
2011-12-03
, 22:53
|
|
Posts: 2,222 |
Thanked: 12,651 times |
Joined on Mar 2010
@ SOL 3
|
#926
|
my script is plain, dumb, ash script. for sure it don't suffer for missing lib
i think there is a bug or some curent leakage on d+ line so with no device attached the driver see a full/high speed device. also some modern usb devices don't have a physical resistor on data lines. they are inside asics and connected by inside fet transistors as found in isp707. i can't control how kernel deal with those cips . and i think this pull-up resistor is not connected instantly so the driver don't act well.
in sys log i see "Forcemode... no device attached" followed immediately by "Forcemode ... full spped device detected" .
my script is "event driven" so it wait for vbus changes, and sys messages. setting speed is not a problem but driver don't act as expected.
in one case i see "b-host" state
Late edit:
i found proper ( stable) procedure for sensing low speed devices when high or full speed is set.
rmmod g_file_storage is the key ( workaround ) . proper solution is interrupt deactivation for "vbus stable"
The Following 4 Users Say Thank You to joerg_rw For This Useful Post: | ||
|
2011-12-03
, 23:41
|
Posts: 306 |
Thanked: 566 times |
Joined on Jan 2010
@ Romania
|
#927
|
|
2011-12-04
, 23:46
|
Posts: 306 |
Thanked: 566 times |
Joined on Jan 2010
@ Romania
|
#929
|
chmod 755 install.sh install.sh
The Following 13 Users Say Thank You to blue_led For This Useful Post: | ||
bingomion, don_falcone, drucula, Estel, fpp, freemangordon, Frickelson, fw190, ivyking, joerg_rw, nkirk, pali, temp |
|
2011-12-04
, 23:52
|
|
Posts: 2,222 |
Thanked: 12,651 times |
Joined on Mar 2010
@ SOL 3
|
#930
|
@pali
it can be very possible, even OTG mode
but this depend on vbus switching and the patch will be very specialized pointing only for rx51
sensing speed of device can be done without a timer for bq24500. 32s is enough for all jobs
now it is clear for me how to do this. as my post above..
first part ->hardware detection of the device
power the vbus and read debug register
here we have 3 cases
0 no device
1 low speed device
2 high or full
after this, speed can be set and read device descriptor
if the device is high speed then switch
high speed devices can be read in full speed mode
the goal of my script is to prove the concept
@everybody
[Announce] The n900 hostmode script
unzip the attachment in a folder
as root run
Code:chmod 755 install.sh install.sh
first q :switching speed need vbus go 0 Volts. for valid usb session vbus above 4.4 volts condition is needed . switching vbus from 0 to 5 v ( for setting speed ) will trigger an interrupt activating khubd, but usb phy and driver are not in a stable state and khubd go crazy ( timeout ). generic or custom KP kernel don't know how to switch isp1707 speed ( is "platform dependent" and not allowed when vbus is 5V ). if some patches will be writen for vbus switching in kernel some processes ( bme ) need to be stopped for leaving i2c device bq24150 free to controll. and for vbus stable a timer doing any action every less 32 s on bq21450's i2c interface also is needed
so pointing from kernel space to bme and setting a timer look ugly
it is easy doing all selections from userspace
second q: is not a problem
Last edited by blue_led; 2011-12-03 at 14:55.