FORUMS
Remove All Ads from XDA

[KERNEL][ICS-CM9 or JVU] USB Host mode (OTG) driver for SGS i9000 [BUILD 5]

1,061 posts
Thanks Meter: 877
 
Post Reply Email Thread
21st January 2012, 07:03 PM |#91  
sztupy's Avatar
OP Inactive Recognized Developer
Flag London
Thanks Meter: 877
 
Donate to Me
More
Quote:
Originally Posted by sztupy

2. It initializes a charge pump using GPIO GPX3.3. Probably this is what is powering the device. Couldn't find anything related to this in the SGT/SGS files. I've tried setting some of the unused gpio pins (there are a few unused GPH pins) but nothing changed

Ah, now that I have the S5PV210 documentation it states that it's GPIO ETC2.5 (page 2-122):

ETC2[5] XuotgDRVVBUS USB OTG charge pump enable 0
ETC2[6] XuhostPWREN USB HOST charge pump enable 0
ETC2[7] XuhostOVERCUR USB HOST oevercurrent flag 0

changing this pin doesn't seem to do anything though
The Following 2 Users Say Thank You to sztupy For This Useful Post: [ View ] Gift sztupy Ad-Free
 
 
21st January 2012, 08:41 PM |#92  
Quote:
Originally Posted by sztupy

Ah, now that I have the S5PV210 documentation it states that it's GPIO ETC2.5 (page 2-122):

ETC2[5] XuotgDRVVBUS USB OTG charge pump enable 0
ETC2[6] XuhostPWREN USB HOST charge pump enable 0
ETC2[7] XuhostOVERCUR USB HOST oevercurrent flag 0

changing this pin doesn't seem to do anything though

you'll likely need to change that pin and route it through the FSA chip registers. the FSA is the gateway... its an input and output to many lines on the processor including audio, video, UART2, USB PHY0 (OTG) and USB PHY1(HOST). It has an I2C connection with the processor for controlling functions like "play" and "pause". It also has 2 separate lines which control boot mode and power modes. This chip is very important. It would not surprise me if tweaking those registers AND enabling charge pump is required.
The Following 3 Users Say Thank You to AdamOutler For This Useful Post: [ View ]
21st January 2012, 09:03 PM |#94  
sztupy's Avatar
OP Inactive Recognized Developer
Flag London
Thanks Meter: 877
 
Donate to Me
More
Quote:
Originally Posted by AdamOutler

you'll likely need to change that pin and route it through the FSA chip registers. the FSA is the gateway... its an input and output to many lines on the processor including audio, video, UART2, USB PHY0 (OTG) and USB PHY1(HOST). It has an I2C connection with the processor for controlling functions like "play" and "pause". It also has 2 separate lines which control boot mode and power modes. This chip is very important. It would not surprise me if tweaking those registers AND enabling charge pump is required.

To bad the FSA documentation avialable is for the 928x, while the phone has a 948x, the former lacking USB OTG support (this can be seen in the kernel sources as the register values the 9480 gives are considered reserved in the 9280 documentation)

On the SGS2 the FSA is not really used for this. Instead the MAX PMIC/MUIC does the job. I couldn't find anything about that chip either.
The Following 2 Users Say Thank You to sztupy For This Useful Post: [ View ] Gift sztupy Ad-Free
21st January 2012, 09:14 PM |#95  
Quote:
Originally Posted by sztupy

To bad the FSA documentation avialable is for the 928x, while the phone has a 948x, the former lacking USB OTG support (this can be seen in the kernel sources as the register values the 9480 gives are considered reserved in the 9280 documentation)

On the SGS2 the FSA is not really used for this. Instead the MAX PMIC/MUIC does the job. I couldn't find anything about that chip either.


Looks like the MAX8998 line we're concerned with is VBUS_5V, or V_BAT.

The Following 2 Users Say Thank You to AdamOutler For This Useful Post: [ View ]
21st January 2012, 09:44 PM |#96  
sztupy's Avatar
OP Inactive Recognized Developer
Flag London
Thanks Meter: 877
 
Donate to Me
More
Quote:
Originally Posted by AdamOutler

Looks like the MAX8998 line we're concerned with is VBUS_5V, or V_BAT.

Oh, haven't seen this file. To bad it still lacks a scematic that shows all the pins of the AP. The OTGDRVVBUS pin is pin number F7. Well, at least it shows it's not yellow, so it might actually be connected somewhere, that's good to see.

And according to it the power from the usb port is avtually routed through the FSA until it gets to the PMIC? I think it's a bit strange though. There is actually nothing power related in the fsa9480.c.
The Following User Says Thank You to sztupy For This Useful Post: [ View ] Gift sztupy Ad-Free
21st January 2012, 09:50 PM |#98  
sztupy's Avatar
OP Inactive Recognized Developer
Flag London
Thanks Meter: 877
 
Donate to Me
More
Quote:
Originally Posted by AdamOutler

There's more in the "Galaxy S Hack Pack" http://forum.xda-developers.com/show....php?t=1111866

Yeah I saw that. I just thought that "Samsung GT-i9000 Troubleshooting Guide.pdf" is more or less the same as "Samsung GT-i9000 Troubleshooting Guide 2.pdf"
The Following User Says Thank You to sztupy For This Useful Post: [ View ] Gift sztupy Ad-Free
21st January 2012, 10:45 PM |#99  
sztupy's Avatar
OP Inactive Recognized Developer
Flag London
Thanks Meter: 877
 
Donate to Me
More
Build2
BUILD 2
  • Upgraded to latest driver from SGS2 sources.
  • Fixed root hub device enumeration issue
  • Driver now clears allocated resources after cable is disconnected

I also added a "nice" painting describing how to connect external devices to the phone.

I'm working on stock gingerbread support now.
The Following 10 Users Say Thank You to sztupy For This Useful Post: [ View ] Gift sztupy Ad-Free
22nd January 2012, 02:14 AM |#100  
Epic_VS's Avatar
Senior Member
Thanks Meter: 42
 
More
Is anybody working on porting this to the Nexus S? If so I can test.
Sorry for my impatience.
22nd January 2012, 05:23 AM |#101  
sztupy's Avatar
OP Inactive Recognized Developer
Flag London
Thanks Meter: 877
 
Donate to Me
More
Build 3 released
Build 3 is the same code as Build 2, but it is built from the original GB/U2 kernel sources with JVU and CF-root 4.3 (link: http://forum.xda-developers.com/showthread.php?t=788108 )

This kernel update works through Odin and does not contain "Usb Host Controller". You can download it from the market though.

One of the most visible changes are that USB 1.x devices do work on this kernel, but their working are a bit strange:
  • If connected straight to the phone they work fine. I've tried a mouse, a keyboard and a wireless mouse+keyboard combo. All three worked, although sometimes I had to unplug and replug them for the phone to recognize them. Mice and keyboards do work out of the box on the JVU version of android though, you will get a nice small mouse cursor, that you can use the same ways as you use it on a PC
  • They do not work if connected through an USB 2.0 hub, they throw the same errors, and won't enumerate
  • You can connect more than one USB 1.x device if you have an USB 1.x HUB though (I found one covered in dust in the attic ). I did need to unplug/replug it at least 20 times before all of the devices I connected to it were enumerated properly. After that they did work without problems though. You can also connect USB 2.0 devices to the USB 1.x hub, but they will work with inferior speed of course.

It also seems that some RFS code in the JVU ROM is sometimes trying to do something with the freshly connected flash drive. Doesn't really does anything useful though.

The sources can be found here: https://github.com/sztupy/samsung_kernel_galaxys_gb
They have been "hand ported", so they should apply to any GB kernel source without problems.

Now that I know that usb 1.x devices work I think I'll know why they fail on the CM9 build. Going to fix that.

Download link is at post 6, as usual.
The Following 6 Users Say Thank You to sztupy For This Useful Post: [ View ] Gift sztupy Ad-Free
Post Reply Subscribe to Thread

Tags
host, ics, kernel, usb

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes