1 /****************************************************************************/
4 * mcfcache.h -- ColdFire CPU cache support code
6 * (C) Copyright 2004, Greg Ungerer <gerg@snapgear.com>
9 /****************************************************************************/
10 #ifndef __M68KNOMMU_MCFCACHE_H
11 #define __M68KNOMMU_MCFCACHE_H
12 /****************************************************************************/
14 #include <linux/config.h>
17 * The different ColdFire families have different cache arrangments.
18 * Everything from a small instruction only cache, to configurable
19 * data and/or instruction cache, to unified instruction/data, to
20 * harvard style separate instruction and data caches.
23 #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272)
25 * Simple version 2 core cache. These have instruction cache only,
26 * we just need to invalidate it and enable it.
29 movel
#0x01000000,%d0 /* invalidate cache cmd */
30 movec
%d0
,%CACR
/* do invalidate cache */
31 movel
#0x80000100,%d0 /* setup cache mask */
32 movec
%d0
,%CACR
/* enable cache */
34 #endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */
36 #if defined(CONFIG_M527x)
38 * New version 2 cores have a configurable split cache arrangement.
39 * For now I am just enabling instruction cache - but ultimately I
40 * think a split instruction/data cache would be better.
44 movec
%d0
,%CACR
/* invalidate cache */
46 movel
#0x0000c000,%d0 /* set SDRAM cached only */
48 movel
#0x00000000,%d0 /* no other regions cached */
50 movel
#0x80400100,%d0 /* configure cache */
51 movec
%d0
,%CACR
/* enable cache */
54 #endif /* CONFIG_M527x */
56 #if defined(CONFIG_M528x)
58 * Cache is totally broken on early 5282 silicon. So far now we
59 * disable its cache all together.
63 movec
%d0
,%CACR
/* invalidate cache */
65 movel
#0x0000c000,%d0 /* set SDRAM cached only */
67 movel
#0x00000000,%d0 /* no other regions cached */
69 movel
#0x00000000,%d0 /* configure cache */
70 movec
%d0
,%CACR
/* enable cache */
73 #endif /* CONFIG_M528x */
75 #if defined(CONFIG_M5249) || defined(CONFIG_M5307)
77 * The version 3 core cache. Oddly enough the version 2 core 5249
78 * has the same SDRAM and cache setup as the version 3 cores.
79 * This is a single unified instruction/data cache.
82 movel
#0x01000000,%d0 /* invalidate whole cache */
85 #if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3)
86 movel
#0x0000c000,%d0 /* set SDRAM cached (write-thru) */
88 movel
#0x0000c020,%d0 /* set SDRAM cached (copyback) */
91 movel
#0x00000000,%d0 /* no other regions cached */
93 movel
#0xa0000200,%d0 /* enable cache */
97 #endif /* CONFIG_M5249 || CONFIG_M5307 */
99 #if defined(CONFIG_M5407)
101 * Version 4 cores have a true harvard style separate instruction
102 * and data cache. Invalidate and enable cache, also enable write
103 * buffers and branch accelerator.
106 movel
#0x01040100,%d0 /* invalidate whole cache */
109 movel
#0x000fc000,%d0 /* set SDRAM cached only */
111 movel
#0x00000000,%d0 /* no other regions cached */
113 movel
#0x000fc000,%d0 /* set SDRAM cached only */
115 movel
#0x00000000,%d0 /* no other regions cached */
117 movel
#0xb6088400,%d0 /* enable caches */
121 #endif /* CONFIG_M5407 */
124 /****************************************************************************/
125 #endif /* __M68KNOMMU_MCFCACHE_H */