Oxford OXU210HP

From EnneEnneWiki

Oxford OXU210HP
Enlarge
Oxford OXU210HP


Contents


This driver implements the support for Linux 2.6.26-rc3 (and hopeful for later versions) of Oxford OXU210HP USB high-speed host, peripheral and OTG controller.

This manual will show how to compile the driver and how to define a proper platform device in order to use the driver.

Note: the driver is an alpha release even if quite functional, please refere to the following TODO section for further info. I published this driver hoping that someone maybe interested in enhancing it joining the enforces.

References

The chip's main references are at Oxford's site.

The stable driver's source code is available on my GIT server.

Note: this driver supports only the two USB high-speed hosts, so no peripheral nor OTG!

Downloading the code and compiling

The best, but most time consuming, way to get the code is to clone the LinuxPPS git repository. You will need to do this if you want to use any of the git commands documented elsewhere in this wiki. WARNING: this will download about 120MB of data.

$ git clone git://git.enneenne.com/oxu210hp-hcd oxu210hp-dev

When this command completes, you will have a Linux kernel source tree in the oxu210hp-dev directory, with the driver patches already integrated.

Whenever new patches are added to my repository, you can update your repository by giving the following commands:

$ cd oxu210hp-dev
$ git pull

If you already have a git clone of the Linux kernel, you may want to follow these instructions to merge my changes into your tree.

You can browse the revision control history in your web browser by visiting the OXU210HP-HCD gitweb.

You can also find some patches against specific Linux versions on the OXU210HP-HCD HTTP/FTP site but take note that some of them implement old driver versions!

Loading the driver

In order to define the OXU210 into your system you must add the following code into your platform specific code:

static struct resource wr1100_oxu210hp_resources[] = {
        {
                .start  = PXA_CS4_PHYS,
                .end    = PXA_CS4_PHYS + (64 << 20) - 1,
                .flags  = IORESOURCE_MEM,
        },
        {
                .start  = IRQ_GPIO(WR1100_USB2_IRQ),
                .flags  = IORESOURCE_IRQ,
        }
};

/* Currently not used */
static struct oxu210hp_platform_data wr1100_oxu210hp_platform_data = {
        .bus16          = 1,
        .use_hcd_otg    = 1,
        .use_hcd_sph    = 1,
};

static struct platform_device wr1100_oxu210hp = {
        .name           = "oxu210hp-hcd",
        .id             = -1,
        .num_resources  = 2,
        .resource       = wr1100_oxu210hp_resources,
        .dev            = {
                .dma_mask               = 0UL,
                .coherent_dma_mask      = 0xffffffff,
                .platform_data          = &wr1100_oxu210hp_platform_data,
        },
};

The resource defines the base address and the IRQ line specific for your board while platform_data is used to define some special driver settings:

  • bus16 = enable 16bit bus support.
  • use_hcd_otg = enable OTG controller as host controller.
  • use_hcd_sph = enable SPH controller.

Once the driver is loaded, or during the boot time, if the chip is correctly probed, you should see something like that:

oxu210hp-hcd oxu210hp-hcd: USB 2.0 started, quasi-EHCI 1.00, driver 0.0.50

Driver status and TODO

As stated before the driver is in a very alpha release, so please consider using it without any warranty!

I hope that you may help me in enhancing the driver. :) Please send to your questions and/or patches to the Linux-USB mail list putting me in Cc.

The driver is currently used by me on ARM/PXA270 base system and it supports:

  • Control, bulk and interrupt transactions.
  • 16 bit only busses (currently you cannot use 32bit busses).
  • Both USB controller as host devices (currently you cannot use only one controller).

While the unsupported features are:

  • Enable usage of struct oxu210hp_platform_data entries.
  • Isochronous transaction.
  • Power management (suspend/resume).

I tested the driver with the usbstorage and usbserial drivers.

The right-thing(TM): using HCD_LOCAL_MEM flag

Regarding memory allocation, current implementation is not optimal since the we should use the Linux USB core's HCD_LOCAL_MEM flag (see file linux/drivers/usb/core/hcd.c).

By using such flag in a proper manner the driver will better fit into kernel code and we can gain the isochronous transactions!

About this topic, please, refere to this thread for further info.


Personal tools