]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
powerpc/85xx: implement check for erratum A-004849 work-around
authorTimur Tabi <timur@freescale.com>
Thu, 25 Oct 2012 12:40:00 +0000 (12:40 +0000)
committerAndy Fleming <afleming@freescale.com>
Wed, 28 Nov 2012 00:28:06 +0000 (18:28 -0600)
The work-around for erratum A-004849 ("CoreNet fabric (CCF) can exhibit a
deadlock under certain traffic patterns causing the system to hang") is
implemented via the PBI (pre-boot initialization code, typically attached
to the RCW binary).  This is because the work-around is easier to implement
in PBI than in U-Boot itself.

It is still useful, however, for the 'errata' command to tell us whether
the work-around has been applied.  For A-004849, we can do this by verifying
that the values in the specific registers that the work-around says to
update.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
arch/powerpc/cpu/mpc85xx/cmd_errata.c
arch/powerpc/include/asm/config_mpc85xx.h

index 2be192d578f5ae46818451c459b23203b974d38a..ccfad56caac0e5765786f489cfba5c0d362e80f2 100644 (file)
 #include <linux/compiler.h>
 #include <asm/processor.h>
 
+#ifdef CONFIG_SYS_FSL_ERRATUM_A004849
+/*
+ * This work-around is implemented in PBI, so just check to see if the
+ * work-around was actually applied.  To do this, we check for specific data
+ * at specific addresses in DCSR.
+ *
+ * Array offsets[] contains a list of offsets within DCSR.  According to the
+ * erratum document, the value at each offset should be 2.
+ */
+static void check_erratum_a4849(uint32_t svr)
+{
+       void __iomem *dcsr = (void *)CONFIG_SYS_DCSRBAR + 0xb0000;
+       unsigned int i;
+
+#if defined(CONFIG_PPC_P2041) || defined(CONFIG_PPC_P3041)
+       static const uint8_t offsets[] = {
+               0x50, 0x54, 0x58, 0x90, 0x94, 0x98
+       };
+#endif
+#ifdef CONFIG_PPC_P4080
+       static const uint8_t offsets[] = {
+               0x60, 0x64, 0x68, 0x6c, 0xa0, 0xa4, 0xa8, 0xac
+       };
+#endif
+       uint32_t x108; /* The value that should be at offset 0x108 */
+
+       for (i = 0; i < ARRAY_SIZE(offsets); i++) {
+               if (in_be32(dcsr + offsets[i]) != 2) {
+                       printf("Work-around for Erratum A004849 is not enabled\n");
+                       return;
+               }
+       }
+
+#if defined(CONFIG_PPC_P2041) || defined(CONFIG_PPC_P3041)
+       x108 = 0x12;
+#endif
+
+#ifdef CONFIG_PPC_P4080
+       /*
+        * For P4080, the erratum document says that the value at offset 0x108
+        * should be 0x12 on rev2, or 0x1c on rev3.
+        */
+       if (SVR_MAJ(svr) == 2)
+               x108 = 0x12;
+       if (SVR_MAJ(svr) == 3)
+               x108 = 0x1c;
+#endif
+
+       if (in_be32(dcsr + 0x108) != x108) {
+               printf("Work-around for Erratum A004849 is not enabled\n");
+               return;
+       }
+
+       /* Everything matches, so the erratum work-around was applied */
+
+       printf("Work-around for Erratum A004849 enabled\n");
+}
+#endif
+
 static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifdef CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011
@@ -136,6 +195,10 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 #ifdef CONFIG_SYS_FSL_ERRATUM_A_004934
        puts("Work-around for Erratum A004934 enabled\n");
+#endif
+#ifdef CONFIG_SYS_FSL_ERRATUM_A004849
+       /* This work-around is implemented in PBI, so just check for it */
+       check_erratum_a4849(svr);
 #endif
        return 0;
 }
index 6666d3d2837de030d830892b0b2a3ec3821fdf06..61dd06142755aca06b7151eebaf46ecb6221bc17 100644 (file)
 #define CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV2        0x11
 #define CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY 0xf0000000
 #define CONFIG_SYS_FSL_ERRATUM_SRIO_A004034
+#define CONFIG_SYS_FSL_ERRATUM_A004849
 
 #elif defined(CONFIG_PPC_P3041)
 #define CONFIG_SYS_FSL_QORIQ_CHASSIS1
 #define CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV2        0x11
 #define CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY 0xf0000000
 #define CONFIG_SYS_FSL_ERRATUM_SRIO_A004034
+#define CONFIG_SYS_FSL_ERRATUM_A004849
 
 #elif defined(CONFIG_PPC_P4080) /* also supports P4040 */
 #define CONFIG_SYS_FSL_QORIQ_CHASSIS1
 #define CONFIG_SYS_FSL_ERRATUM_A004510_SVR_REV 0x20
 #define CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY 0xff000000
 #define CONFIG_SYS_FSL_ERRATUM_SRIO_A004034
+#define CONFIG_SYS_FSL_ERRATUM_A004849
 
 #elif defined(CONFIG_PPC_P5020) /* also supports P5010 */
 #define CONFIG_SYS_PPC64               /* 64-bit core */