From: Marek Vasut Date: Fri, 26 Aug 2016 11:06:03 +0200 Subject: [U-Boot] [PATCH v2] drivers: usb: xhci-fsl: Implement Erratum A-010151 for FSL USB3 controller In-Reply-To: References: <1472035175-24052-1-git-send-email-sriram.dash@nxp.com> <1f3b70e8-f0ee-0090-507f-38e39ec74c06@denx.de> Message-ID: <68145e02-d7a5-feec-e891-449e959f6c8b@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 08/25/2016 08:47 AM, Sriram Dash wrote: >> From: Marek Vasut [mailto:marex at denx.de] >> On 08/24/2016 12:39 PM, Sriram Dash wrote: >>> Currently the controller by default enables the Receive Detect feature >>> in P3 mode in USB 3.0 PHY. However, USB 3.0 PHY does not reliably >>> support receive detection in P3 mode. >>> Enabling the USB3 controller to configure USB in P2 mode whenever the >>> Receive Detect feature is required. >>> >>> Signed-off-by: Sriram Dash >>> Signed-off-by: Rajesh Bhagat >>> --- >>> Changes in v2: >>> - Do Soc ver checking for applying erratum >>> >>> drivers/usb/common/fsl-errata.c | 26 ++++++++++++++++++++++++++ >>> drivers/usb/host/xhci-dwc3.c | 5 +++++ >>> drivers/usb/host/xhci-fsl.c | 8 ++++++++ >>> include/fsl_usb.h | 1 + >>> include/linux/usb/dwc3.h | 2 ++ >>> 5 files changed, 42 insertions(+) >>> >>> diff --git a/drivers/usb/common/fsl-errata.c >>> b/drivers/usb/common/fsl-errata.c index 183bf2b..f2bffba 100644 >>> --- a/drivers/usb/common/fsl-errata.c >>> +++ b/drivers/usb/common/fsl-errata.c >>> @@ -190,4 +190,30 @@ bool has_erratum_a008751(void) >>> return false; >>> } >>> >>> +bool has_erratum_a010151(void) >>> +{ >>> + u32 svr = get_svr(); >>> + u32 soc = SVR_SOC_VER(svr); >>> + >>> + switch (soc) { >>> +#ifdef CONFIG_ARM64 >>> + case SVR_LS2080A: >>> + case SVR_LS2085A: >>> + case SVR_LS1046A: >>> + case SVR_LS1012A: >>> + return IS_SVR_REV(svr, 1, 0); >>> + case SVR_LS1043A: >>> + return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1); #endif >>> +#ifdef CONFIG_LS102XA >>> + case SOC_VER_LS1020: >>> + case SOC_VER_LS1021: >>> + case SOC_VER_LS1022: >>> + case SOC_VER_SLS1020: >>> + return IS_SVR_REV(svr, 2, 0); >>> +#endif >>> + } >> >> Is the ifdef really needed ? >> > > Yes. The SVR (SVR_LS2080A, SOC_VER_LS1020) are defined in different ARCH > specific files. So, we have used the ifdefs. Or you can just include all of the headers and then you don't need the ifdef, no ? -- Best regards, Marek Vasut