]> git.sur5r.net Git - u-boot/commitdiff
powerpc: mpc85xx: Implemente workaround for CPU erratum A-007907
authorDarwin Dingel <darwin.dingel@alliedtelesis.co.nz>
Mon, 24 Oct 2016 20:48:01 +0000 (09:48 +1300)
committerYork Sun <york.sun@nxp.com>
Tue, 24 Jan 2017 21:28:02 +0000 (13:28 -0800)
Core hang occurs when using L1 stashes. Workaround is to disable L1
stashes so software uses L2 cache for stashes instead.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Darwin Dingel <darwin.dingel@alliedtelesis.co.nz>
Cc: York Sun <york.sun@nxp.com>
[York S: Move SYS_FSL_ERRATUM_A007907 to Kconfig]
Reviewed-by: York Sun <york.sun@nxp.com>
arch/powerpc/cpu/mpc85xx/Kconfig
arch/powerpc/cpu/mpc85xx/cmd_errata.c
arch/powerpc/cpu/mpc85xx/cpu_init.c
arch/powerpc/include/asm/processor.h

index 704f65b09372dfbc87f4c98a5dcd3ba1d4a23d71..b0f34b6f15e12ffcdc04693c02b8c67e0c69fd15 100644 (file)
@@ -365,6 +365,7 @@ config ARCH_B4860
        select SYS_FSL_ERRATUM_A007075
        select SYS_FSL_ERRATUM_A007186
        select SYS_FSL_ERRATUM_A007212
+       select SYS_FSL_ERRATUM_A007907
        select SYS_FSL_ERRATUM_A009942
        select SYS_FSL_HAS_DDR3
        select SYS_FSL_HAS_SEC
@@ -830,6 +831,7 @@ config ARCH_T2080
        select SYS_FSL_ERRATUM_A006593
        select SYS_FSL_ERRATUM_A007186
        select SYS_FSL_ERRATUM_A007212
+       select SYS_FSL_ERRATUM_A007907
        select SYS_FSL_ERRATUM_A009942
        select SYS_FSL_ERRATUM_ESDHC111
        select SYS_FSL_HAS_DDR3
@@ -891,6 +893,7 @@ config ARCH_T4240
        select SYS_FSL_ERRATUM_A006593
        select SYS_FSL_ERRATUM_A007186
        select SYS_FSL_ERRATUM_A007798
+       select SYS_FSL_ERRATUM_A007907
        select SYS_FSL_ERRATUM_A009942
        select SYS_FSL_HAS_DDR3
        select SYS_FSL_HAS_SEC
@@ -1081,6 +1084,9 @@ config SYS_FSL_ERRATUM_A007212
 config SYS_FSL_ERRATUM_A007798
        bool
 
+config SYS_FSL_ERRATUM_A007907
+       bool
+
 config SYS_FSL_ERRATUM_A008044
        bool
 
index 54b5b33222e05814b5c5bfcfbb7b98e915be1b19..822ae7251b1e1a91fd23b5e2026ecbff706e957e 100644 (file)
@@ -330,7 +330,9 @@ static int do_errata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifdef CONFIG_SYS_FSL_ERRATUM_A009663
        puts("Work-around for Erratum A009663 enabled\n");
 #endif
-
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007907
+       puts("Work-around for Erratum A007907 enabled\n");
+#endif
        return 0;
 }
 
index 822844dfa9fd3a534ecd20096dda79f059129be2..f5bf67c990325764775565c26715a7dc854c68c7 100644 (file)
@@ -777,6 +777,13 @@ int cpu_init_r(void)
                sync();
        }
 #endif
+
+#ifdef CONFIG_SYS_FSL_ERRATUM_A007907
+       flush_dcache();
+       mtspr(L1CSR2, (mfspr(L1CSR2) & ~L1CSR2_DCSTASHID));
+       sync();
+#endif
+
 #ifdef CONFIG_SYS_FSL_ERRATUM_A005812
        /*
         * A-005812 workaround sets bit 32 of SPR 976 for SoCs running
index fbf72bb7c62f658f78b836ec17e75dc6c60ee473..81bae6f00896506c9f4a28f39a88dbbde411e9c1 100644 (file)
 #define   L1CSR1_ICE           0x00000001      /* Instruction Cache Enable */
 #define SPRN_L1CSR2    0x25e   /* L1 Data Cache Control and Status Register 2 */
 #define   L1CSR2_DCWS          0x40000000      /* Data Cache Write Shadow */
+#define   L1CSR2_DCSTASHID  0x000003ff /* Data Cache Stash ID */
 #define SPRN_L2CSR0    0x3f9   /* L2 Data Cache Control and Status Register 0 */
 #define   L2CSR0_L2E           0x80000000      /* L2 Cache Enable */
 #define   L2CSR0_L2PE          0x40000000      /* L2 Cache Parity/ECC Enable */