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_M523x) || 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_M523x || CONFIG_M527x */
56 #if defined(CONFIG_M528x)
59 movel
#0x01000000, %d0
60 movec
%d0
, %CACR
/* Invalidate cache */
62 movel
#0x0000c020, %d0 /* Set SDRAM cached only */
64 movel
#0xff00c000, %d0 /* Cache Flash also */
66 movel
#0x80000200, %d0 /* Setup cache mask */
67 movec
%d0
, %CACR
/* Enable cache */
70 #endif /* CONFIG_M528x */
72 #if defined(CONFIG_M5249) || defined(CONFIG_M5307)
74 * The version 3 core cache. Oddly enough the version 2 core 5249
75 * has the same SDRAM and cache setup as the version 3 cores.
76 * This is a single unified instruction/data cache.
79 movel
#0x01000000,%d0 /* invalidate whole cache */
82 #if defined(DEBUGGER_COMPATIBLE_CACHE) || defined(CONFIG_SECUREEDGEMP3)
83 movel
#0x0000c000,%d0 /* set SDRAM cached (write-thru) */
85 movel
#0x0000c020,%d0 /* set SDRAM cached (copyback) */
88 movel
#0x00000000,%d0 /* no other regions cached */
90 movel
#0xa0000200,%d0 /* enable cache */
94 #endif /* CONFIG_M5249 || CONFIG_M5307 */
96 #if defined(CONFIG_M5407)
98 * Version 4 cores have a true harvard style separate instruction
99 * and data cache. Invalidate and enable cache, also enable write
100 * buffers and branch accelerator.
103 movel
#0x01040100,%d0 /* invalidate whole cache */
106 movel
#0x000fc000,%d0 /* set SDRAM cached only */
108 movel
#0x00000000,%d0 /* no other regions cached */
110 movel
#0x000fc000,%d0 /* set SDRAM cached only */
112 movel
#0x00000000,%d0 /* no other regions cached */
114 movel
#0xb6088400,%d0 /* enable caches */
118 #endif /* CONFIG_M5407 */
121 /****************************************************************************/
122 #endif /* __M68KNOMMU_MCFCACHE_H */