
On 08/26/2016 12:57 PM, Sriram Dash wrote:
From: Marek Vasut [mailto:marex@denx.de] On 08/26/2016 12:31 PM, Sriram Dash wrote:
From: Marek Vasut [mailto:marex@denx.de] On 08/25/2016 08:47 AM, Sriram Dash wrote:
From: Marek Vasut [mailto:marex@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 sriram.dash@nxp.com > Signed-off-by: Rajesh Bhagat rajesh.bhagat@nxp.com > --- > 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 ?
The headers for the respective ARCHs are included in fsl_errata.h file. But, there are some macros/structs/variables which are common across the ARCHs, for example: DCFG_DCSR_PORCR1, RCW_SB_EN_REG_INDEX, sys_info, etc. So, they are also kept inside the ifdefs.
I don't understand your argument. What happens if you remove the ifdefs?
The fsl_errata.h file includes the headers asm/processor.h(for PPC), asm/arch-ls102xa/immap_ls102xa.h( for LS1), asm/arch/soc.h(for Layerscape). As some macros/structs are common across the ARCH, if we remove the ifdefs, we may
may or will ?
experience compilation error on redefinition of the macros and structs.
And these are not easy to fix ?
So, the ifdefs are necessary.
-- Best regards, Marek Vasut