]> git.sur5r.net Git - u-boot/commitdiff
powerpc/85xx: Add workaround for erratum CPU-A003999
authorKumar Gala <galak@kernel.crashing.org>
Tue, 22 Nov 2011 12:51:15 +0000 (06:51 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 29 Nov 2011 14:48:05 +0000 (08:48 -0600)
Erratum A-003999: Running Floating Point instructions requires special
initialization.

Impact:
Floating point arithmetic operations may result in an incorrect value.

Workaround:
Perform a read modify write to set bit 7 to a 1 in SPR 977 before
executing any floating point arithmetic operation. This bit can be set
when setting MSR[FP], and can be cleared when clearing MSR[FP].
Alternatively, the bit can be set once at boot time, and never cleared.
There will be no performance degradation due to setting this bit.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/cpu/mpc85xx/cmd_errata.c
arch/powerpc/cpu/mpc85xx/release.S
arch/powerpc/cpu/mpc85xx/start.S
arch/powerpc/include/asm/config_mpc85xx.h

index 253bf08b6a625e0e90caa934b59e6af958087c17..523f297035a6f5f7eff7d513653fd9b805c65cf8 100644 (file)
@@ -53,6 +53,9 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22)
        puts("Work-around for Erratum CPU22 enabled\n");
 #endif
+#if defined(CONFIG_SYS_FSL_ERRATUM_CPU_A003999)
+       puts("Work-around for Erratum CPU-A003999 enabled\n");
+#endif
 #if defined(CONFIG_SYS_FSL_ERRATUM_DDR_MSYNC_IN)
        puts("Work-around for DDR MSYNC_IN Erratum enabled\n");
 #endif
index 6678ed4118c02403b129f7f49c00b96a29a2af3e..c81e19c0e99bc5231d8a3c32b166d47373a2b84f 100644 (file)
@@ -68,6 +68,12 @@ __secondary_start_page:
        mtspr   SPRN_HID1,r3
 #endif
 
+#ifdef CONFIG_SYS_FSL_ERRATUM_CPU_A003999
+       mfspr   r3,977
+       oris    r3,r3,0x0100
+       mtspr   977,r3
+#endif
+
        /* Enable branch prediction */
        lis     r3,BUCSR_ENABLE@h
        ori     r3,r3,BUCSR_ENABLE@l
index 7bd5cc0b0fcb534cd3541100ad71b45bf97919fb..4d37d6e86389c9a7b3f926968c04058c92e1ad12 100644 (file)
@@ -253,6 +253,12 @@ l2_disabled:
        mtspr   HID1,r0
 #endif
 
+#ifdef CONFIG_SYS_FSL_ERRATUM_CPU_A003999
+       mfspr   r3,977
+       oris    r3,r3,0x0100
+       mtspr   977,r3
+#endif
+
        /* Enable Branch Prediction */
 #if defined(CONFIG_BTB)
        lis     r0,BUCSR_ENABLE@h
index 981d639796a6841cc4edeab180772c42374ee456..f1da82eba0413ae060f56662fc30898690115314 100644 (file)
 #define CONFIG_SYS_FSL_USB2_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define CONFIG_SYS_FSL_ERRATUM_CPU_A003999
 
 #elif defined(CONFIG_PPC_P2041)
 #define CONFIG_MAX_CPUS                        4
 #define CONFIG_SYS_FSL_USB2_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define CONFIG_SYS_FSL_ERRATUM_CPU_A003999
 
 #elif defined(CONFIG_PPC_P3041)
 #define CONFIG_MAX_CPUS                        4
 #define CONFIG_SYS_FSL_USB2_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
+#define CONFIG_SYS_FSL_ERRATUM_CPU_A003999
 
 #elif defined(CONFIG_PPC_P3060)
 #define CONFIG_MAX_CPUS                        8
 #define CONFIG_SYS_FSL_PCIE_COMPAT     "fsl,qoriq-pcie-v2.2"
 #define CONFIG_SYS_CCSRBAR_DEFAULT     0xfe000000
 #define CONFIG_SYS_FSL_ERRATUM_DDR_A003
+#define CONFIG_SYS_FSL_ERRATUM_CPU_A003999
 
 #elif defined(CONFIG_PPC_P4040)
 #define CONFIG_MAX_CPUS                        4
 #define CONFIG_SYS_FSL_TBCLK_DIV       16
 #define CONFIG_SYS_FSL_PCIE_COMPAT     "fsl,p4080-pcie"
 #define CONFIG_SYS_CCSRBAR_DEFAULT     0xfe000000
+#define CONFIG_SYS_FSL_ERRATUM_CPU_A003999
 
 #elif defined(CONFIG_PPC_P4080)
 #define CONFIG_MAX_CPUS                        8
 #define CONFIG_SYS_P4080_ERRATUM_SERDES9
 #define CONFIG_SYS_P4080_ERRATUM_SERDES_A001
 #define CONFIG_SYS_P4080_ERRATUM_SERDES_A005
+#define CONFIG_SYS_FSL_ERRATUM_CPU_A003999
 
 /* P5010 is single core version of P5020 */
 #elif defined(CONFIG_PPC_P5010)