MIPS: Convert TX49XX_ICACHE_INDEX_INV into a config option
authorThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 24 Aug 2020 16:32:47 +0000 (18:32 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 7 Sep 2020 20:24:09 +0000 (22:24 +0200)
Use a new config option to enable TX49XX I-cache index invalidate
workaround and remove define from different war.h files.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
15 files changed:
arch/mips/Kconfig
arch/mips/include/asm/mach-cavium-octeon/war.h
arch/mips/include/asm/mach-generic/war.h
arch/mips/include/asm/mach-ip22/war.h
arch/mips/include/asm/mach-ip27/war.h
arch/mips/include/asm/mach-ip28/war.h
arch/mips/include/asm/mach-ip30/war.h
arch/mips/include/asm/mach-ip32/war.h
arch/mips/include/asm/mach-malta/war.h
arch/mips/include/asm/mach-rc32434/war.h
arch/mips/include/asm/mach-rm/war.h
arch/mips/include/asm/mach-sibyte/war.h
arch/mips/include/asm/mach-tx49xx/war.h
arch/mips/include/asm/war.h
arch/mips/mm/c-r4k.c

index e4198c5..04a413d 100644 (file)
@@ -890,6 +890,7 @@ config MACH_TX39XX
 
 config MACH_TX49XX
        bool "Toshiba TX49 series based machines"
+       select WAR_TX49XX_ICACHE_INDEX_INV
 
 config MIKROTIK_RB532
        bool "Mikrotik RB532 boards"
@@ -2657,6 +2658,14 @@ config WAR_R4600_V1_HIT_CACHEOP
 config WAR_R4600_V2_HIT_CACHEOP
        bool
 
+# From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for
+# the line which this instruction itself exists, the following
+# operation is not guaranteed."
+#
+# Workaround: do two phase flushing for Index_Invalidate_I
+config WAR_TX49XX_ICACHE_INDEX_INV
+       bool
+
 #
 # - Highmem only makes sense for the 32-bit kernel.
 # - The current highmem code will only work properly on physically indexed
index 5826fbf..1cb3048 100644 (file)
@@ -11,7 +11,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index 11b1f5e..7953083 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index e47a7e1..35286ba 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index f3c5cc8..a18293c 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        1
 #define MIPS34K_MISSED_ITLB_WAR                0
index f867697..1a6092e 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        1
 #define MIPS34K_MISSED_ITLB_WAR                0
index acda1ee..031c7b9 100644 (file)
@@ -7,7 +7,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #ifdef CONFIG_CPU_R10000
 #define R10000_LLSC_WAR                        1
index ca38179..2555215 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  1
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index d22ca4a..9b08035 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  1
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index fccf25d..924b51b 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index 556e022..0536972 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index 0e18f07..9e006fd 100644 (file)
@@ -24,7 +24,6 @@ extern int sb1250_m3_workaround_needed(void);
 
 #endif
 
-#define TX49XX_ICACHE_INDEX_INV_WAR    0
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index 7019ddc..9293c5f 100644 (file)
@@ -10,7 +10,6 @@
 
 #define BCM1250_M3_WAR                 0
 #define SIBYTE_1956_WAR                        0
-#define TX49XX_ICACHE_INDEX_INV_WAR    1
 #define ICACHE_REFILLS_WORKAROUND_WAR  0
 #define R10000_LLSC_WAR                        0
 #define MIPS34K_MISSED_ITLB_WAR                0
index 590bf2b..7a69641 100644 (file)
 #error Check setting of SIBYTE_1956_WAR for your platform
 #endif
 
-/*
- * From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for
- * the line which this instruction itself exists, the following
- * operation is not guaranteed."
- *
- * Workaround: do two phase flushing for Index_Invalidate_I
- */
-#ifndef TX49XX_ICACHE_INDEX_INV_WAR
-#error Check setting of TX49XX_ICACHE_INDEX_INV_WAR for your platform
-#endif
-
 /*
  * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra
  * opposes it being called that) where invalid instructions in the same
index df09a36..4b12081 100644 (file)
@@ -239,7 +239,7 @@ static void r4k_blast_dcache_setup(void)
                r4k_blast_dcache = blast_dcache128;
 }
 
-/* force code alignment (used for TX49XX_ICACHE_INDEX_INV_WAR) */
+/* force code alignment (used for CONFIG_WAR_TX49XX_ICACHE_INDEX_INV) */
 #define JUMP_TO_ALIGN(order) \
        __asm__ __volatile__( \
                "b\t1f\n\t" \
@@ -371,7 +371,7 @@ static void r4k_blast_icache_page_indexed_setup(void)
                    cpu_is_r4600_v1_x())
                        r4k_blast_icache_page_indexed =
                                blast_icache32_r4600_v1_page_indexed;
-               else if (TX49XX_ICACHE_INDEX_INV_WAR)
+               else if (IS_ENABLED(CONFIG_WAR_TX49XX_ICACHE_INDEX_INV))
                        r4k_blast_icache_page_indexed =
                                tx49_blast_icache32_page_indexed;
                else if (current_cpu_type() == CPU_LOONGSON2EF)
@@ -399,7 +399,7 @@ static void r4k_blast_icache_setup(void)
                if (IS_ENABLED(CONFIG_WAR_R4600_V1_INDEX_ICACHEOP) &&
                    cpu_is_r4600_v1_x())
                        r4k_blast_icache = blast_r4600_v1_icache32;
-               else if (TX49XX_ICACHE_INDEX_INV_WAR)
+               else if (IS_ENABLED(CONFIG_WAR_TX49XX_ICACHE_INDEX_INV))
                        r4k_blast_icache = tx49_blast_icache32;
                else if (current_cpu_type() == CPU_LOONGSON2EF)
                        r4k_blast_icache = loongson2_blast_icache32;