Forum Discussion
Altera_Forum
Honored Contributor
20 years agoUSB device!
I have a usb flash disk, I want to using it on my board, I choose USB Mass storage and SCSI disk and ISA116X driver support in menuconfig. Start uClinux on NIOS II SDK shell, using dmesg, I got these...
Altera_Forum
Honored Contributor
20 years agohi 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