adq


Andrew de Quincey's livejournal


Previous Entry Share Next Entry
USB patch v23 - very close to working
adq
Hi, I've deicded to release the current version (v23) of the patch for people to play with. You can find it in my adqmisc repository here. My kernel config file is also there.

If you build it, you'll end up with two modules:
  1. f_msm_hsusb.ko is the gadget/function mode driver
  2. ehci-hcd.ko is the host mode driver.
Only one may be loaded at a time. Both of them should be load/unloadable, but you'll likely have to un/replug the USB cable to get android to trigger properly (I don't see this as a big problem). You'll also have to toggle android debug support (if you want that) before and after a reload.

f_msm_hsusb.ko works in usb storage mode the first time it is loaded. However, after an unload/reload cycle it seems to stop; will have to investigate. Also, for some reason pressing the "enable usb storage" button on the phone disconnects the wifi; it doesn't do this on the normal build, so that must be some annoying bug to track down.

Enjoy!

How do you use this?

(Anonymous)

2010-04-16 10:57 pm (UTC)

Hi Andrew,
I would love to try this but I don't know how to go about building your patch into a kernel. In fact I have no idea how to build a kernel. Can you please point me in the right direction?

(I am semi technical in the sense I have basic coding knowledge)

Thanks.

Lim

How to build

(Anonymous)

2010-04-19 12:29 pm (UTC)

Any chance you would be interested in writing up a step-by-step about how to build this with the patch for us noobs? Or maybe you have a link to a good tutorial?

I'm confused by following code lines in your patch:
================
/* select DEVICE mode */
writel(0x12, USB_USBMODE);
================

The purpose of driver ehci-hcd.ko is to enable HOST mode as default during init.
But above code lines is to enable DEVICE mode. Why?

I tried to Google "USB_USBMODE writel", and found different versions of this piece of code lines, examples:
================
/* Disable streaming mode and select host mode */
writel(0x13, USB_USBMODE);
================

or:
================
/* select HOST mode */
writel(0x10|USBMODE_HOST, USB_USBMODE); /* TODO CIAN - No idea what the 0x10 is for... */
================

or:
================
/* set USBMODE to host mode */
temp = readl(hcd->regs + USBMODE_OFFSET);
writel(temp | USBMODE_CM_HOST, hcd->regs + USBMODE_OFFSET);
================

Which one is correct?
Or all of them are workable for enabling HOST mode?

The patch also contains /many/ changes for the device mode code, so I think you're seeing those mixed in with the host mode stuff.

The host mode stuff is exclusively in ehci-msm7201.c