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: Thu, 26 May 2016 14:21:17 +0200 [thread overview]
Message-ID: <5746EA3D.6090307@denx.de> (raw)
In-Reply-To: <1464242367-314-4-git-send-email-sriram.dash@nxp.com>
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.
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.
> 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
next prev parent reply other threads:[~2016-05-26 12:21 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 [this message]
2016-05-27 5:14 ` Sriram Dash
2016-05-27 12:48 ` Marek Vasut
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=5746EA3D.6090307@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