diff options
author | Yoshinori Sato <ysato@users.sourceforge.jp> | 2006-11-05 01:40:13 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-12-05 20:45:36 -0500 |
commit | 9d4436a6fbc8c5eccdfcb8f5884e0a7b4a57f6d2 (patch) | |
tree | a8b7532fffa76ae526dea547cc87200466e00842 /arch/sh/mm | |
parent | e62438630ca37539c8cc1553710bbfaa3cf960a7 (diff) |
sh: Add support for SH7206 and SH7619 CPU subtypes.
This implements initial support for the SH7206 (SH-2A) and SH7619
(SH-2) MMU-less CPUs.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/Kconfig | 17 | ||||
-rw-r--r-- | arch/sh/mm/cache-sh2.c | 69 |
2 files changed, 53 insertions, 33 deletions
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 9dd606464d23..814a17586974 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
@@ -4,8 +4,12 @@ menu "Processor selection" | |||
4 | # Processor families | 4 | # Processor families |
5 | # | 5 | # |
6 | config CPU_SH2 | 6 | config CPU_SH2 |
7 | select SH_WRITETHROUGH if !CPU_SH2A | ||
7 | bool | 8 | bool |
8 | select SH_WRITETHROUGH | 9 | |
10 | config CPU_SH2A | ||
11 | bool | ||
12 | select CPU_SH2 | ||
9 | 13 | ||
10 | config CPU_SH3 | 14 | config CPU_SH3 |
11 | bool | 15 | bool |
@@ -40,6 +44,16 @@ config CPU_SUBTYPE_SH7604 | |||
40 | bool "Support SH7604 processor" | 44 | bool "Support SH7604 processor" |
41 | select CPU_SH2 | 45 | select CPU_SH2 |
42 | 46 | ||
47 | config CPU_SUBTYPE_SH7619 | ||
48 | bool "Support SH7619 processor" | ||
49 | select CPU_SH2 | ||
50 | |||
51 | comment "SH-2A Processor Support" | ||
52 | |||
53 | config CPU_SUBTYPE_SH7206 | ||
54 | bool "Support SH7206 processor" | ||
55 | select CPU_SH2A | ||
56 | |||
43 | comment "SH-3 Processor Support" | 57 | comment "SH-3 Processor Support" |
44 | 58 | ||
45 | config CPU_SUBTYPE_SH7300 | 59 | config CPU_SUBTYPE_SH7300 |
@@ -274,7 +288,6 @@ config SH_DIRECT_MAPPED | |||
274 | 288 | ||
275 | config SH_WRITETHROUGH | 289 | config SH_WRITETHROUGH |
276 | bool "Use write-through caching" | 290 | bool "Use write-through caching" |
277 | default y if CPU_SH2 | ||
278 | help | 291 | help |
279 | Selecting this option will configure the caches in write-through | 292 | Selecting this option will configure the caches in write-through |
280 | mode, as opposed to the default write-back configuration. | 293 | mode, as opposed to the default write-back configuration. |
diff --git a/arch/sh/mm/cache-sh2.c b/arch/sh/mm/cache-sh2.c index 2689cb24ea2b..6614033f6be9 100644 --- a/arch/sh/mm/cache-sh2.c +++ b/arch/sh/mm/cache-sh2.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Released under the terms of the GNU GPL v2.0. | 6 | * Released under the terms of the GNU GPL v2.0. |
7 | */ | 7 | */ |
8 | |||
8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
9 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
10 | 11 | ||
@@ -14,37 +15,43 @@ | |||
14 | #include <asm/cacheflush.h> | 15 | #include <asm/cacheflush.h> |
15 | #include <asm/io.h> | 16 | #include <asm/io.h> |
16 | 17 | ||
17 | /* | 18 | void __flush_wback_region(void *start, int size) |
18 | * Calculate the OC address and set the way bit on the SH-2. | ||
19 | * | ||
20 | * We must have already jump_to_P2()'ed prior to calling this | ||
21 | * function, since we rely on CCR manipulation to do the | ||
22 | * Right Thing(tm). | ||
23 | */ | ||
24 | unsigned long __get_oc_addr(unsigned long set, unsigned long way) | ||
25 | { | 19 | { |
26 | unsigned long ccr; | 20 | unsigned long v; |
27 | 21 | unsigned long begin, end; | |
28 | /* | 22 | |
29 | * On SH-2 the way bit isn't tracked in the address field | 23 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); |
30 | * if we're doing address array access .. instead, we need | 24 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) |
31 | * to manually switch out the way in the CCR. | 25 | & ~(L1_CACHE_BYTES-1); |
32 | */ | 26 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { |
33 | ccr = ctrl_inl(CCR); | 27 | /* FIXME cache purge */ |
34 | ccr &= ~0x00c0; | 28 | ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); |
35 | ccr |= way << cpu_data->dcache.way_shift; | 29 | } |
36 | 30 | } | |
37 | /* | 31 | |
38 | * Despite the number of sets being halved, we end up losing | 32 | void __flush_purge_region(void *start, int size) |
39 | * the first 2 ways to OCRAM instead of the last 2 (if we're | 33 | { |
40 | * 4-way). As a result, forcibly setting the W1 bit handily | 34 | unsigned long v; |
41 | * bumps us up 2 ways. | 35 | unsigned long begin, end; |
42 | */ | 36 | |
43 | if (ccr & CCR_CACHE_ORA) | 37 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); |
44 | ccr |= 1 << (cpu_data->dcache.way_shift + 1); | 38 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) |
45 | 39 | & ~(L1_CACHE_BYTES-1); | |
46 | ctrl_outl(ccr, CCR); | 40 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { |
47 | 41 | ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); | |
48 | return CACHE_OC_ADDRESS_ARRAY | (set << cpu_data->dcache.entry_shift); | 42 | } |
43 | } | ||
44 | |||
45 | void __flush_invalidate_region(void *start, int size) | ||
46 | { | ||
47 | unsigned long v; | ||
48 | unsigned long begin, end; | ||
49 | |||
50 | begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); | ||
51 | end = ((unsigned long)start + size + L1_CACHE_BYTES-1) | ||
52 | & ~(L1_CACHE_BYTES-1); | ||
53 | for (v = begin; v < end; v+=L1_CACHE_BYTES) { | ||
54 | ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); | ||
55 | } | ||
49 | } | 56 | } |
50 | 57 | ||