diff mbox series

[U-Boot,RESEND,v2] armv8: Add workaround for USB erratumA-050106

Message ID 20190513031831.29900-1-ran.wang_1@nxp.com
State Changes Requested
Delegated to: Prabhakar Kushwaha
Headers show
Series [U-Boot,RESEND,v2] armv8: Add workaround for USB erratumA-050106 | expand

Commit Message

Ran Wang May 13, 2019, 3:18 a.m. UTC
USB3.0 Receiver needs to enable fixed equalization
for each of PHY instances in an SOC. This is similar
to erratum A-009007, but this one is for LX2160A,
and the register value is different.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
---
Change in v2:
	- Move function erratum_a050106() under the scope of
	  CONFIG_FSL_LSCH3 to avoid compilation warning of
	  'defined but not used'.

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig              |  4 ++++
 arch/arm/cpu/armv8/fsl-layerscape/soc.c                | 13 ++++++++++++-
 arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h |  5 +++++
 3 files changed, 21 insertions(+), 1 deletion(-)

Comments

Prabhakar Kushwaha May 21, 2019, 2:48 p.m. UTC | #1
Dear Ran

> -----Original Message-----
> From: Ran Wang <ran.wang_1@nxp.com>
> Sent: Monday, May 13, 2019 8:49 AM
> To: Albert Aribaud <albert.u.boot@aribaud.net>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>
> Cc: York Sun <york.sun@nxp.com>; u-boot@lists.denx.de; Ran Wang
> <ran.wang_1@nxp.com>
> Subject: [RESEND][PATCH v2] armv8: Add workaround for USB erratum A-
> 050106
> 
> USB3.0 Receiver needs to enable fixed equalization for each of PHY instances in
> an SOC. This is similar to erratum A-009007, but this one is for LX2160A, and the
> register value is different.
> 
> Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> ---

This patch is for adding workaround for errata A-050106. 
But you are modifying erratum_a008997(). 

Please avid hidden changes in a patch. 
I will suggest to generate 2 patches one for A-050106 and other for a008997

-pk
Ran Wang May 23, 2019, 3:46 a.m. UTC | #2
Hi Prabhakar,

On Tuesday, May 21, 2019 22:48, Prabhakar Kushwaha wrote:
> 
> Dear Ran
> 
<snip>
> >
> > USB3.0 Receiver needs to enable fixed equalization for each of PHY
> > instances in an SOC. This is similar to erratum A-009007, but this one
> > is for LX2160A, and the register value is different.
> >
> > Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> > ---
> 
> This patch is for adding workaround for errata A-050106.
> But you are modifying erratum_a008997().
> 
> Please avid hidden changes in a patch.
> I will suggest to generate 2 patches one for A-050106 and other for a008997

Actually the information ' @@ -139,7 +139,8 @@  static void erratum_a008997(void) ' 
automatically generated by git is not quite right, the change I made is within macro
PROGRAM_USB_PHY_RX_OVRD_IN_HI rather than function erratum_a008997(void) .
You can look into the src file arch/arm/cpu/armv8/fsl-layerscape/soc.c for details :)

Regards,
Ran
Prabhakar Kushwaha May 23, 2019, 3:49 a.m. UTC | #3
Dear Ran,

> -----Original Message-----
> From: Ran Wang
> Sent: Thursday, May 23, 2019 9:16 AM
> To: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> Cc: York Sun <york.sun@nxp.com>; u-boot@lists.denx.de; Albert Aribaud
> <albert.u.boot@aribaud.net>
> Subject: RE: [RESEND][PATCH v2] armv8: Add workaround for USB erratum A-
> 050106
> 
> Hi Prabhakar,
> 
> On Tuesday, May 21, 2019 22:48, Prabhakar Kushwaha wrote:
> >
> > Dear Ran
> >
> <snip>
> > >
> > > USB3.0 Receiver needs to enable fixed equalization for each of PHY
> > > instances in an SOC. This is similar to erratum A-009007, but this
> > > one is for LX2160A, and the register value is different.
> > >
> > > Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> > > ---
> >
> > This patch is for adding workaround for errata A-050106.
> > But you are modifying erratum_a008997().
> >
> > Please avid hidden changes in a patch.
> > I will suggest to generate 2 patches one for A-050106 and other for
> > a008997
> 
> Actually the information ' @@ -139,7 +139,8 @@  static void
> erratum_a008997(void) '
> automatically generated by git is not quite right, the change I made is within
> macro PROGRAM_USB_PHY_RX_OVRD_IN_HI rather than function
> erratum_a008997(void) .
> You can look into the src file arch/arm/cpu/armv8/fsl-layerscape/soc.c for
> details :)
> 


@@ -139,7 +139,8 @@ static void erratum_a008997(void)
 	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_3);	\
 	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_4)
 
-#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
+#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A) || \
+	defined(CONFIG_ARCH_LX2160A)

As per my understanding this change is being done in  erratum_a008997
Let me know, if am not seeing it correctly.

--pk
Prabhakar Kushwaha May 23, 2019, 4:28 a.m. UTC | #4
> -----Original Message-----
> From: Prabhakar Kushwaha
> Sent: Thursday, May 23, 2019 9:20 AM
> To: Ran Wang <ran.wang_1@nxp.com>
> Cc: York Sun <york.sun@nxp.com>; u-boot@lists.denx.de; Albert Aribaud
> <albert.u.boot@aribaud.net>
> Subject: RE: [RESEND][PATCH v2] armv8: Add workaround for USB erratum A-
> 050106
> 
> Dear Ran,
> 
> > -----Original Message-----
> > From: Ran Wang
> > Sent: Thursday, May 23, 2019 9:16 AM
> > To: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> > Cc: York Sun <york.sun@nxp.com>; u-boot@lists.denx.de; Albert Aribaud
> > <albert.u.boot@aribaud.net>
> > Subject: RE: [RESEND][PATCH v2] armv8: Add workaround for USB erratum
> > A-
> > 050106
> >
> > Hi Prabhakar,
> >
> > On Tuesday, May 21, 2019 22:48, Prabhakar Kushwaha wrote:
> > >
> > > Dear Ran
> > >
> > <snip>
> > > >
> > > > USB3.0 Receiver needs to enable fixed equalization for each of PHY
> > > > instances in an SOC. This is similar to erratum A-009007, but this
> > > > one is for LX2160A, and the register value is different.
> > > >
> > > > Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> > > > ---
> > >
> > > This patch is for adding workaround for errata A-050106.
> > > But you are modifying erratum_a008997().
> > >
> > > Please avid hidden changes in a patch.
> > > I will suggest to generate 2 patches one for A-050106 and other for
> > > a008997
> >
> > Actually the information ' @@ -139,7 +139,8 @@  static void
> > erratum_a008997(void) '
> > automatically generated by git is not quite right, the change I made
> > is within macro PROGRAM_USB_PHY_RX_OVRD_IN_HI rather than function
> > erratum_a008997(void) .
> > You can look into the src file arch/arm/cpu/armv8/fsl-layerscape/soc.c
> > for details :)
> >
> 
> 
> @@ -139,7 +139,8 @@ static void erratum_a008997(void)
>  	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI,
> USB_PHY_RX_EQ_VAL_3);	\
>  	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI,
> USB_PHY_RX_EQ_VAL_4)
> 
> -#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
> +#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A) || \
> +	defined(CONFIG_ARCH_LX2160A)
> 
> As per my understanding this change is being done in  erratum_a008997 Let me
> know, if am not seeing it correctly.
> 

Thanks for showing me.

You are right.. this change is in between static void erratum_a008997 and your new function 😊


--pk
Ran Wang May 23, 2019, 4:31 a.m. UTC | #5
Hi Prabhakar,

On Thursday, May 23, 2019 12:28, Prabhakar Kushwaha wrote:
> 
> 
> > -----Original Message-----
> > From: Prabhakar Kushwaha
> > Sent: Thursday, May 23, 2019 9:20 AM
> > To: Ran Wang <ran.wang_1@nxp.com>
> > Cc: York Sun <york.sun@nxp.com>; u-boot@lists.denx.de; Albert Aribaud
> > <albert.u.boot@aribaud.net>
> > Subject: RE: [RESEND][PATCH v2] armv8: Add workaround for USB erratum
> > A-
> > 050106
> >
> > Dear Ran,
> >
> > > -----Original Message-----
> > > From: Ran Wang
> > > Sent: Thursday, May 23, 2019 9:16 AM
> > > To: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
> > > Cc: York Sun <york.sun@nxp.com>; u-boot@lists.denx.de; Albert
> > > Aribaud <albert.u.boot@aribaud.net>
> > > Subject: RE: [RESEND][PATCH v2] armv8: Add workaround for USB
> > > erratum
> > > A-
> > > 050106
> > >
> > > Hi Prabhakar,
> > >
> > > On Tuesday, May 21, 2019 22:48, Prabhakar Kushwaha wrote:
> > > >
> > > > Dear Ran
> > > >
> > > <snip>
> > > > >
> > > > > USB3.0 Receiver needs to enable fixed equalization for each of
> > > > > PHY instances in an SOC. This is similar to erratum A-009007,
> > > > > but this one is for LX2160A, and the register value is different.
> > > > >
> > > > > Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
> > > > > ---
> > > >
> > > > This patch is for adding workaround for errata A-050106.
> > > > But you are modifying erratum_a008997().
> > > >
> > > > Please avid hidden changes in a patch.
> > > > I will suggest to generate 2 patches one for A-050106 and other
> > > > for
> > > > a008997
> > >
> > > Actually the information ' @@ -139,7 +139,8 @@  static void
> > > erratum_a008997(void) '
> > > automatically generated by git is not quite right, the change I made
> > > is within macro PROGRAM_USB_PHY_RX_OVRD_IN_HI rather than function
> > > erratum_a008997(void) .
> > > You can look into the src file
> > > arch/arm/cpu/armv8/fsl-layerscape/soc.c
> > > for details :)
> > >
> >
> >
> > @@ -139,7 +139,8 @@ static void erratum_a008997(void)
> >  	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI,
> > USB_PHY_RX_EQ_VAL_3);	\
> >  	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI,
> > USB_PHY_RX_EQ_VAL_4)
> >
> > -#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
> > +#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
> || \
> > +	defined(CONFIG_ARCH_LX2160A)
> >
> > As per my understanding this change is being done in  erratum_a008997
> > Let me know, if am not seeing it correctly.
> >
> 
> Thanks for showing me.
> 
> You are right.. this change is in between static void erratum_a008997 and your
> new function 😊

Yes, looks like Git has defect on this. Thanks.
Regards,
Ran
diff mbox series

Patch

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index f48481f..f99b9d1 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -191,6 +191,7 @@  config ARCH_LX2160A
 	select SYS_FSL_DDR_VER_50
 	select SYS_FSL_EC1
 	select SYS_FSL_EC2
+	select SYS_FSL_ERRATUM_A050106
 	select SYS_FSL_HAS_RGMII
 	select SYS_FSL_HAS_SEC
 	select SYS_FSL_HAS_CCN508
@@ -335,6 +336,9 @@  config SYS_FSL_ERRATUM_A009008
 config SYS_FSL_ERRATUM_A009798
 	bool "Workaround for USB PHY erratum A009798"
 
+config SYS_FSL_ERRATUM_A050106
+	bool "Workaround for USB PHY erratum A050106"
+
 config SYS_FSL_ERRATUM_A010315
 	bool "Workaround for PCIe erratum A010315"
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 06f3edb..ab5c408 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -139,7 +139,8 @@  static void erratum_a008997(void)
 	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_3);	\
 	out_be16((phy) + SCFG_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_4)
 
-#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
+#elif defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A) || \
+	defined(CONFIG_ARCH_LX2160A)
 
 #define PROGRAM_USB_PHY_RX_OVRD_IN_HI(phy)	\
 	out_le16((phy) + DCSR_USB_PHY_RX_OVRD_IN_HI, USB_PHY_RX_EQ_VAL_1); \
@@ -172,6 +173,15 @@  static void erratum_a009007(void)
 }
 
 #if defined(CONFIG_FSL_LSCH3)
+static void erratum_a050106(void)
+{
+#if defined(CONFIG_ARCH_LX2160A)
+	void __iomem *dcsr = (void __iomem *)DCSR_BASE;
+
+	PROGRAM_USB_PHY_RX_OVRD_IN_HI(dcsr + DCSR_USB_PHY1);
+	PROGRAM_USB_PHY_RX_OVRD_IN_HI(dcsr + DCSR_USB_PHY2);
+#endif
+}
 /*
  * This erratum requires setting a value to eddrtqcr1 to
  * optimal the DDR performance.
@@ -323,6 +333,7 @@  void fsl_lsch3_early_init_f(void)
 	erratum_a009798();
 	erratum_a008997();
 	erratum_a009007();
+	erratum_a050106();
 #ifdef CONFIG_CHAIN_OF_TRUST
 	/* In case of Secure Boot, the IBR configures the SMMU
 	* to allow only Secure transactions.
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
index 9fab88a..5727656 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h
@@ -209,8 +209,13 @@ 
 #define DCSR_USB_PHY_RX_OVRD_IN_HI	0x200C
 #define USB_PHY_RX_EQ_VAL_1		0x0000
 #define USB_PHY_RX_EQ_VAL_2		0x0080
+#if defined(CONFIG_ARCH_LS2080A) || defined(CONFIG_ARCH_LS1088A)
 #define USB_PHY_RX_EQ_VAL_3		0x0380
 #define USB_PHY_RX_EQ_VAL_4		0x0b80
+#elif defined(CONFIG_ARCH_LX2160A)
+#define USB_PHY_RX_EQ_VAL_3		0x0080
+#define USB_PHY_RX_EQ_VAL_4		0x0880
+#endif
 
 #define TP_ITYP_AV		0x00000001	/* Initiator available */
 #define TP_ITYP_TYPE(x)	(((x) & 0x6) >> 1)	/* Initiator Type */