From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] fsl: usb: make errata function common for PPC and ARM
Date: Fri, 27 May 2016 14:48:51 +0200 [thread overview]
Message-ID: <57484233.1030406@denx.de> (raw)
In-Reply-To: <DB5PR0401MB2024645444A44A1F75C583CBF5420@DB5PR0401MB2024.eurprd04.prod.outlook.com>
On 05/27/2016 07:14 AM, Sriram Dash wrote:
>> -----Original Message-----
>> From: Marek Vasut [mailto:marex at denx.de]
>> Sent: Thursday, May 26, 2016 5:51 PM
>> To: Sriram Dash <sriram.dash@nxp.com>; u-boot at lists.denx.de
>> Cc: york sun <york.sun@nxp.com>; albert.u.boot at aribaud.net; Rajesh Bhagat
>> <rajesh.bhagat@nxp.com>
>> Subject: Re: [PATCH 3/5] fsl: usb: make errata function common for PPC and ARM
>>
>> On 05/26/2016 07:59 AM, Sriram Dash wrote:
>>
>> Since there is no commit message, I have no clue what the rationale for this patch
>> is, sorry. Please explain.
>>
>
> This patch adds support for ARM for the errata applicability checking code.
> Will take care in v2.
>
>> Besides, I would much rather see a patch which moves all these static inline
>> functions into a dedicated C file and converts this header into just a list of
>> prototypes. I wouldn't be surprised if the U-Boot size dropped a bit too.
>>
>
> Will move the function definitions to a new file in v2.
> Shall I place the file in drivers/usb/common/fsl_usb.c or drivers/usb/host/fsl_usb.c
> and keep fsl_usb.h at same place.
Most likely the former, since it's a common stuff used by some
platforms. The fsl_usb.h needs to stay. Make sure to use buildman
to test for breakage on powerpc.
> Please suggest.
>
>>> Signed-off-by: Sriram Dash <sriram.dash@nxp.com>
>>> Signed-off-by: Rajesh Bhagat <rajesh.bhagat@nxp.com>
>>> ---
>>> drivers/usb/common/fsl-dt-fixup.c | 1 +
>>> include/fsl_usb.h | 51 ++++++++++++---------------------------
>>> 2 files changed, 17 insertions(+), 35 deletions(-)
>>>
>>> diff --git a/drivers/usb/common/fsl-dt-fixup.c
>>> b/drivers/usb/common/fsl-dt-fixup.c
>>> index 520130e..47e1049 100644
>>> --- a/drivers/usb/common/fsl-dt-fixup.c
>>> +++ b/drivers/usb/common/fsl-dt-fixup.c
>>> @@ -12,6 +12,7 @@
>>> #include <usb.h>
>>> #include <asm/io.h>
>>> #include <hwconfig.h>
>>> +#include <fsl_errata.h>
>>> #include <fsl_usb.h>
>>> #include <fdt_support.h>
>>>
>>> diff --git a/include/fsl_usb.h b/include/fsl_usb.h index
>>> 187e384..d9db0ea 100644
>>> --- a/include/fsl_usb.h
>>> +++ b/include/fsl_usb.h
>>> @@ -86,13 +86,14 @@ struct ccsr_usb_phy { #endif
>>>
>>> /* USB Erratum Checking code */
>>> -#ifdef CONFIG_PPC
>>> +#if defined(CONFIG_PPC) || defined(CONFIG_ARM)
>>> static inline bool has_dual_phy(void) {
>>> u32 svr = get_svr();
>>> u32 soc = SVR_SOC_VER(svr);
>>>
>>> switch (soc) {
>>> +#ifdef CONFIG_PPC
>>> case SVR_T1023:
>>> case SVR_T1024:
>>> case SVR_T1013:
>>> @@ -109,6 +110,7 @@ static inline bool has_dual_phy(void)
>>> case SVR_T4160:
>>> case SVR_T4080:
>>> return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
>>> +#endif
>>> }
>>>
>>> return false;
>>> @@ -120,6 +122,7 @@ static inline bool has_erratum_a006261(void)
>>> u32 soc = SVR_SOC_VER(svr);
>>>
>>> switch (soc) {
>>> +#ifdef CONFIG_PPC
>>> case SVR_P1010:
>>> return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
>>> case SVR_P2041:
>>> @@ -145,6 +148,7 @@ static inline bool has_erratum_a006261(void)
>>> return IS_SVR_REV(svr, 1, 0);
>>> case SVR_P5040:
>>> return IS_SVR_REV(svr, 1, 0);
>>> +#endif
>>> }
>>>
>>> return false;
>>> @@ -156,6 +160,7 @@ static inline bool has_erratum_a007075(void)
>>> u32 soc = SVR_SOC_VER(svr);
>>>
>>> switch (soc) {
>>> +#ifdef CONFIG_PPC
>>> case SVR_B4860:
>>> case SVR_B4420:
>>> return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0); @@ -163,14
>>> +168,18 @@ static inline bool has_erratum_a007075(void)
>>> return IS_SVR_REV(svr, 1, 0);
>>> case SVR_P4080:
>>> return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
>>> +#endif
>>> }
>>> return false;
>>> }
>>>
>>> static inline bool has_erratum_a007798(void) {
>>> +#ifdef CONFIG_PPC
>>> return SVR_SOC_VER(get_svr()) == SVR_T4240 &&
>>> IS_SVR_REV(get_svr(), 2, 0);
>>> +#endif
>>> + return false;
>>> }
>>>
>>> static inline bool has_erratum_a007792(void) @@ -179,6 +188,7 @@
>>> static inline bool has_erratum_a007792(void)
>>> u32 soc = SVR_SOC_VER(svr);
>>>
>>> switch (soc) {
>>> +#ifdef CONFIG_PPC
>>> case SVR_T4240:
>>> case SVR_T4160:
>>> case SVR_T4080:
>>> @@ -193,6 +203,7 @@ static inline bool has_erratum_a007792(void)
>>> case SVR_T2080:
>>> case SVR_T2081:
>>> return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
>>> +#endif
>>> }
>>> return false;
>>> }
>>> @@ -203,9 +214,11 @@ static inline bool has_erratum_a005697(void)
>>> u32 soc = SVR_SOC_VER(svr);
>>>
>>> switch (soc) {
>>> +#ifdef CONFIG_PPC
>>> case SVR_9131:
>>> case SVR_9132:
>>> return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
>>> +#endif
>>> }
>>> return false;
>>> }
>>> @@ -216,6 +229,7 @@ static inline bool has_erratum_a004477(void)
>>> u32 soc = SVR_SOC_VER(svr);
>>>
>>> switch (soc) {
>>> +#ifdef CONFIG_PPC
>>> case SVR_P1010:
>>> return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
>>> case SVR_P1022:
>>> @@ -230,44 +244,11 @@ static inline bool has_erratum_a004477(void)
>>> return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
>>> case SVR_P4080:
>>> return IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 3, 0);
>>> +#endif
>>> }
>>>
>>> return false;
>>> }
>>> -#else
>>> -static inline bool has_dual_phy(void) -{
>>> - return false;
>>> -}
>>> -
>>> -static inline bool has_erratum_a006261(void) -{
>>> - return false;
>>> -}
>>> -
>>> -static inline bool has_erratum_a007075(void) -{
>>> - return false;
>>> -}
>>>
>>> -static inline bool has_erratum_a007798(void) -{
>>> - return false;
>>> -}
>>> -
>>> -static inline bool has_erratum_a007792(void) -{
>>> - return false;
>>> -}
>>> -
>>> -static inline bool has_erratum_a005697(void) -{
>>> - return false;
>>> -}
>>> -
>>> -static inline bool has_erratum_a004477(void) -{
>>> - return false;
>>> -}
>>> #endif
>>> #endif /*_ASM_FSL_USB_H_ */
>>>
>>
>>
>> --
>> Best regards,
>> Marek Vasut
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2016-05-27 12:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 5:59 [U-Boot] [PATCH 0/5] Supporting ARM v8 USB errata for FSL Sriram Dash
2016-05-26 5:59 ` [U-Boot] [PATCH 1/5] arm64: fsl-layerscape: add get_svr and IS_SVR_REV helper Sriram Dash
2016-05-26 5:59 ` [U-Boot] [PATCH 2/5] usb: xhci: fsl: code cleanup for device tree fixup for fsl usb controllers Sriram Dash
2016-05-26 12:19 ` Marek Vasut
2016-05-27 5:14 ` Sriram Dash
2016-05-27 12:47 ` Marek Vasut
2016-05-26 5:59 ` [U-Boot] [PATCH 3/5] fsl: usb: make errata function common for PPC and ARM Sriram Dash
2016-05-26 12:21 ` Marek Vasut
2016-05-27 5:14 ` Sriram Dash
2016-05-27 12:48 ` Marek Vasut [this message]
2016-05-26 5:59 ` [U-Boot] [PATCH 4/5] armv8/ls2080: Remove workaround for erratum A008751 Sriram Dash
2016-05-26 5:59 ` [U-Boot] [PATCH 5/5] usb: xhci: fsl: Add workaround for USB erratum A-008751 Sriram Dash
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57484233.1030406@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox