]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: Add support for txfifo threshold
authorSimon Glass <sjg@chromium.org>
Mon, 27 Feb 2012 10:52:47 +0000 (10:52 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 29 Mar 2012 06:12:48 +0000 (08:12 +0200)
CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning
field in the EHCI controller on reset.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Tom Warren <twarren@nvidia.com>
README
drivers/usb/host/ehci-hcd.c
drivers/usb/host/ehci.h

diff --git a/README b/README
index 5452813449d2250a562de01341296e8f3f3d3d4b..d4799e222f55cb5c7035e077a5f97b0426148282 100644 (file)
--- a/README
+++ b/README
@@ -1125,6 +1125,9 @@ The following options need to be configured:
                                May be defined to allow interrupt polling
                                instead of using asynchronous interrupts
 
+               CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the
+               txfilltuning field in the EHCI controller on reset.
+
 - USB Device:
                Define the below if you wish to use the USB console.
                Once firmware is rebuilt from a serial console issue the
index ef5afc22b04c5f25f322d6897c9aad8e60c4e80d..b6422d7d7aafd0f7b187342ae01212275d97a1e8 100644 (file)
@@ -255,6 +255,13 @@ static int ehci_reset(void)
 #endif
                ehci_writel(reg_ptr, tmp);
        }
+
+#ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
+       cmd = ehci_readl(&hcor->or_txfilltuning);
+       cmd &= ~TXFIFO_THRESH(0x3f);
+       cmd |= TXFIFO_THRESH(CONFIG_USB_EHCI_TXFIFO_THRESH);
+       ehci_writel(&hcor->or_txfilltuning, cmd);
+#endif
 out:
        return ret;
 }
index 3d0ad0c85212f1caf05c7192953cd02df2619e8c..cc00ce428b8ad34ac3f760fafc3810a765cac98d 100644 (file)
@@ -80,7 +80,11 @@ struct ehci_hcor {
        uint32_t or_ctrldssegment;
        uint32_t or_periodiclistbase;
        uint32_t or_asynclistaddr;
-       uint32_t _reserved_[9];
+       uint32_t _reserved_0_;
+       uint32_t or_burstsize;
+       uint32_t or_txfilltuning;
+#define TXFIFO_THRESH(p)               ((p & 0x3f) << 16)
+       uint32_t _reserved_1_[6];
        uint32_t or_configflag;
 #define FLAG_CF                (1 << 0)        /* true:  we'll support "high speed" */
        uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS];