From 1b2e48eeaffa5c581240fd6fdbfbe288ea513f06 Mon Sep 17 00:00:00 2001 From: Ajay Agarwal Date: Wed, 20 May 2020 21:22:05 +0530 Subject: [PATCH] usb: dwc3: Disable parkmode for Gen1 controllers Disable parkmode for Gen1 controllers to fix the data stall issue in host mode. Change-Id: I28694a533543b14f752e195b722aafcb83cc4f1d Signed-off-by: Ajay Agarwal Signed-off-by: Manu Gautam --- drivers/usb/dwc3/core.c | 11 +++++++++++ drivers/usb/dwc3/core.h | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 877a76bedcf7..5ed3fd54a05e 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1033,6 +1033,17 @@ int dwc3_core_init(struct dwc3 *dwc) if (dwc->parkmode_disable_ss_quirk) reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS; + /* + * STAR: 9001415732: Host failure when Park mode is enabled: + * Disable parkmode for Gen1 controllers to fix the stall + * seen during host mode transfers on multiple endpoints. + */ + if (!dwc3_is_usb31(dwc)) { + reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS; + reg |= DWC3_GUCTL1_PARKMODE_DISABLE_HS; + reg |= DWC3_GUCTL1_PARKMODE_DISABLE_FSLS; + } + dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); } diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index c7a1a936b769..e160d3319ea2 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -274,6 +274,11 @@ #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28) #define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) #define DWC3_GUCTL1_IP_GAP_ADD_ON(n) (n << 21) + +#define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) +#define DWC3_GUCTL1_PARKMODE_DISABLE_HS BIT(16) +#define DWC3_GUCTL1_PARKMODE_DISABLE_FSLS BIT(15) + #define DWC3_GUCTL1_L1_SUSP_THRLD_EN_FOR_HOST BIT(8) /* Global Status Register */