Nice work.
What is the kernel base here? Also, MSM7201 is the same chip used in G1
phone, right?
Cheers.
Jun
I think that will be helpful to let people try on G1 phones (although
currently I am running older kernel for G1 ;0)
Cheers.
Jun
Just did a quick sanity check on my current G1 kernel. It looks very
promising. I will give it more serious try later. See below.
jsun@tata kernel]$ patch -p1 --dry-run <
../ehci-msm7201-android-msm-2.6.27-v3.patch
patching file arch/arm/mach-msm/htc_battery.c
Hunk #1 FAILED at 182.
Hunk #2 FAILED at 364.
Hunk #3 FAILED at 793.
3 out of 3 hunks FAILED -- saving rejects to file
arch/arm/mach-msm/htc_battery.c.rej
patching file drivers/usb/Kconfig
patching file drivers/usb/function/Kconfig
Hunk #1 FAILED at 14.
1 out of 1 hunk FAILED -- saving rejects to file
drivers/usb/function/Kconfig.rej
patching file drivers/usb/host/Kconfig
Hunk #1 succeeded at 75 (offset -13 lines).
patching file drivers/usb/host/ehci-hcd.c
Hunk #1 succeeded at 1043 (offset 3 lines).
patching file drivers/usb/host/ehci-msm7201.c
patching file drivers/usb/host/ehci-msm7201.h
See also my .config attached. This is an old G1 kernel, 2.6.25. We
hacked it so that we can have ECM(subset) feature in USB gadget. In
doing that we actually disabled USB_FUNCTION as well and reverted to
USB_GADGET.
Cheers.
Jun
Thanks, Andrew. This patch applies perfectly.
I build a new kernel with usb host config. See the attachment.
The kernel boots up fine, with driver starting seemingly fine. However,
plugging in a USB disk does not cause any kernel messages. I did take a
look of interrupt, there is no usb interrupts at all. See below.
Any ideas?
One thing I think could be the issue is that the USB connector might be
wrong for the host side.
Cheers.
Jun
----------------
[ 0.558361] smd_init()
[ 0.558392] smd_core_init()
[ 0.558605] smd_alloc_channel() 'SMD_RPCCALL' cid=2, shared=e010d9a0
[ 0.558911] smd_alloc_channel() 'SMD_DATA5' cid=11, shared=e0119a18
[ 0.559124] smd_alloc_channel() 'SMD_DATA6' cid=12, shared=e011da40
[ 0.559368] smd_alloc_channel() 'SMD_DATA7' cid=13, shared=e0121a68
[ 0.559582] smd_alloc_channel() 'SMD_DATA11' cid=17, shared=e01119c8
[ 0.559796] smd_alloc_channel() 'SMD_CS_A2M' cid=33, shared=e01159f0
[ 0.560091] smd_alloc_channel() 'SMD_DATA5_CNTL' cid=38, shared=e0125a90
[ 0.560366] smd_alloc_channel() 'SMD_DATA6_CNTL' cid=39, shared=e0129ab8
[ 0.560640] smd_alloc_channel() 'SMD_DATA7_CNTL' cid=40, shared=e012dae0
[ 0.560915] smd_core_init() done
[ 0.563326] SMD: ch 2 OPENING -> OPENED
[ 0.564791] hw3d: 0 init
[ 0.565249] msm_perf_init():
[ 0.566835] H2W: Registering H2W (headset) driver
[ 0.569033] input: h2w headset as /class/input/input0
[ 0.582471] RPC_TIME_TOD_SET_APPS_BASES:
[ 0.582471] tick = 339413
[ 0.582502] stamp = 855640006
[ 0.584302] ashmem: initialized
[ 0.585920] yaffs Jan 20 2010 21:15:37 Installing.
[ 0.586073] io scheduler noop registered
[ 0.586103] io scheduler anticipatory registered (default)
[ 0.586896] logger: created 64K log 'log_main'
[ 0.587080] logger: created 256K log 'log_events'
[ 0.587263] logger: created 64K log 'log_radio'
[ 0.587415] ram_console: got buffer at 16d00000, size 20000
[ 0.587904] ram_console: uncorrectable error in header
[ 0.587995] ram_console: no valid data in buffer (sig = 0xc7effffe)
[ 0.588026] console [ram-1] enabled
[ 0.591678] pmem: 1 init
[ 0.601129] pmem_adsp: 0 init
[ 0.602166] pmem_gpu0: 0 init
[ 0.603509] pmem_gpu1: 0 init
[ 0.605157] pmem_camera: 0 init
[ 0.606805] mddi_pmdh: init() base=0xe000b000 irq=16
[ 0.625493] get_smem_clock: state 10429 clock 0
[ 0.650244] mddi cmd send rtd: int 3a000, stat 8063, rtd val d
[ 0.670762] mddi_pmdh: publish: mddi_c_d263_0000
[ 0.672929] vsync on gpio 97 now 0
[ 0.673265] mddi_pmdh: mddi_add_panel(c039bda0, c02f44ac)
[ 0.673540] mddi_pmdh: publish: mddi_panel
[ 0.674272] msmfb_probe() installing 320 x 480 panel
[ 0.696286] smd_alloc_channel() 'SMD_GPSNMEA' cid=27, shared=e0131b10
[ 0.710976] msm_serial: detected port #0
[ 0.711464] msm_serial.0: ttyMSM0 at MMIO 0xa9a00000 (irq = 9) is a MSM
[ 0.712746] msm_serial: driver initialized
[ 0.714913] loop: module loaded
[ 0.715279] PPP generic driver version 2.4.2
[ 0.716042] PPP Deflate Compression module registered
[ 0.716347] PPP BSD Compression module registered
[ 0.726500] allocated dma buffer at ffc01000, dma_addr 16166000
[ 0.726958] read CFG0 = aad400c0, CFG1 = 4745c
[ 0.727507] CFG0 = e8d408c0, CFG1 = 4745c
[ 0.727812] CFG0: cw/page=3 ud_sz=516 ecc_sz=10 spare_sz=1
num_addr_cycles=5
[ 0.728575] NAND_READ_ID = 1500aaec
[ 0.729124] status: c03120
[ 0.729429] nandid: 1500aaec maker ec device aa
[ 0.729735] CFG0: cw/page=3 ud_sz=512 ecc_sz=10 spare_sz=5
[ 0.730396] DEV_CMD1: f00f3000
[ 0.730885] NAND_EBI2_ECC_BUF_CFG: 1ff
[ 0.731434] flash_id: 1500aaec size 10000000
[ 0.731739] Creating 6 MTD partitions on "msm_nand":
[ 0.732044] 0x024c0000-0x02500000 : "misc"
[ 0.733448] 0x026c0000-0x02bc0000 : "recovery"
[ 0.734547] 0x02bc0000-0x02e40000 : "boot"
[ 0.735615] 0x02e40000-0x071c0000 : "system"
[ 0.736927] 0x071c0000-0x0b540000 : "cache"
[ 0.738087] 0x0b540000-0x10000000 : "userdata"
[ 0.750091] msm_hsusb msm_hsusb: Qualcomm MSM7201 On-Chip EHCI Host
Controller
[ 0.751068] msm_hsusb msm_hsusb: new USB bus registered, assigned bus
number 1
[ 0.780213] msm_hsusb msm_hsusb: irq 47, io mem 0xa0800000
[ 0.790091] msm_hsusb msm_hsusb: USB 2.0 started, EHCI 1.00, driver
10 Dec 2004
[ 0.792044] usb usb1: configuration #1 chosen from 1 choice
[ 0.792929] hub 1-0:1.0: USB hub found
[ 0.793387] hub 1-0:1.0: 1 port detected
[ 0.800915] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.801495] usb usb1: New USB device strings: Mfr=3, Product=2,
SerialNumber=1
[ 0.801800] usb usb1: Product: Qualcomm MSM7201 On-Chip EHCI Host
Controller
[ 0.802349] usb usb1: Manufacturer: Linux 2.6.25-01843-gfea26b0 ehci_hcd
[ 0.802899] usb usb1: SerialNumber: msm_hsusb
[ 0.803540] Initializing USB Mass Storage driver...
[ 0.804058] usbcore: registered new interface driver usb-storage
[ 0.804608] USB Mass Storage support registered.
[ 0.810427] mice: PS/2 mouse device common for all mice
[ 0.847659] smd_alloc_channel() 'SMD_DS' cid=0, shared=e0135b38
[ 0.848575] smd_alloc_channel() 'SMD_DATA1' cid=7, shared=e0139b60
[ 0.849613] smd_alloc_channel() 'SMD_DATA2' cid=8, shared=e013db88
[ 0.850396] smd_alloc_channel() 'SMD_DATA3' cid=9, shared=e0141bb0
[ 0.851251] smd_alloc_channel() 'SMD_DATA4' cid=10, shared=e0145bd8
[ 0.870579] msm_i2c msm_i2c.0: Error during data xfer (-5)
[ 0.881403] synaptics_ts_probe: Product Major Version 1
[ 0.883173] synaptics_ts_probe: Product Minor Version c
[ 0.884669] synaptics_ts_probe: product property 2
[ 0.886164] synaptics_ts_probe: device control 81
[ 0.887904] synaptics_ts_probe: interrupt enable 3
[ 0.890000] synaptics_ts_probe: 0xe0: 1 1 1 2 1 c 0 0
[ 0.890000] synaptics_ts_probe: max_x 3480, max_y 5368
[ 0.890000] synaptics_ts_probe: inactive_x -80 -80, inactive_y -32 -32
[ 0.890000] synaptics_ts_probe: snap_x 240-248 240-248, snap_y 80-88
80-88
[ 0.890488] input: synaptics-rmi-touchscreen as /class/input/input1
[ 0.950763] synaptics_ts_probe: Start touchscreen
synaptics-rmi-touchscreen in interrupt mode
[ 0.951556] GPIO Event Driver
[ 0.952349] GPIO Keypad Driver: Start keypad matrix for
trout-keypad-v3 in interrupt mode
[ 0.953051] No IRQF_TRIGGER set_type function for IRQ 191 (troutgpio)
[ 0.953387] No IRQF_TRIGGER set_type function for IRQ 192 (troutgpio)
[ 0.953997] GPIO Input Driver: Start gpio inputs for trout-keypad-v3
in interrupt mode
[ 0.954333] No IRQF_TRIGGER set_type function for IRQ 188 (troutgpio)
[ 0.954913] GPIO Input Driver: Start gpio inputs for trout-keypad-v3
in interrupt mode
[ 0.955951] input: trout-keypad-v3 as /class/input/input2
[ 1.010885] No IRQF_TRIGGER set_type function for IRQ 186 (troutgpio)
[ 1.011495] GPIO Input Driver: Start gpio inputs for trout-nav in
interrupt mode
[ 1.012319] input: trout-nav as /class/input/input3
[ 1.071495] rs30000048:0da5b528 rs30000048:0da5b528: rtc core:
registered msm_rtc as rtc0
[ 1.075554] Registered led device: blue
[ 1.076134] Registered led device: green
[ 1.076591] Registered led device: red
[ 1.077263] AKM8976A compass driver: init
[ 1.077660] No IRQF_TRIGGER set_type function for IRQ 187 (troutgpio)
[ 1.078819] input: compass as /class/input/input4
[ 1.101068] pdev->dev.platform_data is not NULL
[ 1.101495] mt9t013: probe
[ 1.102044] mt9t013: init
[ 1.102319] mt9t013: mt9t013_register_init
[ 1.102624] mt9t013: camera sensor_reset set as 1
[ 1.105188] mt9t013: clk_get(vfe_mdc_clk): c02e4cc8
[ 1.105523] mt9t013: clk_get(mdc_clk): c02e4948
[ 1.105859] mt9t013: clk select 1
[ 1.106378] mt9t013: clk_get(vfe_clk): c02e4ca8
[ 1.106744] mt9t013: enable vfe_clk
[ 1.130061] mt9t013: clk select 0
[ 1.139124] mt9t013: camera sensor init sequence done
[ 1.139430] mt9t013: camera sensor suspend sequence
[ 1.140091] mt9t013: disabling vfe_clk
[ 1.140427] mt9t013: clk_put(vfe_clk): c02e4ca8
[ 1.140976] mt9t013: camera sensor suspend sequence done
[ 1.142044] Bluetooth: HCI UART driver ver 2.2
[ 1.142380] Bluetooth: HCI H4 protocol initialized
[ 1.142899] Bluetooth: HCILL protocol initialized
[ 1.144150] mmc0: Qualcomm MSM SDCC at 0x00000000e1000000 irq 24,0 dma -1
[ 1.144730] mmc0: 4 bit data mode enabled
[ 1.145004] mmc0: MMC clock 144000 -> 20000000 Hz, PCLK 64000000 Hz
[ 1.145554] mmc0: Slot eject status = 1
[ 1.145828] mmc0: Power save feature enable = 0
[ 1.146134] mmc0: PIO transfer enabled
[ 1.147629] mmc1: Qualcomm MSM SDCC at 0x00000000e1001000 irq 26,194
dma 8
[ 1.147965] mmc1: 4 bit data mode enabled
[ 1.148514] mmc1: MMC clock 144000 -> 20000000 Hz, PCLK 64000000 Hz
[ 1.148789] mmc1: Slot eject status = 0
[ 1.149094] mmc1: Power save feature enable = 0
[ 1.149613] mmc1: DM non-cached buffer at ffc06000, dma_addr 0x16189000
[ 1.149918] mmc1: DM cmd busaddr 370708480, cmdptr busaddr 370709248
[ 1.150732] Registered led device: spotlight
[ 1.151281] Registered led device: keyboard-backlight
[ 1.152044] Registered led device: button-backlight
[ 1.152838] No IRQF_TRIGGER set_type function for IRQ 190 (troutgpio)
[ 1.154028] usbcore: registered new interface driver usbhid
[ 1.154364] drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
[ 1.155432] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[ 1.163875] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 1.164638] TCP cubic registered
[ 1.165066] NET: Registered protocol family 1
[ 1.165523] NET: Registered protocol family 17
[ 1.166134] Bluetooth: L2CAP ver 2.9
[ 1.166439] Bluetooth: L2CAP socket layer initialized
[ 1.166958] Bluetooth: SCO (Voice Link) ver 0.6
[ 1.167263] Bluetooth: SCO socket layer initialized
[ 1.167934] Bluetooth: RFCOMM socket layer initialized
[ 1.168575] Bluetooth: RFCOMM TTY layer initialized
[ 1.168880] Bluetooth: RFCOMM ver 1.9
[ 1.169826] clock_late_init() disabled 18 unused clocks
[ 1.173204] rs30000048:0da5b528 rs30000048:0da5b528: setting system
clock to 2010-02-12 18:00:18 UTC (1265997618)
[ 1.173906] Freeing init memory: 104K
[ 1.174303] Warning: unable to open an initial console.
[ 1.361495] init: cannot open '/initlogo.rle'
[ 1.367415] yaffs: dev is 32505859 name is "mtdblock3"
[ 1.367995] yaffs: passed flags ""
[ 1.368300] yaffs: Attempting MTD mount on 31.3, "mtdblock3"
[ 1.400000] yaffs: restored from checkpoint
[ 1.400000] yaffs_read_super: isCheckpointed 1
[ 1.431373] yaffs: dev is 32505861 name is "mtdblock5"
[ 1.431922] yaffs: passed flags ""
[ 1.432228] yaffs: Attempting MTD mount on 31.5, "mtdblock5"
[ 1.456347] yaffs: restored from checkpoint
[ 1.456988] yaffs_read_super: isCheckpointed 1
[ 1.466073] yaffs: dev is 32505860 name is "mtdblock4"
[ 1.466653] yaffs: passed flags ""
[ 1.466958] yaffs: Attempting MTD mount on 31.4, "mtdblock4"
[ 1.471587] yaffs: restored from checkpoint
[ 1.472197] yaffs_read_super: isCheckpointed 1
[ 1.501007] init: service 'console' requires console
[ 2.218087] warning: `rild' uses 32-bit capabilities (legacy support
in use)
[ 2.268911] mmc_sd_init_card: Delay 250 ms
[ 2.628087] mmc1: host does not support reading read-only switch.
assuming write-enable.
[ 2.628545] mmc1: new SD card at address aaaa
[ 2.631587] mmcblk0: mmc1:aaaa SU01G 992000KiB
[ 2.632289] mmcblk0: p1
[ 2.638758] FAT: bogus number of reserved sectors
[ 2.639399] VFS: Can't find a valid FAT filesystem on dev mmcblk0.
[ 3.062906] SMD: ch 0 OPENING -> OPENED
[ 3.063913] qmi: smd closed
[ 3.064248] SMD: ch 38 OPENING -> OPENED
[ 3.064523] qmi: smd opened
[ 3.065286] qmi: smd closed
[ 3.065622] SMD: ch 39 OPENING -> OPENED
[ 3.065927] qmi: smd opened
[ 3.066812] qmi: smd closed
[ 3.067392] SMD: ch 40 OPENING -> OPENED
[ 3.067666] qmi: smd opened
[ 3.069650] qmi: ctl: wds use client_id 0x01
[ 3.070128] qmi: ctl: wds use client_id 0x01
[ 3.070434] qmi: ctl: wds use client_id 0x01
[ 5.166056] init: untracked pid 60 exited
[ 5.216087] init: untracked pid 62 exited
[ 12.651283] init sharp panel
[ 17.201516] android_power: wakeup (0->0) at 24781448974 (2010-02-12
18:00:41.738067627 UTC)
[ 17.845576] wlan: no version for "struct_module" found: kernel tainted.
[ 17.887621] TIWLAN: Driver loading
[ 17.888048] trout_wifi_power: 1
[ 18.100001] trout_wifi_reset: 0
[ 18.154020] trout_wifi_set_carddetect: 1
[ 18.154569] mmc0: card_present 1
[ 18.154874] mmc0: Slot status change detected (0 -> 1)
[ 18.170083] mmc0: card claims to support voltages below the defined
range. These will be ignored.
[ 18.170083] mmc0: SDIO card claims to support the incompletely
defined 'low voltage range'. This will be ignored.
[ 18.170083] mmc0: new SDIO card at address 0001
[ 18.170083] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
[ 18.174966] TIWLAN: Driver initialized (rc 0)
[ 18.175576] TIWLAN: Driver loaded
[ 29.151946] audmgr_rpc_thread() start
[ 29.152892] audio_enable()
[ 29.161550] audmgr: rpc_reply status 0
[ 29.180329] audmgr: rpc READY handle=0x00000000
[ 29.244144] audmgr: rpc CODEC_CONFIG volume=0x00002000
[ 29.245120] audpp: enable
[ 29.245517] adsp: opening module AUDPPTASK
[ 29.248721] adsp: module AUDPPTASK has been registered
[ 29.249270] msm_adsp_enable() 'AUDPPTASK'
[ 29.251000] adsp: rpc event=0, proc_id=2, module=4, image=0
[ 29.251489] adsp: module AUDPPTASK: READY
[ 29.253350] audpp: ENABLE
[ 29.253655] audio_dsp_event: CFG_MSG ENABLE
[ 29.256982] adsp: waiting for DSP write ready
[ 29.356861] audpp: DMA missed
[ 29.856861] audpp: DMA missed
[ 30.552833] audpp: DMA missed
[ 30.908875] audpp: DMA missed
[ 31.776892] audpp: DMA missed
[ 32.520880] audpp: DMA missed
[ 34.920363] audio_disable()
[ 34.921980] audio_dsp_event: CFG_MSG DISABLE
[ 34.922255] audpp: disable
[ 34.923567] msm_adsp_disable() 'AUDPPTASK'
[ 34.924116] audpp: DISABLE
[ 34.925459] adsp: closing module AUDPPTASK
[ 34.925795] adsp: disable interrupt
[ 34.930454] audmgr: rpc_reply status 0
[ 34.959182] audmgr: DISABLED
[ 44.847297] NOHZ: local_softirq_pending 08
[ 44.853147] NOHZ: local_softirq_pending 08
[ 45.090095] NOHZ: local_softirq_pending 08
[ 56.490101] NOHZ: local_softirq_pending 08
[ 56.490101] NOHZ: local_softirq_pending 08
[ 56.490101] NOHZ: local_softirq_pending 08
[ 56.520101] NOHZ: local_softirq_pending 08
[ 58.440102] NOHZ: local_softirq_pending 08
[ 58.499867] NOHZ: local_softirq_pending 08
[ 60.980103] NOHZ: local_softirq_pending 08
/ # cat /proc/interrupts
CPU0
0: 353 msm smd_dev
1: 0 msm debug
5: 2068 msm smsm_dev
7: 9565 msm gp_timer
8: 0 msm dg_timer
16: 1852 msm mddi_pmdh
19: 1090 msm msm_mdp
20: 0 msm hw3d
21: 42550 msm msmdatamover
23: 69 msm adsp
24: 2185 msm msm-sdcc (cmd)
26: 74 msm msm-sdcc (cmd)
34: 5515 msm msm_i2c
47: 0 msm ehci_hcd:usb1
82: 1 msmgpio gpio_event_axis
83: 2 msmgpio gpio_event_axis
84: 0 msmgpio gpio_keys
93: 1202 msmgpio tiwlan0
100: 0 msmgpio gpio_kp
101: 0 msmgpio gpio_kp
102: 0 msmgpio gpio_kp
103: 8 msmgpio gpio_kp
104: 0 msmgpio gpio_kp
105: 0 msmgpio gpio_kp
106: 1 msmgpio gpio_kp
113: 0 msmgpio h2w_button
147: 0 msmgpio h2w_detect
154: 1 msmgpio gpio_event_axis
158: 1 msmgpio gpio_event_axis
161: 839 msmgpio vsync
186: 0 troutgpio gpio_keys
187: 0 troutgpio akm8976
188: 0 troutgpio gpio_keys
190: 0 troutgpio switch-gpio
191: 0 troutgpio gpio_keys
192: 0 troutgpio gpio_keys
193: 279 troutgpio synaptics-rmi-ts
194: 0 troutgpio msm-sdcc (slot)
Err: 0
/ #
I have just gotten this working on a tmo mytouch sapphire 32B with a
cyanogen 2.6.29 kernel patched with a modification of Andrew's code.
This verifies that the hardware is host capable, with a y cable for
power dmesg shows the names of peripherals plugged in.
There was some sort of bug with one of the private data structures
getting wiped out; I did a very ugly temporary fix to get past that.
Many thanks to Andrew for the pioneering work and off list support.
Chris
The patch applies cleanly but.... there must be something wicked at
some point: once I enable "USB Host" I simply can't find any "EHCI/
MSM720" HCD option...
Is there any other option I do need to set or unset somewhere else to
get that EHCI/MSM720 option to appear ?
Cheers
Olivier
On 9 fév, 21:16, Andrew de Quincey <a...@lidskialf.net> wrote:
> Hi, here's my now working patch - I've still a bit of work to do on it
> obviously, but it should suffice as a proof of concept
>
> ehci-msm7201-v2.patch
> 21KAfficherTélécharger
I've tried patching the cyanogen 2.6.29.6-cm42 kernel with your usb
host code for basically the same finds root hub and nothing else
result on a magic32b that Jun Sun posted from a g1.
Im using a usb hard drive's Y cable and a usb A to mini adapter; I
think this should be good as the phone will charge off either the real
mini or the adapted one. But nothing in dmesg either booting with
devices connected or connecting them later.
I think I need to learn about how the enumeration process is supposed
to trigger in an ordinary host only system.
Maybe one of us can figure out how to try a kernel closer to yours,
also should look for g1/magic vs. hero differences in source.
Chris
> The patch applies cleanly but.... there must be something wicked at
> some point: once I enable "USB Host" I simply can't find any "EHCI/
> MSM720" HCD option...
You need to disable usb gadget or usb function,
then enable EHCI HCD (USB 2.0) support
then Support for Qualcomm MSM7201 on-chip EHCI USB
However there is a bug in the patch, having to do with pointer
arithmetic for the private data structure, which causes some function
pointers to be wiped in some builds, and as a result no USB devices
are ever seen.
Here's a potential fix - compiled but not yet tested (a cruder
workaround was tested last night to verify the mytouch HW)
In drivers/usb/host/ehci-msm7201.h
change to
static inline struct msm7201_usb_priv *hcd_to_msm7201(struct usb_hcd
*hcd)
{
return (struct msm7201_usb_priv *) (((char *)(hcd->hcd_priv)) +
sizeof(struct ehci_hcd));
}
OK, I've disabled those 2 ones.
> then enable EHCI HCD (USB 2.0) support
I definitively can't see that one. Where is it supposed to be ?
> then Support for Qualcomm MSM7201 on-chip EHCI USB
>
Same for that one: it simply doesn't appear in menuconfig.
> However there is a bug in the patch, having to do with pointer
[...]
Thanks for the patch, I'll test it once I have sorted those
configuration issues out !
The kconfig config option for the MSM architecture has changed name in
some kernels (certainly the vanilla g1 source differs from the hero
source)... which kernel base are you compiling against?
I've tried with the stock HTC Hero kernel source code and starting
from their given .config
Maybe I'm not using the right set of patches ? I did apply the v2 patch file.
I think I missed a file in the patch due to taking shortcuts and
general confusion; give me half an hour to do things properly
(i.e.move to git) and I'll resend proper versions.
That make me remember a joke:
"There are only 10 types of people in the world: Those who understand
binary, and those who don't"
Sorry for that, I couldn't resist :)
I can now see and check the required options ! Thanks for this updated patch.
I'll keep you informed if I got usb host working with the resulting kernel.
Cheers
Olivier
Hi Andrew,
patched kernel compiled and tested this morning: usb host works as expected.
Keep up the good work on this subject!
Cheers
Olivier
That's great news, thanks for trying it out!
> Keep up the good work on this subject!
Expect more soon.
Does that mean my android device might be able to connect to linux-
supported usb hardware? My pocket DVB-recoder coming up? ;)
Theoretically yes; I've not yet tried a DVB USB stick, but I've got
two in the cupboard!
Depends on the bandwidth the phone can support. It sounds feasible
though: I've heard of them working on the Linksys NSLU2 "slugs" which
are 266Mhz ARMs...
I've just fixed the msm72k_udc.ko gadget driver so it can be
unloaded/loaded properly. I've tested it by repeatedly
loading/unloading the msm72k_udc.ko gadget and the ehci-hcd.ko host
drivers one after another and it seems fairly stable (I'd bet there
are a number of bugs remaining though :).
Next up, I need to replace the "usb function notifier" and
msm_hsusb_set_vbus_state() stuff and we ought to have fully
functioning device and host drivers that can be rmmoded/insmodded in
order to switch usb "modes". I should have this done sometime this
week, and I'll send an updated patch then. (right now, the gadget
driver can't detect when the USB cable is plugged in because of these
missing calls).
After that, we can investigate "proper" USB OTG support (ala the
Droid) and whether the phone can output power on VBUS.
I also wonder what Google's stance on this is; is there a chance of
getting it into the mainline android-MSM tree? I suppose I should also
try and get it into the vanilla kernel tree to help out people porting
to this platform in future.
The switching modules path may prove productive for our purposes, but I think actual otg drivers dont do this, as theres a state machine that drives mode changing automatically, so they keep both drivers resident and enable/disable them.
The more I look into actual otg however, I'm less intetested than I originally was. I think for user purposes it may actually be better to have manual switching not unlike the enabling of mass storage mode, particularly as a lot of people are likely to be using cobbled together cable & adapter assemblies that wouldnt put a compliant otg device into host mode.
--
unsubscribe: android-kerne...@googlegroups.com
website: http://groups.google.com/grou...
I had absolutely no idea about the existence of that tree, so I'd
implemented the driver myself from scratch!
If you look at the android kernel trees at android.git.kernel.org
there is absolutely no mention about host mode as you say. This has to
be a policy decision by Google.
I searched for *days* for talk about android host mode implementations
before starting this project, but couldn't find anything whatsoever! I
see they've even done the horrible
make-the-function-drivers-unloadable stuff I've just done too!
The tree looks an awful lot cleaner than the "official" sources.... I
reckon I'll be giving it a go later!
Thanks: kinda wish I'd heard this earlier, but that's not your fault! :)
I was afraid Qualcomm gave up implementing a stable hub-capable host mode
driver, but your success makes me hope again :-)
My tries got stuck half a year ago:
http://www.android-hilfe.de/root-hacking-modding-fuer-samsung-galaxy/5891-us
b-host-otg-moeglich-2.html#post67545
I just used this cable:
http://cgi.ebay.com/Micro-USB-Host-Cable-for-Nokia-N810-OTG-on-the-go-N-810_
W0QQitemZ250589706476QQcmdZViewItemQQptZPDA_Accessories?hash=item3a584f78ec
("Micro USB Host Cable for Nokia N810 OTG on the go N 810")
and a powered USB 2.0 hub, perhaps that was the mistake?
Interesting, so it detects the host hardware ok, but fails to actually
talk to any devices? I had exactly that error from two sources:
1) 'cos I had the cable data lines the wrong way round
2) I found you had to set an extra flag in the DMA setup.. see here:
http://groups.google.com/group/android-kernel/browse_thread/thread/361326399cd4e891#
Specifically:
510 /*
511 * generic hardware linkage
512 */
513 .irq = ehci_msm_irq,
514 .flags = HCD_USB2,
They're missing that flag. I found if you changed that to
.flags = HCD_USB2 | HCD_MEMORY | HCD_LOCAL_MEM,
it all started working. The HCD_LOCAL_MEM tells it that the USB
controller can't DMA from just any old memory, and it has to copy to a
local transfer buffer before intiating DMA.
OK, I need to think what to do next.... I imagine there are
HTC-specific hacks in their source trees to support their specific
platforms, so switching to an entirely codeaurora tree might be
tricky.
Perhaps backporting the relevant pieces from the codeaurora tree might
be the way to go forward, but I'll have to have a look at code
quality/applicability etc.
How could this happen? Aren't they colour-coded?
> .flags = HCD_USB2 | HCD_MEMORY | HCD_LOCAL_MEM,
I modified the Samsung Galaxy kernel source this way. Now the error message
hub 1-0:1.0: unable to enumerate USB device on port 1
after modprobe disappeared, the last line is now
msm_hsusb_vbus_shutdown
But nothing else is happening in dmesg when replugging. I'm still not sure about my wiring though.
Ah - I was playing about with the Hero USB PHY's registers which let
you swap the lines about in software :)
>> .flags = HCD_USB2 | HCD_MEMORY | HCD_LOCAL_MEM,
>
> I modified the Samsung Galaxy kernel source this way. Now the error message
> hub 1-0:1.0: unable to enumerate USB device on port 1
> after modprobe disappeared, the last line is now
> msm_hsusb_vbus_shutdown
> But nothing else is happening in dmesg when replugging. I'm still not sure about my wiring though.
Hmm, dunno yet, I'm still in the middle of backporting the ehci-msm.c
driver to my hero tree; should be able to test that out soon though.
The code appears to have full USB OTG as well, which should be kinda
cool; theoretically no need for any module unloading. Also, I now know
the RPC calls to turn the vbus voltage on and off! (untested, may not
be supported on all hardware).
static struct resource resources_hsusb[] = {
--- 252,258 ----
.num_functions = ARRAY_SIZE(usb_functions),
.products = usb_products,
.num_products = ARRAY_SIZE(usb_products),
+ #endif
};
static struct resource resources_hsusb[] = {
-----------------------------------------------------------------------------------------------------------
Do you think that something in the patch needs to be changed for it
to work on CDMA HTC HERO .
Will greatly appreciate any help/suggestion in this case.
I cant wait to see it running on my android!
But I do by now: after looking at Figure 2-2 on page 8 of
http://www.atmel.com/atmel/acrobat/doc1137.pdf
it became clear it couldn't work my way: the hub chip is powered by BUS_POWER of the upstream port. So I bought one of those USB Dual Power Cables and connected it as described on
http://wiki.openmoko.org/wiki/Specialized_USB_cables#Buy_a_USB_Y_cable_for_powering_USB_devices_and_charging_the_Freerunner_while_in_host_mode
and it works - on the Nexus One! It even gets charged! whooohooo :-D
Patch and video available at
http://sven.killig.de/android/N1/2.2/usb_host
And the .config, of course.
Try the kernelnewbies.org site, that's the best place to start
out with.
good luck,
greg k-h