diff options
author | Richard Curnow <richard.curnow@st.com> | 2006-09-27 01:09:26 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 01:09:26 -0400 |
commit | b638d0b921dc95229af0dfd09cd24850336a2f75 (patch) | |
tree | 0ef34527a47b22421fb92ba2141052fecfe36482 /include/asm-sh | |
parent | fdfc74f9fcebdda14609159d5010b758a9409acf (diff) |
sh: Optimized cache handling for SH-4/SH-4A caches.
This reworks some of the SH-4 cache handling code to more easily
accomodate newer-style caches (particularly for the > direct-mapped
case), as well as optimizing some of the old code.
Signed-off-by: Richard Curnow <richard.curnow@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r-- | include/asm-sh/cache.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/asm-sh/cache.h b/include/asm-sh/cache.h index 656fdfe9e8b4..33f13367054b 100644 --- a/include/asm-sh/cache.h +++ b/include/asm-sh/cache.h | |||
@@ -23,15 +23,29 @@ | |||
23 | #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) | 23 | #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) |
24 | 24 | ||
25 | struct cache_info { | 25 | struct cache_info { |
26 | unsigned int ways; | 26 | unsigned int ways; /* Number of cache ways */ |
27 | unsigned int sets; | 27 | unsigned int sets; /* Number of cache sets */ |
28 | unsigned int linesz; | 28 | unsigned int linesz; /* Cache line size (bytes) */ |
29 | 29 | ||
30 | unsigned int way_incr; | 30 | unsigned int way_size; /* sets * line size */ |
31 | 31 | ||
32 | /* | ||
33 | * way_incr is the address offset for accessing the next way | ||
34 | * in memory mapped cache array ops. | ||
35 | */ | ||
36 | unsigned int way_incr; | ||
32 | unsigned int entry_shift; | 37 | unsigned int entry_shift; |
33 | unsigned int entry_mask; | 38 | unsigned int entry_mask; |
34 | 39 | ||
40 | /* | ||
41 | * Compute a mask which selects the address bits which overlap between | ||
42 | * 1. those used to select the cache set during indexing | ||
43 | * 2. those in the physical page number. | ||
44 | */ | ||
45 | unsigned int alias_mask; | ||
46 | |||
47 | unsigned int n_aliases; /* Number of aliases */ | ||
48 | |||
35 | unsigned long flags; | 49 | unsigned long flags; |
36 | }; | 50 | }; |
37 | 51 | ||