diff options
author | Yunzhi Li <lyz@rock-chips.com> | 2015-12-17 14:14:26 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-12-22 12:51:45 -0500 |
commit | cebfdbf329ae929ccb71632888a7c2100c3d1eeb (patch) | |
tree | d1b535eb8b5c28a1c83bd822221d24066a0ed49d /drivers/usb/dwc2 | |
parent | 991824677fe0a555394d8093b64647dbd08b89b0 (diff) |
usb: dwc2: reset dwc2 core before dwc2_get_hwparams()
We initiate dwc2 usb controller in BIOS, dwc2_core_reset() should
be called before dwc2_get_hwparams() to reset core registers to
default value. Without this the FIFO setting might be incorrect
because calculating FIFO size need power-on value of
GRXFSIZ/GNPTXFSIZ/HPTXFSIZ registers.
This patch could avoid warnning massage like in rk3288 platform:
[ 2.074764] dwc2 ff580000.usb: 256 invalid for
host_perio_tx_fifo_size. Check HW configuration.
Signed-off-by: Yunzhi Li <lyz@rock-chips.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r-- | drivers/usb/dwc2/core.c | 2 | ||||
-rw-r--r-- | drivers/usb/dwc2/core.h | 1 | ||||
-rw-r--r-- | drivers/usb/dwc2/platform.c | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index 0bc1c0ed12eb..0a584ecb233f 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c | |||
@@ -481,7 +481,7 @@ static void dwc2_init_fs_ls_pclk_sel(struct dwc2_hsotg *hsotg) | |||
481 | * Do core a soft reset of the core. Be careful with this because it | 481 | * Do core a soft reset of the core. Be careful with this because it |
482 | * resets all the internal state machines of the core. | 482 | * resets all the internal state machines of the core. |
483 | */ | 483 | */ |
484 | static int dwc2_core_reset(struct dwc2_hsotg *hsotg) | 484 | int dwc2_core_reset(struct dwc2_hsotg *hsotg) |
485 | { | 485 | { |
486 | u32 greset; | 486 | u32 greset; |
487 | int count = 0; | 487 | int count = 0; |
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 05f01785de05..d1d855af63e6 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h | |||
@@ -880,6 +880,7 @@ enum dwc2_halt_status { | |||
880 | * The following functions support initialization of the core driver component | 880 | * The following functions support initialization of the core driver component |
881 | * and the DWC_otg controller | 881 | * and the DWC_otg controller |
882 | */ | 882 | */ |
883 | extern int dwc2_core_reset(struct dwc2_hsotg *hsotg); | ||
883 | extern void dwc2_core_host_init(struct dwc2_hsotg *hsotg); | 884 | extern void dwc2_core_host_init(struct dwc2_hsotg *hsotg); |
884 | extern int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg); | 885 | extern int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg); |
885 | extern int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore); | 886 | extern int dwc2_exit_hibernation(struct dwc2_hsotg *hsotg, bool restore); |
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index 5df2adf6f4e7..a72302d740dd 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -456,6 +456,12 @@ static int dwc2_driver_probe(struct platform_device *dev) | |||
456 | if (retval) | 456 | if (retval) |
457 | return retval; | 457 | return retval; |
458 | 458 | ||
459 | /* | ||
460 | * Reset before dwc2_get_hwparams() then it could get power-on real | ||
461 | * reset value form registers. | ||
462 | */ | ||
463 | dwc2_core_reset(hsotg); | ||
464 | |||
459 | /* Detect config values from hardware */ | 465 | /* Detect config values from hardware */ |
460 | retval = dwc2_get_hwparams(hsotg); | 466 | retval = dwc2_get_hwparams(hsotg); |
461 | if (retval) | 467 | if (retval) |