summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@linux-m68k.org>2020-06-13 17:17:52 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-26 10:29:04 +0200
commitaac5d7539f28fe4ae5a78632299fed270adcb1b3 (patch)
treed56c5d1a0c4455fc8b11739a92361677e3abf97e
parent609e9302f163f4c516d1cf722006aa46bea5d147 (diff)
downloadlinux-stable-aac5d7539f28fe4ae5a78632299fed270adcb1b3.tar.gz
linux-stable-aac5d7539f28fe4ae5a78632299fed270adcb1b3.tar.bz2
linux-stable-aac5d7539f28fe4ae5a78632299fed270adcb1b3.zip
m68knommu: fix overwriting of bits in ColdFire V3 cache control
[ Upstream commit bdee0e793cea10c516ff48bf3ebb4ef1820a116b ] The Cache Control Register (CACR) of the ColdFire V3 has bits that control high level caching functions, and also enable/disable the use of the alternate stack pointer register (the EUSP bit) to provide separate supervisor and user stack pointer registers. The code as it is today will blindly clear the EUSP bit on cache actions like invalidation. So it is broken for this case - and that will result in failed booting (interrupt entry and exit processing will be completely hosed). This only affects ColdFire V3 parts that support the alternate stack register (like the 5329 for example) - generally speaking new parts do, older parts don't. It has no impact on ColdFire V3 parts with the single stack pointer, like the 5307 for example. Fix the cache bit defines used, so they maintain the EUSP bit when carrying out cache actions through the CACR register. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--arch/m68k/include/asm/m53xxacr.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/m68k/include/asm/m53xxacr.h b/arch/m68k/include/asm/m53xxacr.h
index 3177ce8331d6..baee0c77b981 100644
--- a/arch/m68k/include/asm/m53xxacr.h
+++ b/arch/m68k/include/asm/m53xxacr.h
@@ -88,9 +88,9 @@
* coherency though in all cases. And for copyback caches we will need
* to push cached data as well.
*/
-#define CACHE_INIT CACR_CINVA
-#define CACHE_INVALIDATE CACR_CINVA
-#define CACHE_INVALIDATED CACR_CINVA
+#define CACHE_INIT (CACHE_MODE + CACR_CINVA - CACR_EC)
+#define CACHE_INVALIDATE (CACHE_MODE + CACR_CINVA)
+#define CACHE_INVALIDATED (CACHE_MODE + CACR_CINVA)
#define ACR0_MODE ((CONFIG_RAMBASE & 0xff000000) + \
(0x000f0000) + \