UPSTREAM: usb: dwc2: host: Set host_rx_fifo_size to 525 for rk3066
authorDouglas Anderson <dianders@chromium.org>
Fri, 29 Jan 2016 02:19:54 +0000 (18:19 -0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 3 Jan 2017 10:48:07 +0000 (18:48 +0800)
commit3f0d1d69e083419767fc736bba480d72e2464b08
treef95871cd913735188337d2dc5841d5e736bf498a
parent567049afec78c0c1b74e8ab220ea29a887943f56
UPSTREAM: usb: dwc2: host: Set host_rx_fifo_size to 525 for rk3066

As documented in dwc2_calculate_dynamic_fifo(), host_rx_fifo_size should
really be:
 2 * ((Largest Packet size / 4) + 1 + 1) + n
 with n = number of host channel.

We have 9 host channels, so
 2 * ((1024/4) + 2) + 9 = 516 + 9 = 525

We've got 960 / 972 total_fifo_size on rk3288 (and presumably on
rk3066) and 525 + 128 + 256 = 909 so we're still under on both ports
even when we increment by 5.

In the future, it would be nice if dwc2_calculate_dynamic_fifo() could
handle the "too small" FIFO case and come up with something more
dynamically.  When we do that we can figure out how to allocate the
extra 48 / 60 bytes of FIFO that we're currently wasting.

NOTE: no known bugs are fixed by this patch, but it seems like a simple
fix and ought to fix someone.

Change-Id: Ia56c4cce7a01f570cce035a5e45c11ca431a797d
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
(cherry picked from commit 098c1ef8fe6bcdfed7905cea1debdd3a0ff9a16f)
drivers/usb/dwc2/platform.c