
-----Original Message----- From: Marek Vasut [mailto:marex@denx.de] Sent: Thursday, May 26, 2016 5:51 PM To: Sriram Dash sriram.dash@nxp.com; u-boot@lists.denx.de Cc: york sun york.sun@nxp.com; albert.u.boot@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.
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