龙桃子被起诉:isp116x-hcd

来源:百度文库 编辑:偶看新闻 时间:2024/04/30 00:14:09


isp116x-hcd is a USB host controller driver for Philips‘isp1160 and isp1161 chips. The driver has the followingproperties.

  • Has been tested with a range of devices including mice, keyboards, flash drives, USB-to-net dongles etc.
  • Supports suspend/resume, including remote wakeup (e.g. resuming by moving an attached mouse).
  • Has been tested on both little and big endian platforms.
  • Works in PIO-only mode (no DMA).
  • Does NOT support isochronous transfers. If you are a board designer looking for a USB host controller and you will need isochronous transfers, i.e. audio over USB, then you‘d rather opt for a fully OHCI (or EHCI) compliant controller.

The driver is a part of the 2.6.13 and later mainline kernels.The driveris availablealso for a few older kernels.

Known bugs

Kernel 2.6.13 - There is a one, related to power switchingof ports. Apply the followingpatchto fix it. Also, this patch converts the driver to a newplatform code interface, reducing the amount of the platformsupport code needed for the driver. If you‘ll use the unpatcheddriver from 2.6.13 then see aseparate pageabout setting up its platform support code.

Todo

Implement entering deep sleep.

Getting the driver working

For kernel, the isp116x host controller is usually definedas a platrorm device on a so called platform bus. Andyou need to provide platform support code for it. Hereare recommendations and an example for the platformsupport code.

The file include/linux/usb_isp116x.h containsa declaration of thestruct isp116x_platform_data, which you mustdefine and initialize to reflect specifics of your platform.The struct members are explained in that header file. Herefollow some additional recommendations for some of themembers of this srtucture. As a rule, set a struct memberiff you know you need to set it.

int_act_high, int_edge_triggered
Whenever yourplatform supports level-triggered interrupts, use these.Success with configuring level-triggered interrupts hasbeen reported even on platforms, which don‘tsupport level-triggered interrupts, but for which the166 ns edge-triggered interrupt pulse is too short tobe detected (like PXA255 SoC).
delay
Read CAREFULLY the comments inboth include/linux/usb_isp116x.h anddrivers/usb/host/isp116x-hcd.c as wrong choiceof the delay type or an incorrect implementationof the platform-specific delay function is the major sourceof problems when trying to get the driver working.

Here is an example platform code I use on my LH7A400(a SoC with an ARM core) based boards; in my case it goesinto arch/arm/mach-lh7a40x/arch-lpd7a40x.c file.

#include /* Platform delay */static void isp116x_pfm_delay(struct device *dev, int delay){/* On this platform, we work with 200MHz clock, giving5 ns per instruction. The cycle below involves 2instructions and we lose 2 more instruction times dueto pipeline flush at jump. I.e., we consume 20 nsper cycle.*/int cyc = delay / 20;__asm__ volatile ("0:\n""     subs  %0, %1, #1\n""     bge   0b\n":"=r" (cyc):"0"(cyc));}/* Define chip configuration */static struct isp116x_platform_data isp116x_pfm_data = {.sel15Kres = 1,.remote_wakeup_enable = 1,.delay = isp116x_pfm_delay,};/* Define chip address and IRQ line */static struct resource isp116x_pfm_resources[] = {[0] = {/// data (A0 = 0).start = USB_IO_PHYS,.end = USB_IO_PHYS + 1,.flags = IORESOURCE_MEM,},[1] = {/// addr (A0 = 1).start = USB_IO_PHYS + 2,.end = USB_IO_PHYS + 3,.flags = IORESOURCE_MEM,},[2] = {.start = IRQ_USB,.end = IRQ_USB,.flags = IORESOURCE_IRQ,},};static struct platform_device isp116x_pfm_usbhost_device = {.name = "isp116x-hcd",.num_resources = ARRAY_SIZE(isp116x_pfm_resources),.resource = isp116x_pfm_resources,.dev.platform_data = &isp116x_pfm_data,};static struct platform_device *lpd7a40x_devs[] __initdata = {...&isp116x_pfm_usbhost_device,};

Hardware considerations

For now, the H_WAKEUP pin of the isp116x chip must bepulled low. Otherwise the chip won‘t report clock tobe ready after a software reset, resulting in failed probing.However, if you are interested in putting the chip into adeep sleep in the future then connect this pin to a GPIO,because the H_WAKEUP pin must be manipulated toenter that mode. Currently the driver does notsupport entering the deep sleep. I will implement it, whenI get a proper platform.

Still help needed

First, there has been a number of postings onconfiguring isp116x in bothlinux-usb-develandlinux-arm-kernelmailing lists starting from 2005. So please browse thearchives.

Second, of course, you can contact me at the e-mail addressbelow (after preprocessing it :) But if you contact methen please CC also to one of the abovementioned mailinglists. This is not just to make my life easier, butyours too.