--- Quote Start ---
originally posted by jay_1025@Apr 25 2006, 08:48 PM
hi hippo
so far, i don't solve this problem for usb isp1362.
i find two problematic places in isp1362-hcd.c form booting messages to konw , it is "isp1362_hc_reset" and "isp1362_probe". such as following:
booting messages for usb isp1362
.
driver isp1362-hcd, 2005-04-04
isp1362-hcd isp1362-hcd: isp1362 host controller
isp1362_hc_reset:
clock not ready after 20ms
isp1362-hcd isp1362-hcd: can't reset
init error, -19
.
.
static int isp1362_hc_reset(struct usb_hcd *hcd)
{
int ret = 0;
struct isp1362_hcd *isp1362_hcd = hcd_to_isp1362_hcd(hcd);
unsigned long t;
unsigned long timeout = 20;
unsigned long flags;
int clkrdy = 0;
info("%s:\n", __function__);
// dump_regs(s, isp1362_hcd);
if (isp1362_hcd->board && isp1362_hcd->board->reset) {
isp1362_hcd->board->reset(hcd->self.controller, 1);
msleep(20);
if (isp1362_hcd->board->clock) {
isp1362_hcd->board->clock(hcd->self.controller, 1);
}
isp1362_hcd->board->reset(hcd->self.controller, 0);
} else {
isp1362_sw_reset(isp1362_hcd);
}
// chip has been reset. first we need to see a clock
t = jiffies + msecs_to_jiffies(timeout);
while (!clkrdy && time_before_eq(jiffies, t)) {
spin_lock_irqsave(&isp1362_hcd->lock, flags);
clkrdy = isp1362_read_reg16(isp1362_hcd, hcupint) & hcupint_clkrdy;
spin_unlock_irqrestore(&isp1362_hcd->lock, flags);
if (!clkrdy) {
msleep(4);
}
}
spin_lock_irqsave(&isp1362_hcd->lock, flags);
isp1362_write_reg16(isp1362_hcd, hcupint, hcupint_clkrdy);
spin_unlock_irqrestore(&isp1362_hcd->lock, flags);
if (!clkrdy) {
err("clock not ready after %lums\n", timeout);
ret = -enodev;
}
return ret;
}
////////////////////////////////////////////////////////////////////////////////////////////
static int __init isp1362_probe(struct platform_device *pdev)
{
struct usb_hcd *hcd;
struct isp1362_hcd *isp1362_hcd;
struct resource *addr, *data;
void __iomem *addr_reg;
void __iomem *data_reg;
int irq;
int retval = 0;
/* basic sanity checks first. board-specific init logic should
* have initialized this the three resources and probably board
* specific platform_data. we don't probe for irqs, and do only
* minimal sanity checking.
*/
if (pdev->num_resources < 3) {
retval = -enodev;
goto err1;
}
data = platform_get_resource(pdev, ioresource_mem, 0);
addr = platform_get_resource(pdev, ioresource_mem, 1);
irq = platform_get_irq(pdev, 0);
if (!addr || !data || irq < 0) {
retval = -enodev;
goto err1;
}
# ifdef config_usb_hcd_dma
if (pdev->dev.dma_mask) {
struct resource *dma_res = platform_get_resource(pdev, ioresource_mem, 2);
if (!dma_res) {
retval = -enodev;
goto err1;
}
isp1362_hcd->data_dma = dma_res->start;
isp1362_hcd->max_dma_size = resource_len(dma_res);
}# else
if (pdev->dev.dma_mask) {
dbg(1, "won't do dma");
retval = -enodev;
goto err1;
}# endif
if (!request_mem_region(addr->start, resource_len(addr), hcd_name)) {
retval = -ebusy;
goto err1;
}
.
.
.
err1:
printk("init error, %d\n", retval);
return retval;
.
.
i am not good in usb driver. http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/sad.gif
can you tell more detail how to debug it ?
thx in advance !
jay
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=14647)
--- quote end ---
--- Quote End ---
Please check isp1362 registers access first.
<div class='quotetop'>QUOTE </div>
--- Quote Start ---
<div class='quotetop'>QUOTE
--- Quote End ---
--- Quote Start ---
Then in function isp1362_hc_reset() of ~/linux-2.6.x/drivers/usb/host/isp1362_hcd.c
add some printk() to display the io ports of data, addr and irq.
add a dump_regs() to display the regs.
try some write / read compare to the regs.
add some dump_regs during the clock test.
We have to make sure the chip can be accessed by the driver correctly.
Check the clock, data... etc with a scope.
Check irq pin during the clokc test.[/b]
--- Quote End ---
[/b]
--- Quote End ---