]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
usb: Prevent using reserved registers on DM36x usb
authorAndrew Murray <amurray@embedded-bits.co.uk>
Sun, 29 Sep 2013 17:02:22 +0000 (18:02 +0100)
committerTom Rini <trini@ti.com>
Thu, 10 Oct 2013 11:58:00 +0000 (07:58 -0400)
The musb driver defines and uses MUSB_CSR0_H_DIS_PING, however this
bit is reserved on the DM36x. Thus this patch ensures that the
reserved bit is not accesssed.

It has been observed that some USB devices will fail to enumerate
with errors such as 'error in inquiry' without this patch.

See http://www.ti.com/litv/pdf/sprufh9a for details.

Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>
Acked-by: Marek Vasut <marex@denx.de>
drivers/usb/musb/musb_hcd.c

index 41a8126b3e2ef2b3ff8954a21d32c91c9f60c966..708fa124a21489f4b9ed46a24fc2dce0ffc4970e 100644 (file)
@@ -417,8 +417,12 @@ static int ctrlreq_out_data_phase(struct usb_device *dev, u32 len, void *buffer)
 
                /* Set TXPKTRDY bit */
                csr = readw(&musbr->txcsr);
-               writew(csr | MUSB_CSR0_H_DIS_PING | MUSB_CSR0_TXPKTRDY,
-                                       &musbr->txcsr);
+                       
+               csr |= MUSB_CSR0_TXPKTRDY;
+#if !defined(CONFIG_SOC_DM365)
+               csr |= MUSB_CSR0_H_DIS_PING;
+#endif
+               writew(csr, &musbr->txcsr);
                result = wait_until_ep0_ready(dev, MUSB_CSR0_TXPKTRDY);
                if (result < 0)
                        break;
@@ -439,8 +443,10 @@ static int ctrlreq_out_status_phase(struct usb_device *dev)
 
        /* Set the StatusPkt bit */
        csr = readw(&musbr->txcsr);
-       csr |= (MUSB_CSR0_H_DIS_PING | MUSB_CSR0_TXPKTRDY |
-                       MUSB_CSR0_H_STATUSPKT);
+       csr |= (MUSB_CSR0_TXPKTRDY | MUSB_CSR0_H_STATUSPKT);
+#if !defined(CONFIG_SOC_DM365)
+       csr |= MUSB_CSR0_H_DIS_PING;
+#endif
        writew(csr, &musbr->txcsr);
 
        /* Wait until TXPKTRDY bit is cleared */
@@ -457,7 +463,10 @@ static int ctrlreq_in_status_phase(struct usb_device *dev)
        int result;
 
        /* Set the StatusPkt bit and ReqPkt bit */
-       csr = MUSB_CSR0_H_DIS_PING | MUSB_CSR0_H_REQPKT | MUSB_CSR0_H_STATUSPKT;
+       csr = MUSB_CSR0_H_REQPKT | MUSB_CSR0_H_STATUSPKT;
+#if !defined(CONFIG_SOC_DM365)
+       csr |= MUSB_CSR0_H_DIS_PING;
+#endif
        writew(csr, &musbr->txcsr);
        result = wait_until_ep0_ready(dev, MUSB_CSR0_H_REQPKT);