Hi All,

Our team is developing a USB OTG Controller driver for Linux 2.6.16.11
kernel on a board which runs on ARM Core .  The driver is for ARC USB
OTG Controller.

There are three modules involved viz
                             Host Controller Driver
                             Device Controller Driver
                             OTG Controller Driver
These three modules are sharing the same device space.

We are trying to integrate the three modules.
The modules are initialized and ISRs (shared interrupt handlers) are
registered.
Initially, interrupts are received and ISRs are invoked.  But when one
of the modules try to reset the controller, the interrupts no longer
come eventhough the interrupts are enabled in the hardware registers.
We also found out that the interrupt vector controller registers the
USB interrupt.

We tried running a stand-alone code which does similar operations.
But, we are getting the interrupts even after repeated resets.  So
that makes it clear that the problem is not with the hardware.

In Linux, the three modules use the same remapped controller address
space and IRQ resources.  Since the controller can work as a host
controller, device controller or OTG controller, we have introduced
three platform device structures and three resource
structures in the "arch/arm/<machine-specific>/  directory.

All the three resource structures have the same iomem start and IRQ
start values.

/* USB OTG */
static struct resource ab300_usb_otg_resources [] = {
        [0] = {
                .start  = USB_PHYS,
                .end    = (USB_PHYS + SZ_4K - 1),
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
                .start  = IRQ_USB,
                .end    = IRQ_USB,
                .flags  = IORESOURCE_IRQ,
        },
};

static struct platform_device ab300_usb_otg_device = {
 .name          = "ab300_otg_usb",
 .id            = 0,
 .dev           = {
   .dma_mask = (u64 *)~0,
   .coherent_dma_mask = (u64)~0,
 },
 .num_resources = ARRAY_SIZE (ab300_usb_otg_resources),
 .resource      = ab300_usb_otg_resources,
};

/* USB UDC */
static struct resource ab300_usb_udc_resources [] = {
        [0] = {
                .start  = USB_PHYS,
                .end    = (USB_PHYS + SZ_4K - 1),
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
                .start  = IRQ_USB,
                .end    = IRQ_USB,
                .flags  = IORESOURCE_IRQ,
        },
};


static struct platform_device ab300_usb_udc_device = {
 .name          = "ab300_udc_usb",
 .id            = 1,
 .dev           = {
   .dma_mask = (u64 *)~0,
   .coherent_dma_mask = (u64)~0,
 },
 .num_resources = ARRAY_SIZE (ab300_usb_udc_resources),
 .resource      = ab300_usb_udc_resources,
};

/* USB EHCI */
static struct resource ab300_usb_host_resources [] = {
        [0] = {
                .start  = USB_PHYS,
                .end    = (USB_PHYS + SZ_4K - 1),
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
                .start  = IRQ_USB,
                .end    = IRQ_USB,
                .flags  = IORESOURCE_IRQ,
        },
};

static struct platform_device ab300_usb_host_device = {
 .name          = "ab300_ehci_usb",
 .id            = 0,
 .dev           = {
   .dma_mask = (u64 *)~0,
   .coherent_dma_mask = (u64)~0,
 },
 .num_resources = ARRAY_SIZE (ab300_usb_host_resources),
 .resource      = ab300_usb_host_resources,
};


static struct platform_device *ab300_platform_devs[] __initdata = {
#if defined (CONFIG_MACH_AB300)
 &ab300_usb_otg_device,
 &ab300_usb_udc_device,
 &ab300_usb_host_device,
};

The above code snippet was added so that our driver modules can
request resources in their respective module initialization.

Can the problem be of kernel porting?

Does any one who has developed an OTG Driver for ARC USB OTG
Controllers, face this problem. If not please tell us , how did u guys
load the three drivers in to the kernel.
The drivers are built in to the kerenel. There is no module loading facility



Could anyone throw some light on the root cause of the problem?

Thanks,
Rak


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to