[U-Boot] [PATCH v2] drivers: usb: xhci-fsl: Implement Erratum A-010151 for FSL USB3 controller

Marek Vasut marex at denx.de
Fri Aug 26 12:51:24 CEST 2016


On 08/26/2016 12:31 PM, Sriram Dash wrote:
>> From: Marek Vasut [mailto:marex at 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 <sriram.dash at nxp.com>
>>>>> Signed-off-by: Rajesh Bhagat <rajesh.bhagat at 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?

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list