Skip to contentSkip to conversation

powerpc/mpc85xx: modify erratum A007186

PATCH Superseded Zhao Qiang 3 participants 8 messages Sep 26, 2014 – Sep 28, 2014 PowerPC

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Zhao Qiang

author
#0 lore raw

PATCH 1/2 powerpc/mpc85xx: modify erratum A007186

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007186 errata_workaround.

---
 arch/powerpc/cpu/mpc85xx/cmd_errata.c          |   3 +-
 arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 210 ++++++++++++++-----------
 arch/powerpc/include/asm/fsl_errata.h          |  14 ++
 3 files changed, 130 insertions(+), 97 deletions(-)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +2 -1
index 3a04a89..741eb63 100644
@@ -270,7 +270,8 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	puts("Work-around for Erratum USB14 enabled\n");
 #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007186
-	puts("Work-around for Erratum A007186 enabled\n");
+	if (!not_has_erratum_a007186())
+		puts("Work-around for Erratum A007186 enabled\n");
 #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A006593
 	puts("Work-around for Erratum A006593 enabled\n");
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +114 -96

228 lines not on this page · raw message

arch/powerpc/include/asm/fsl_errata.h +14 -0
index 64da4bb..a977544 100644
@@ -82,3 +82,17 @@ static inline bool has_erratum_a007075(void)
 	return false;
 }
 #endif
+
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007186
+static inline bool not_has_erratum_a007186(void)
+{
+	u32 svr = get_svr();
+	u32 soc = SVR_SOC_VER(svr);
+
+	if (((soc == SVR_T2080) && (SVR_MAJ(svr) > 1)) ||
+	    ((soc == SVR_T2080) && (SVR_MAJ(svr) == 1) && (SVR_MIN(svr) > 0)))
+		return true;
+
+	return false;
+}
+#endif
Signature · 1 line
2.1.0.27.g96db324
author
#1 lore raw

PATCH 2/2 powerpc/mpc85xx: modify erratum A007212

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007212 errata_workaround.

---
 arch/powerpc/cpu/mpc85xx/cmd_errata.c |  2 +-
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |  2 ++
 arch/powerpc/cpu/mpc85xx/speed.c      |  3 ++-
 arch/powerpc/include/asm/fsl_errata.h | 14 ++++++++++++++
 4 files changed, 19 insertions(+), 2 deletions(-)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +1 -1
index 741eb63..a50bb08 100644
@@ -121,7 +121,7 @@ static void check_erratum_a007212(void)
 {
 	u32 __iomem *plldgdcr = (void *)(CONFIG_SYS_DCSRBAR + 0x21c20);
 
-	if (in_be32(plldgdcr) & 0x1fe) {
+	if (!not_has_erratum_a007212() && in_be32(plldgdcr) & 0x1fe) {
 		/* check if PLL ratio is set by workaround */
 		puts("Work-around for Erratum A007212 enabled\n");
 	}
arch/powerpc/cpu/mpc85xx/cpu_init.c +2 -0
index 78316a6..6219619 100644
@@ -345,6 +345,8 @@ void fsl_erratum_a007212_workaround(void)
 	u32 __iomem *plldadcr3 = (void *)(CONFIG_SYS_DCSRBAR + 0x21c68);
 #endif
 #endif
+	if (not_has_erratum_a007212())
+		return;
 	/*
 	 * Even this workaround applies to selected version of SoCs, it is
 	 * safe to apply to all versions, with the limitation of odd ratios.
arch/powerpc/cpu/mpc85xx/speed.c +2 -1
index 3236f6a..904d19d 100644
@@ -13,6 +13,7 @@
 #include <common.h>
 #include <ppc_asm.tmpl>
 #include <linux/compiler.h>
+#include <asm/fsl_errata.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 
@@ -113,7 +114,7 @@ void get_sys_info(sys_info_t *sys_info)
 			FSL_CORENET_RCWSR0_MEM_PLL_RAT_SHIFT)
 			& FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK;
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007212
-	if (mem_pll_rat == 0) {
+	if (!not_has_erratum_a007212() && mem_pll_rat == 0) {
 		mem_pll_rat = (in_be32(&gur->rcwsr[0]) >>
 			FSL_CORENET_RCWSR0_MEM_PLL_RAT_RESV_SHIFT) &
 			FSL_CORENET_RCWSR0_MEM_PLL_RAT_MASK;
arch/powerpc/include/asm/fsl_errata.h +14 -0
index a977544..8f7777d 100644
@@ -96,3 +96,17 @@ static inline bool not_has_erratum_a007186(void)
 	return false;
 }
 #endif
+
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007212
+static inline bool not_has_erratum_a007212(void)
+{
+	u32 svr = get_svr();
+	u32 soc = SVR_SOC_VER(svr);
+
+	if (((soc == SVR_T2080) && (SVR_MAJ(svr) > 1)) ||
+	    ((soc == SVR_T2080) && (SVR_MAJ(svr) == 1) && (SVR_MIN(svr) > 0)))
+		return true;
+
+	return false;
+}
+#endif
Signature · 1 line
2.1.0.27.g96db324
#2 lore raw

PATCH 2/2 powerpc/mpc85xx: modify erratum A007212

Quoted 8 lines · Zhao Qiang

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007212 errata_workaround.

---

Qiang,

I don't agree with your analysis.

This workaround has two parts. One part is to to disable DDR PLL in RCW. The second part is to detect DDR PLL is disabled and to implement the software workaround to bring DDR up. U-boot has the second part, it is safe to apply to all versions for affected SoC. I put in the comments. Your patch detects the SVR and decide if the workaround should be applied. This is wrong. It should detect if DDR PLL is disabled. In case an old RCW is used, you don't want to end up with a dead board because DDR is disabled.

York

#3 lore raw

PATCH 2/2 powerpc/mpc85xx: modify erratum A007212

Quoted 22 lines · York Sun

-----Original Message-----
From: Sun York-R58495
Sent: Friday, September 26, 2014 1:01 PM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Cc: Xie Xiaobo-R63061; Zhao Qiang-B45475
Subject: Re: [PATCH 2/2] powerpc/mpc85xx: modify erratum A007212

Quoted 7 lines · Zhao Qiang

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007212 errata_workaround.

---

Qiang,

I don't agree with your analysis.

Quoted 8 lines

This workaround has two parts. One part is to to disable DDR PLL in RCW. The second part is to detect DDR PLL is disabled and to implement the software workaround to bring DDR up. U-boot has the second part, it is safe to apply to all versions for affected SoC. I put in the comments. Your patch detects the SVR and decide if the workaround should be applied. This is wrong. It should detect if DDR PLL is disabled. In case an old RCW is used, you don't want to end up with a dead board because DDR is disabled.

OK , got it , I will modify it for v2.
Thanks for you comment.

Quoted 2 lines

York

Best Regards
Zhao Qiang

#4 lore raw

PATCH 2/2 powerpc/mpc85xx: modify erratum A007212

Quoted 34 lines · On 09/25/2014 10:55 PM, Zhao Qiang-B45475 wrote:
Quoted 22 lines · York Sun

-----Original Message-----
From: Sun York-R58495
Sent: Friday, September 26, 2014 1:01 PM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Cc: Xie Xiaobo-R63061; Zhao Qiang-B45475
Subject: Re: [PATCH 2/2] powerpc/mpc85xx: modify erratum A007212

Quoted 7 lines · Zhao Qiang

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007212 errata_workaround.

---

Qiang,

I don't agree with your analysis.

Quoted 8 lines

This workaround has two parts. One part is to to disable DDR PLL in RCW. The second part is to detect DDR PLL is disabled and to implement the software workaround to bring DDR up. U-boot has the second part, it is safe to apply to all versions for affected SoC. I put in the comments. Your patch detects the SVR and decide if the workaround should be applied. This is wrong. It should detect if DDR PLL is disabled. In case an old RCW is used, you don't want to end up with a dead board because DDR is disabled.

Quoted 3 lines

OK , got it , I will modify it for v2.
Thanks for you comment.

Qiang,

I don't think you even need a patch for this. The logic for u-boot code is:

Regardless of the SVR, the workaround is not be applied if RCW doesn't disable DDR PLL.
Regardless of the SVR, the workaround is and should be applied if RCW disables DDR PLL.

York

#7 lore raw

PATCH 1/2 powerpc/mpc85xx: modify erratum A007186

In reply to Zhao Qiang
Quoted 18 lines · Zhao Qiang

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007186 errata_workaround.

---
 arch/powerpc/cpu/mpc85xx/cmd_errata.c          |   3 +-
 arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c | 210 ++++++++++++++-----------
 arch/powerpc/include/asm/fsl_errata.h          |  14 ++
 3 files changed, 130 insertions(+), 97 deletions(-)
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
index 3a04a89..741eb63 100644

arch/powerpc/cpu/mpc85xx/cmd_errata.c static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) · line 274

Quoted 6 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +2 -1
@@ -270,7 +270,8 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	puts("Work-around for Erratum USB14 enabled\n");
 #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007186
-	puts("Work-around for Erratum A007186 enabled\n");
+	if (!not_has_erratum_a007186())
+		puts("Work-around for Erratum A007186 enabled\n");

Please use positive logic.

Quoted 19 lines
arch/powerpc/cpu/mpc85xx/cmd_errata.c +0 -0
 #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A006593
 	puts("Work-around for Erratum A006593 enabled\n");
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +1 -0
index d1fc76a..9b0a538 100644
@@ -11,6 +11,7 @@
 #include <asm/processor.h>
 #include <asm/fsl_law.h>
 #include <asm/errno.h>
+#include <asm/fsl_errata.h>
 #include "fsl_corenet2_serdes.h"
 
 #ifdef CONFIG_SYS_FSL_SRDS_1
@@ -203,108 +204,125 @@ u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift)
  * This workaround for the protocols and rates that only have the Ring VCO.
  */
 #ifdef CONFIG_SYS_FSL_ERRATUM_A007186

arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c u64 serdes_init(u32 sd, u32 sd_addr, u32 sd_prctl_mask, u32 sd_prctl_shift) · line 211

Quoted 10 lines
arch/powerpc/cpu/mpc85xx/fsl_corenet2_serdes.c +4 -4
-	sfp_spfr0 = in_be32(&sfp_regs->fsl_spfr0);
-	debug("A007186: sfp_spfr0= %x\n", sfp_spfr0);
+	if (!not_has_erratum_a007186()) {
+		sfp_spfr0 = in_be32(&sfp_regs->fsl_spfr0);
+		debug("A007186: sfp_spfr0= %x\n", sfp_spfr0);
 
-	sel = (sfp_spfr0 >> FUSE_VAL_SHIFT) & FUSE_VAL_MASK;
+		sel = (sfp_spfr0 >> FUSE_VAL_SHIFT) & FUSE_VAL_MASK;
 
-	if (sel == 0x01 || sel == 0x02) {

Can you put the checking of has_erratum_a007186() here? You may be able to avoid the indentation change below.

York

#5 lore raw

PATCH 2/2 powerpc/mpc85xx: modify erratum A007212

In reply to York Sun
Quoted 51 lines · York Sun

-----Original Message-----
From: Sun York-R58495
Sent: Saturday, September 27, 2014 12:02 AM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Cc: Xie Xiaobo-R63061
Subject: Re: [PATCH 2/2] powerpc/mpc85xx: modify erratum A007212

Quoted 21 lines · On 09/25/2014 10:55 PM, Zhao Qiang-B45475 wrote:
Quoted 18 lines · York Sun

-----Original Message-----
From: Sun York-R58495
Sent: Friday, September 26, 2014 1:01 PM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Cc: Xie Xiaobo-R63061; Zhao Qiang-B45475
Subject: Re: [PATCH 2/2] powerpc/mpc85xx: modify erratum A007212

Quoted 7 lines · Zhao Qiang

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007212 errata_workaround.

---

Quoted 5 lines
Quoted 5 lines

Qiang,

I don't agree with your analysis.

This workaround has two parts. One part is to to disable DDR PLL in

RCW.

Quoted 3 lines
Quoted 3 lines

The second part is to detect DDR PLL is disabled and to implement the software workaround to bring DDR up. U-boot has the second part, it is safe to apply to all versions for affected SoC. I put in the

comments.

Quoted 1 line
Quoted 1 line

Your patch detects the SVR and decide if the workaround should be

applied.

Quoted 7 lines
Quoted 3 lines

This is wrong. It should detect if DDR PLL is disabled. In case an old RCW is used, you don't want to end up with a dead board because DDR is disabled.

OK , got it , I will modify it for v2.
Thanks for you comment.

Qiang,

Quoted 7 lines

I don't think you even need a patch for this. The logic for u-boot code is:

Regardless of the SVR, the workaround is not be applied if RCW doesn't disable DDR PLL.
Regardless of the SVR, the workaround is and should be applied if RCW disables DDR PLL.

And how about the file arch/powerpc/cpu/mpc85xx/speed.c.
The code doesn't detect if the DDR PLL is disabled, it will config the mem_pll_rat.

Quoted 2 lines

York

Best Regards
Zhao Qiang

#6 lore raw

PATCH 2/2 powerpc/mpc85xx: modify erratum A007212

Quoted 55 lines · On 9/27/14 6:56 PM, "Zhao Qiang-B45475" <[email protected]> wrote:
Quoted 54 lines · York Sun

-----Original Message-----
From: Sun York-R58495
Sent: Saturday, September 27, 2014 12:02 AM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Cc: Xie Xiaobo-R63061
Subject: Re: [PATCH 2/2] powerpc/mpc85xx: modify erratum A007212

Quoted 21 lines · On 09/25/2014 10:55 PM, Zhao Qiang-B45475 wrote:
Quoted 18 lines · York Sun

-----Original Message-----
From: Sun York-R58495
Sent: Friday, September 26, 2014 1:01 PM
To: Zhao Qiang-B45475; u-boot at lists.denx.de
Cc: Xie Xiaobo-R63061; Zhao Qiang-B45475
Subject: Re: [PATCH 2/2] powerpc/mpc85xx: modify erratum A007212

Quoted 7 lines · Zhao Qiang

T2080 v1.0 has this errata while v1.1 has fixed this errata by hardware, add a new function to check the SVR_SOC_VER, SVR_MAJ and SVR_MIN first, if the cpu is T2080 and version is not v1.0, doesn't run the a007212 errata_workaround.

---

Quoted 5 lines
Quoted 5 lines

Qiang,

I don't agree with your analysis.

This workaround has two parts. One part is to to disable DDR PLL in

RCW.

Quoted 3 lines
Quoted 3 lines

The second part is to detect DDR PLL is disabled and to implement the software workaround to bring DDR up. U-boot has the second part, it is safe to apply to all versions for affected SoC. I put in the

comments.

Quoted 1 line
Quoted 1 line

Your patch detects the SVR and decide if the workaround should be

applied.

Quoted 7 lines
Quoted 3 lines

This is wrong. It should detect if DDR PLL is disabled. In case an old RCW is used, you don't want to end up with a dead board because DDR is disabled.

OK , got it , I will modify it for v2.
Thanks for you comment.

Qiang,

I don't think you even need a patch for this. The logic for u-boot code is:

Quoted 8 lines
Quoted 4 lines

Regardless of the SVR, the workaround is not be applied if RCW doesn't disable DDR PLL.
Regardless of the SVR, the workaround is and should be applied if RCW disables DDR PLL.

And how about the file arch/powerpc/cpu/mpc85xx/speed.c. The code doesn?t detect if the DDR PLL is disabled, it will config the mem_pll_rat.

If you look closely in this file, you will see code guarded by macro CONFIG_SYS_FSL_ERRATUM_A007212. In case mem_pll_rat is detected as 0, a reserved field is used for DDR PLL ratio. It is written in erratum workaround. It wasn't in original document but should be updated a while ago.

York

Quoted 1 line
Quoted 1 line