m68knommu: support version 2 ColdFire split cache

The newer version 2 ColdFire CPU cores support a configurable cache
arrangement. The cache memory can be used as all instruction cache, all
data cache, or split in half for both instruction and data caching.
Support this setup via a Kconfig time menu that allows a kernel builder
to choose the arrangement they want to use.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>

+48 -14
+16 -14
arch/m68k/include/asm/m52xxacr.h
··· 53 53 #define ACR_WPROTECT 0x00000004 /* Write protect region */ 54 54 55 55 /* 56 - * Set the cache controller settings we will use. This code is set to 57 - * only use the instruction cache, even on the controllers that support 58 - * split cache. (This setup is trying to preserve the existing behavior 59 - * for now, in the furture I hope to actually use the split cache mode). 56 + * Set the cache controller settings we will use. On the cores that support 57 + * a split cache configuration we allow all the combinations at Kconfig 58 + * time. For those cores that only have an instruction cache we just set 59 + * that as on. 60 60 */ 61 - #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ 62 - defined(CONFIG_M5249) || defined(CONFIG_M5272) 61 + #if defined(CONFIG_CACHE_I) 62 + #define CACHE_TYPE CACR_DISD 63 + #elif defined(CONFIG_CACHE_D) 64 + #define CACHE_TYPE CACR_DISI 65 + #else 66 + #define CACHE_TYPE 67 + #endif 68 + 69 + #if defined(CONFIG_HAVE_CACHE_SPLIT) 70 + #define CACHE_INIT (CACR_CINV + CACHE_TYPE + CACR_EUSP) 71 + #define CACHE_MODE (CACR_CENB + CACHE_TYPE + CACR_DCM + CACR_EUSP) 72 + #else 63 73 #define CACHE_INIT (CACR_CINV) 64 74 #define CACHE_MODE (CACR_CENB + CACR_DCM) 65 - #else 66 - #ifdef CONFIG_COLDFIRE_SW_A7 67 - #define CACHE_INIT (CACR_CINV + CACR_DISD) 68 - #define CACHE_MODE (CACR_CENB + CACR_DISD + CACR_DCM) 69 - #else 70 - #define CACHE_INIT (CACR_CINV + CACR_DISD + CACR_EUSP) 71 - #define CACHE_MODE (CACR_CENB + CACR_DISD + CACR_DCM + CACR_EUSP) 72 - #endif 73 75 #endif 74 76 75 77 #define CACHE_INVALIDATE (CACHE_MODE + CACR_CINV)
+32
arch/m68knommu/Kconfig
··· 79 79 bool 80 80 default n 81 81 82 + config HAVE_CACHE_SPLIT 83 + bool 84 + 82 85 source "init/Kconfig" 83 86 84 87 source "kernel/Kconfig.freezer" ··· 127 124 config M520x 128 125 bool "MCF520x" 129 126 select GENERIC_CLOCKEVENTS 127 + select HAVE_CACHE_SPLIT 130 128 help 131 129 Freescale Coldfire 5207/5208 processor support. 132 130 133 131 config M523x 134 132 bool "MCF523x" 135 133 select GENERIC_CLOCKEVENTS 134 + select HAVE_CACHE_SPLIT 136 135 help 137 136 Freescale Coldfire 5230/1/2/4/5 processor support 138 137 ··· 146 141 147 142 config M5271 148 143 bool "MCF5271" 144 + select HAVE_CACHE_SPLIT 149 145 help 150 146 Freescale (Motorola) ColdFire 5270/5271 processor support. 151 147 ··· 158 152 159 153 config M5275 160 154 bool "MCF5275" 155 + select HAVE_CACHE_SPLIT 161 156 help 162 157 Freescale (Motorola) ColdFire 5274/5275 processor support. 163 158 164 159 config M528x 165 160 bool "MCF528x" 166 161 select GENERIC_CLOCKEVENTS 162 + select HAVE_CACHE_SPLIT 167 163 help 168 164 Motorola ColdFire 5280/5282 processor support. 169 165 ··· 257 249 help 258 250 Build support for the older revision ColdFire 5307 silicon. 259 251 Specifically this is the 1H55J mask revision. 252 + 253 + if HAVE_CACHE_SPLIT 254 + choice 255 + prompt "Split Cache Configuration" 256 + default CACHE_I 257 + 258 + config CACHE_I 259 + bool "Instruction" 260 + help 261 + Use all of the ColdFire CPU cache memory as an instruction cache. 262 + 263 + config CACHE_D 264 + bool "Data" 265 + help 266 + Use all of the ColdFire CPU cache memory as a data cache. 267 + 268 + config CACHE_BOTH 269 + bool "Both" 270 + help 271 + Split the ColdFire CPU cache, and use half as an instruction cache 272 + and half as a data cache. 273 + endchoice 274 + 275 + endif 260 276 261 277 comment "Platform" 262 278