]> git.sur5r.net Git - u-boot/blobdiff - drivers/usb/host/ehci-hcd.c
Merge git://git.denx.de/u-boot-arc
[u-boot] / drivers / usb / host / ehci-hcd.c
index 8f259bee4f0b67c2816d654163798e39085af100..13aa70d606614a61eb0db6fd04a4651786958671 100644 (file)
@@ -210,6 +210,9 @@ static int ehci_shutdown(struct ehci_ctrl *ctrl)
                return -EINVAL;
 
        cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
+       /* If not run, directly return */
+       if (!(cmd & CMD_RUN))
+               return 0;
        cmd &= ~(CMD_PSE | CMD_ASE);
        ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
        ret = handshake(&ctrl->hcor->or_usbsts, STS_ASS | STS_PSS, 0,
@@ -237,7 +240,7 @@ static int ehci_shutdown(struct ehci_ctrl *ctrl)
 static int ehci_td_buffer(struct qTD *td, void *buf, size_t sz)
 {
        uint32_t delta, next;
-       uint32_t addr = (unsigned long)buf;
+       unsigned long addr = (unsigned long)buf;
        int idx;
 
        if (addr != ALIGN(addr, ARCH_DMA_MINALIGN))
@@ -1615,6 +1618,12 @@ int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
        if (ret)
                goto err;
 
+       if (ctrl->ops.init_after_reset) {
+               ret = ctrl->ops.init_after_reset(ctrl);
+               if (ret)
+                       goto err;
+       }
+
        ret = ehci_common_init(ctrl, tweaks);
        if (ret)
                goto err;