fsl/usb: Increase TXFIFOTHRESH value for usb write in T4 Rev 2.0
Subsystems (2)
PATCH 1/1 fsl/usb: Increase TXFIFOTHRESH value for usb write in T4 Rev 2.0
Increase TXFIFOTHRES field value in TXFILLTUNING register of usb for T4 Rev 2.0. This decreases data burst rate with which data packets are posted from the TX latency FIFO to compensate for latencies in DDR pipeline during DMA. This avoids Tx buffer underruns and leads to successful usb writes
--- drivers/usb/host/ehci-fsl.c | 20 ++++++++++++++++++++ include/usb/ehci-fsl.h | 7 +++++++ 2 files changed, 27 insertions(+)
drivers/usb/host/ehci-fsl.c +20 -0
@@ -17,6 +17,8 @@#include "ehci.h" +static void set_txfifothresh (struct usb_ehci *,u32 ); +/* Check USB PHY clock valid */ static int usb_phy_clk_valid (struct usb_ehci *ehci) {
@@ -109,6 +111,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,in_le32 (&ehci->usbmode); +if (SVR_SOC_VER (get_svr ()) ==SVR_T4240 && +IS_SVR_REV (get_svr (),2 ,0 )) +set_txfifothresh (ehci,TXFIFOTHRESH ); +return 0 ; }
@@ -120,3 +126,17 @@ int ehci_hcd_stop(int index) {return 0 ; } + +/* +* Setting the value of TXFIFO_THRESH field in TXFILLTUNING register +* to counter DDR latencies in writing data into Tx buffer. +* This prevents Tx buffer from getting underrun +*/ +static void set_txfifothresh (struct usb_ehci *ehci,u32 txfifo_thresh) +{ +u32 cmd; + cmd =ehci_readl (&ehci->txfilltuning); + cmd &= ~TXFIFO_THRESH_MASK ; + cmd |=TXFIFO_THRESH (txfifo_thresh); +ehci_writel (&ehci->txfilltuning, cmd); +}
include/usb/ehci-fsl.h +7 -0
@@ -164,6 +164,13 @@#endif /* +* Increasing TX FIFO threshold value from 2 to 4 decreases +* data burst rate with which data packets are posted from the TX +* latency FIFO to compensate for latencies in DDR pipeline during DMA +*/ +#define TXFIFOTHRESH 4 + +/* * USB Registers */ struct usb_ehci {
Signature · 1 line
1.7.11.7
PATCH 1/1 fsl/usb: Increase TXFIFOTHRESH value for usb write in T4 Rev 2.0
Quoted 8 lines · Nikhil Badola
Increase TXFIFOTHRES field value in TXFILLTUNING register of usb for T4 Rev 2.0. This decreases data burst rate with which data packets are posted from the TX latency FIFO to compensate for latencies in DDR pipeline during DMA. This avoids Tx buffer underruns and leads to successful usb writes
Signed-off-by Ramneek Mehresh <[email protected]>Signed-off-by Nikhil Badola <[email protected]>---
Applied to u-boot-mpc85xx/master, thanks.
York