]> git.sur5r.net Git - u-boot/commitdiff
MIPS: Preserve Config implementation-defined bits
authorPaul Burton <paul.burton@imgtec.com>
Wed, 21 Sep 2016 10:18:50 +0000 (11:18 +0100)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Wed, 21 Sep 2016 13:04:04 +0000 (15:04 +0200)
The coprocessor 0 Config register includes 9 implementation defined
bits, which in some processors do things like enable write combining or
other functionality. We ought not to wipe them to 0 during boot. Rather
than doing so, preserve their value & only clear the bits standardised
by the MIPS architecture.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
arch/mips/cpu/start.S
arch/mips/include/asm/mipsregs.h

index 827a544987852587a1ca7018e2a160c4b71b19ca..6aec430a670ceb3223b92fd5ab70600e70eacbc0 100644 (file)
@@ -123,8 +123,9 @@ reset:
        mtc0    zero, CP0_COMPARE
 
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
-       /* CONFIG0 register */
-       li      t0, CONF_CM_UNCACHED
+       mfc0    t0, CP0_CONFIG
+       and     t0, t0, MIPS_CONF_IMPL
+       or      t0, t0, CONF_CM_UNCACHED
        mtc0    t0, CP0_CONFIG
 #endif
 
index 3185dc7abf2048d3ea4d917c678333d04b63509c..cd4f952df0af2419865b2aa048a8ecfdb0bfcb62 100644 (file)
 #define MIPS_CONF_MT_FTLB      (_ULCAST_(4) <<  7)
 #define MIPS_CONF_AR           (_ULCAST_(7) << 10)
 #define MIPS_CONF_AT           (_ULCAST_(3) << 13)
+#define MIPS_CONF_IMPL         (_ULCAST_(0x1ff) << 16)
 #define MIPS_CONF_M            (_ULCAST_(1) << 31)
 
 /*