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 #define ACR_WPROTECT 0x00000004 /* Write protect region */ 54 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). 60 */ 61 - #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || \ 62 - defined(CONFIG_M5249) || defined(CONFIG_M5272) 63 #define CACHE_INIT (CACR_CINV) 64 #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 #endif 74 75 #define CACHE_INVALIDATE (CACHE_MODE + CACR_CINV)
··· 53 #define ACR_WPROTECT 0x00000004 /* Write protect region */ 54 55 /* 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 */ 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 73 #define CACHE_INIT (CACR_CINV) 74 #define CACHE_MODE (CACR_CENB + CACR_DCM) 75 #endif 76 77 #define CACHE_INVALIDATE (CACHE_MODE + CACR_CINV)
+32
arch/m68knommu/Kconfig
··· 79 bool 80 default n 81 82 source "init/Kconfig" 83 84 source "kernel/Kconfig.freezer" ··· 127 config M520x 128 bool "MCF520x" 129 select GENERIC_CLOCKEVENTS 130 help 131 Freescale Coldfire 5207/5208 processor support. 132 133 config M523x 134 bool "MCF523x" 135 select GENERIC_CLOCKEVENTS 136 help 137 Freescale Coldfire 5230/1/2/4/5 processor support 138 ··· 146 147 config M5271 148 bool "MCF5271" 149 help 150 Freescale (Motorola) ColdFire 5270/5271 processor support. 151 ··· 158 159 config M5275 160 bool "MCF5275" 161 help 162 Freescale (Motorola) ColdFire 5274/5275 processor support. 163 164 config M528x 165 bool "MCF528x" 166 select GENERIC_CLOCKEVENTS 167 help 168 Motorola ColdFire 5280/5282 processor support. 169 ··· 257 help 258 Build support for the older revision ColdFire 5307 silicon. 259 Specifically this is the 1H55J mask revision. 260 261 comment "Platform" 262
··· 79 bool 80 default n 81 82 + config HAVE_CACHE_SPLIT 83 + bool 84 + 85 source "init/Kconfig" 86 87 source "kernel/Kconfig.freezer" ··· 124 config M520x 125 bool "MCF520x" 126 select GENERIC_CLOCKEVENTS 127 + select HAVE_CACHE_SPLIT 128 help 129 Freescale Coldfire 5207/5208 processor support. 130 131 config M523x 132 bool "MCF523x" 133 select GENERIC_CLOCKEVENTS 134 + select HAVE_CACHE_SPLIT 135 help 136 Freescale Coldfire 5230/1/2/4/5 processor support 137 ··· 141 142 config M5271 143 bool "MCF5271" 144 + select HAVE_CACHE_SPLIT 145 help 146 Freescale (Motorola) ColdFire 5270/5271 processor support. 147 ··· 152 153 config M5275 154 bool "MCF5275" 155 + select HAVE_CACHE_SPLIT 156 help 157 Freescale (Motorola) ColdFire 5274/5275 processor support. 158 159 config M528x 160 bool "MCF528x" 161 select GENERIC_CLOCKEVENTS 162 + select HAVE_CACHE_SPLIT 163 help 164 Motorola ColdFire 5280/5282 processor support. 165 ··· 249 help 250 Build support for the older revision ColdFire 5307 silicon. 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 276 277 comment "Platform" 278