MIPS: cpu-probe: Set Ingenic's writecombine to _CACHE_CACHABLE_WA
authorPaul Cercueil <paul@crapouillou.net>
Sun, 6 Sep 2020 19:29:22 +0000 (21:29 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 18 Sep 2020 14:26:36 +0000 (16:26 +0200)
Previously, in cpu_probe_ingenic(), c->writecombine was set to
_CACHE_UNCACHED_ACCELERATED, but this macro was defined differently when
CONFIG_MACH_INGENIC was set. This made it impossible to support multiple
CPUs.

Address this issue by setting c->writecombine to _CACHE_CACHABLE_WA
directly and removing the dependency on CONFIG_MACH_INGENIC.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/pgtable-bits.h
arch/mips/kernel/cpu-probe.c

index e26dc41..2362842 100644 (file)
@@ -249,11 +249,6 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
 
 #define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT)
 
-#elif defined(CONFIG_MACH_INGENIC)
-
-/* Ingenic uses the WA bit to achieve write-combine memory writes */
-#define _CACHE_UNCACHED_ACCELERATED (1<<_CACHE_SHIFT)
-
 #endif
 
 #ifndef _CACHE_CACHABLE_NO_WA
index e2955f1..a18f361 100644 (file)
@@ -2169,8 +2169,9 @@ static inline void cpu_probe_ingenic(struct cpuinfo_mips *c, unsigned int cpu)
 
        /* XBurst®1 with MXU2.0 SIMD ISA */
        case PRID_IMP_XBURST_REV2:
+               /* Ingenic uses the WA bit to achieve write-combine memory writes */
+               c->writecombine = _CACHE_CACHABLE_WA;
                c->cputype = CPU_XBURST;
-               c->writecombine = _CACHE_UNCACHED_ACCELERATED;
                __cpu_name[cpu] = "Ingenic XBurst";
                break;