On Tue, 2005-06-28 at 00:27 -0500, Bill Gatliff wrote:
> I'm still not getting the chip to recognize a device when I connect one, 
> even though I have corrected a number of things that I think were wrong 
> in my platform code.  Any suggestions would be appreciated.

I can't tell you what the problem is but I can show you what works on my
PXA255 platform. I'm not sure the delay stuff is still needed or what,
but it works.

/* From Headers */
#define VIPER_USB_IRQ           IRQ_GPIO(2)
#define VIPER_USB_PHYS          PXA_CS3_PHYS

/* USB */
static void isp116x_delay(struct device *dev, int delay)
{
        /* On this platform, we work with 200MHz clock, giving
           5 ns per instruction. The cycle below involves 2
           instructions and we lose 2 more instruction times due
           to pipeline flush at a jump. I.e., we consume 20 ns
           per cycle.
        */
        int cyc = delay/20 + 1;
        cyc <<= 2; /* actually, 400MHz */

        __asm__ volatile ("0:\n"
                          "     subs  %0, %1, #1\n"
                          "     bge   0b\n"
                          : "=r" (cyc)
                          : "0"  (cyc)
                );
}

static struct resource isp116x_resources[] = {
        [0] = { /* DATA */
                .start  = VIPER_USB_PHYS + 0,
                .end    = VIPER_USB_PHYS + 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = { /* ADDR */
                .start  = VIPER_USB_PHYS + 2,
                .end    = VIPER_USB_PHYS + 3,
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
                .start  = VIPER_USB_IRQ,
                .end    = VIPER_USB_IRQ,
                .flags  = IORESOURCE_IRQ,
        },
};

// (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel )
static struct isp116x_platform_data isp116x_platform_data = {
        // Enable internal resistors on downstream ports
        .sel15Kres              = 1,
        // Clock cannot be stopped
        .clknotstop             = 0,
        // On-chip overcurrent protection
        .oc_enable              = 1,
        // INT output polarity
        .int_act_high           = 1,
        // INT edge or level triggered
        .int_edge_triggered     = 0,
        // End-of-transfer input polarity
        .eot_act_high           = 0,
        // DREQ output polarity
        .dreq_act_high          = 1,
        // WAKEUP pin connected
        .remote_wakeup_connected= 0,
        // Wakeup by devices on usb bus enabled
        .remote_wakeup_enable   = 0,
        // Switch or not to switch (keep always powered)
        .no_power_switching     = 1,
        // Ganged port power switching (0) or individual port power switching 
(1)
        .power_switching_mode   = 0,

        .reset                  = NULL,
        .delay                  = isp116x_delay,
};

static struct platform_device isp116x_device = {
        .name                   = "isp116x-hcd",
        .id                     = -1,
        .num_resources          = ARRAY_SIZE(isp116x_resources),
        .resource               = isp116x_resources,
        .dev                    = {
                .platform_data  = &isp116x_platform_data,
        },

};


-- 
Ian Campbell
Current Noise: The Hidden Hand - Desensitized

"I will make no bargains with terrorist hardware."
-- Peter da Silva



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
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