[HD2 General] liiochen:
Very very thank you, Rick.

Now, I called physical reset from msm7201 probe. code is here:

// from google.

/* Hardware-specific reset & setup function, based on usb_reset() from msm72k_udc.c */
static void msm72k_usb_reset(struct platform_device *pdev, struct usb_hcd *hcd)
{
unsigned otgsc;
struct msm_hsusb_platform_data *pdata = pdev->dev.platform_data;

if (pdata == NULL)
{
printk (KERN_ERR "CIAN: Crippling error - pdata is NULL! Aborting.\n");
return;
}

/* CIAN - Added by Qualcomm, otgsc register *
* is used by transceiver to read the ID pin status, so has to *
* be restored to the previous value the transceiver was aware *
* of after a link reset. */
otgsc = readl(USB_OTGSC);
printk(KERN_ERR "MSM72xx-EHCI: USB_OTGSC reads 0x%08X\n", otgsc);

/* RESET */
writel(2, USB_USBCMD);
msleep(10);
if (pdata->phy_reset) {
pdata->phy_reset();
}

/* INCR4 BURST mode */
#ifdef CONFIG_ARCH_MSM7X00A
/* INCR4 BURST mode */
writel(0x01, USB_SBUSCFG);
#else
/* bursts of unspecified length. */
writel(0, USB_AHBBURST);
/* Use the AHB transactor */
writel(0, USB_AHBMODE);
#endif

//writel(0x01, USB_SBUSCFG);

/* select HOST mode */
writel(0x10|USBMODE_HOST, USB_USBMODE); /* TODO CIAN - No idea what the 0x10 is for... */
msleep(1);

/* select ULPI phy */
writel(0x80000000, USB_PORTSC);

ulpi_init(pdev, hcd);

/* enable interrupts */
writel(otgsc, USB_OTGSC);
writel(STS_URI | STS_SLI | STS_UI | STS_PCI, USB_USBINTR); /* TODO CIAN - Is ID interrupt here? */

/* go to RUN mode (D+ pullup enable) */
msm72k_pullup(hcd, 1);
}

code from: www . cianer . com/code/

About "58: 100000 msm ehci_hcd:usb1" :

I think it's invalid. the value of the called counter is too big!!!

But I don't understand if this IRQ is bad, why do receive some debugging information like this:

<7>[ 343.597259] usb usb1: bus suspend
<7>[ 343.597290] msm_hsusb_host msm_hsusb_host.0: suspend root hub
<7>[ 343.597290] msm_hsusb_host msm_hsusb_host.0: port 2, 00000000 -> 00500000
<7>[ 343.597320] msm_hsusb_host msm_hsusb_host.0: port 1, 00000000 -> 00500000
<7>[ 343.642456] usb usb1: usb resume
<7>[ 343.642486] msm_hsusb_host msm_hsusb_host.0: resume root hub after power loss
<7>[ 343.678161] msm_hsusb_host msm_hsusb_host.0: GetStatus port 1 status 000000 sig=se0
<7>[ 343.678222] hub 1-0:1.0: usb port status = 0, ret: 0, change: 0
<7>[ 343.678283] msm_hsusb_host msm_hsusb_host.0: GetStatus port 2 status 000000 sig=se0
<7>[ 343.678344] hub 1-0:1.0: usb port status = 0, ret: 0, change: 0

<7>[ 334.616943] hub 1-0:1.0: urb -> hub irq called
<7>[ 334.616973] msm_hsusb_host msm_hsusb_host.0: suspend root hub
<7>[ 334.662597] msm_hsusb_host msm_hsusb_host.0: resume root hub after power loss
<7>[ 334.698120] hub 1-0:1.0: hub_resume
<7>[ 334.698150] hub 1-0:1.0: hub init 1.
<7>[ 334.698303] hub 1-0:1.0: usb port status = 0, ret: 0, change: 0
<7>[ 334.698425] hub 1-0:1.0: usb port status = 0, ret: 0, change: 0
<7>[ 334.698455] hub 1-0:1.0: submit the urb.
<7>[ 334.702362] hub 1-0:1.0: state 7 ports 2 chg 0000 evt 0000
<7>[ 334.702484] hub 1-0:1.0: pre for loop i=1, i<=2.
<7>[ 334.702545] hub 1-0:1.0: hub no event and not connect_change.
<7>[ 334.702636] hub 1-0:1.0: hub no event and not connect_change.
<7>[ 334.702728] hub 1-0:1.0: hub port nothing todo.

This information make me feel the problem is usb port status can't be read .

So far, I can not identify any devices on LEO.

msm72k_pullup & msm72k_ehci_probe is here:

static int msm72k_ehci_probe(struct platform_device *pdev)
{
struct usb_hcd *hcd;
const struct hc_driver *driver = &msm72k_ehci_hc_driver;
struct resource *res;
int irq;
int retval;

if (usb_disabled())
return -ENODEV;

printk(KERN_ERR "Entered msm72k_ehci_probe (TODO CIAN - remove this printk)\n");

/* Check IRQ setup */
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {
dev_err(&pdev->dev,
"Found HC with no IRQ. Check %s setup!\n",
dev_name(&pdev->dev));
return -ENODEV;
}
irq = res->start;

hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
if (!hcd) {
retval = -ENOMEM;
goto fail_create_hcd;
}

/* Check for memory, then request & remap it */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev,
"Found HC with no register addr. Check %s setup!\n",
dev_name(&pdev->dev));
retval = -ENODEV;
goto fail_request_resource;
}
hcd->rsrc_start = res->start;
hcd->rsrc_len = res->end - res->start + 1;

if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
driver->description)) {
dev_dbg(&pdev->dev, "controller already in use\n");
retval = -EBUSY;
goto fail_request_resource;
}

hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); /* TODO CIAN - why nocache? PS3 uses normal remap, probably something to do with PSMs in the ixp4xx */
if (hcd->regs == NULL) {
dev_dbg(&pdev->dev, "error mapping memory\n");
retval = -EFAULT;
goto fail_ioremap;
}

/* TODO CIAN - there doesn't appear to be any clock messing in this driver....? */

printk(KERN_ERR "msm72k_ehci_probe resetting hardware (TODO CIAN - remove this printk)\n");
msm72k_usb_reset(pdev, hcd); /* TODO CIAN: I think this is the proper place for this */

retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (retval)
goto err6;

return retval;

fail_add_hcd:
iounmap(hcd->regs);
fail_ioremap:
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
fail_request_resource:
usb_put_hcd(hcd);
fail_create_hcd:
dev_err(&pdev->dev, "init %s fail, %d\n", dev_name(&pdev->dev), retval);
return retval;
}

/* CIAN - msm72k_pullup copied from msm72k_udc.c then tweaked (removed *
* patch added by Qualcomm which checks if gadget is registered) */
static int msm72k_pullup(struct usb_hcd *hcd, int is_active)
{
if (is_active) {
writel(0x00080001, USB_USBCMD);
} else
writel(0x00080000, USB_USBCMD);

return 0;
}