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 /****************************************************************************/
16 * The different ColdFire families have different cache arrangments.
17 * Everything from a small instruction only cache, to configurable
18 * data and/or instruction cache, to unified instruction/data, to
19 * harvard style separate instruction and data caches.
22 #if defined(CONFIG_M5206) || defined(CONFIG_M5206e) || defined(CONFIG_M5272)
24 * Simple version 2 core cache. These have instruction cache only,
25 * we just need to invalidate it and enable it.
28 movel
#0x01000000,%d0 /* invalidate cache cmd */
29 movec
%d0
,%CACR
/* do invalidate cache */
30 movel
#0x80000100,%d0 /* setup cache mask */
31 movec
%d0
,%CACR
/* enable cache */
33 #endif /* CONFIG_M5206 || CONFIG_M5206e || CONFIG_M5272 */
35 #if defined(CONFIG_M523x) || defined(CONFIG_M527x)
37 * New version 2 cores have a configurable split cache arrangement.
38 * For now I am just enabling instruction cache - but ultimately I
39 * think a split instruction/data cache would be better.
43 movec
%d0
,%CACR
/* invalidate cache */
45 movel
#0x0000c000,%d0 /* set SDRAM cached only */
47 movel
#0x00000000,%d0 /* no other regions cached */
49 movel
#0x80400100,%d0 /* configure cache */
50 movec
%d0
,%CACR
/* enable cache */
53 #endif /* CONFIG_M523x || CONFIG_M527x */
55 #if defined(CONFIG_M528x)
58 movel
#0x01000000, %d0
59 movec
%d0
, %CACR
/* Invalidate cache */
61 movel
#0x0000c020, %d0 /* Set SDRAM cached only */
63 movel
#0xff00c000, %d0 /* Cache Flash also */
65 movel
#0x80000200, %d0 /* Setup cache mask */
66 movec
%d0
, %CACR
/* Enable cache */
69 #endif /* CONFIG_M528x */
71 #if defined(CONFIG_M5249) || defined(CONFIG_M5307)
73 * The version 3 core cache. Oddly enough the version 2 core 5249
74 * has the same SDRAM and cache setup as the version 3 cores.
75 * This is a single unified instruction/data cache.
78 movel
#0x01000000,%d0 /* invalidate whole cache */
81 #if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3)
82 movel
#0x0000c000,%d0 /* set SDRAM cached (write-thru) */
84 movel
#0x0000c020,%d0 /* set SDRAM cached (copyback) */
87 movel
#0x00000000,%d0 /* no other regions cached */
89 movel
#0xa0000200,%d0 /* enable cache */
93 #endif /* CONFIG_M5249 || CONFIG_M5307 */
95 #if defined(CONFIG_M5407)
97 * Version 4 cores have a true harvard style separate instruction
98 * and data cache. Invalidate and enable cache, also enable write
99 * buffers and branch accelerator.
102 movel
#0x01040100,%d0 /* invalidate whole cache */
105 movel
#0x000fc000,%d0 /* set SDRAM cached only */
107 movel
#0x00000000,%d0 /* no other regions cached */
109 movel
#0x000fc000,%d0 /* set SDRAM cached only */
111 movel
#0x00000000,%d0 /* no other regions cached */
113 movel
#0xb6088400,%d0 /* enable caches */
117 #endif /* CONFIG_M5407 */
119 #if defined(CONFIG_M520x)
121 move
.l
#0x01000000,%d0 /* invalidate whole cache */
124 move
.l
#0x0000c000,%d0 /* set SDRAM cached (write-thru) */
126 move
.l
#0x00000000,%d0 /* no other regions cached */
128 move
.l
#0x80400000,%d0 /* enable 8K instruction cache */
132 #endif /* CONFIG_M520x */
134 /****************************************************************************/
135 #endif /* __M68KNOMMU_MCFCACHE_H */