Re: [U-Boot] [PATCH v3 11/16] usb: Add support for txfifo threshold

2011-12-10 Thread Remy Bohmer
Hi,

2011/12/7 Simon Glass s...@chromium.org:
 CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning
 field in the EHCI controller on reset.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

  README                      |    3 +++
  drivers/usb/host/ehci-hcd.c |    7 +++
  drivers/usb/host/ehci.h     |    6 +-
  3 files changed, 15 insertions(+), 1 deletions(-)


Since it is part of a bigger series:
Acked-by: Remy Bohmer li...@bohmer.net

Kind regards,

Remy
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 11/16] usb: Add support for txfifo threshold

2011-12-06 Thread Simon Glass
CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning
field in the EHCI controller on reset.

Signed-off-by: Simon Glass s...@chromium.org
---

 README  |3 +++
 drivers/usb/host/ehci-hcd.c |7 +++
 drivers/usb/host/ehci.h |6 +-
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/README b/README
index fda0190..4dbb70c 100644
--- a/README
+++ b/README
@@ -1096,6 +1096,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
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 2197119..16deebc 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -247,6 +247,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;
 }
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 3d0ad0c..cc00ce4 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -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];
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot