Altera_Forum
Honored Contributor
14 years agoUSB on altera DE2 board
I'm working on usb communication on the Altera DE2 kit, have to follow the instructions on the wiki NIOS, the source linux I used is 20090808
sytem_0. ptf file from vga mouse host projects in DE2_system DE2 CD first make,download and boot then detect the hub 1-0: 2 ports detected the second,with the above zImage, download and boot it can't detect usb hub 1-0: 1 port detected i don't understand why this error I followed the instructions on the forum is how to skip clock = check immediately return 1 after variable declaration in the function file hc_reset of isp1362-hcd.c but still not detect the usb Who solved this problem can you help me?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 = 100;
unsigned long flags;
int clkrdy = 0;
ret=1;
pr_info("%s:\n", __func__);
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) {
if (clkrdy) {
//end of edit
pr_err("Clock not ready after %lums\n", timeout);
ret = -ENODEV;
}
return ret;
}