diff options
author | Hyok S. Choi <hyok.choi@samsung.com> | 2006-09-26 04:36:37 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-27 12:34:30 -0400 |
commit | f12d0d7c7786af39435ef6ae9defe47fb58f6091 (patch) | |
tree | 03361f2b925754f2acf4f311df2122f844d3d4fe /arch/arm | |
parent | fefdaa06ccdde394be865ed76509be82813e425b (diff) |
[ARM] nommu: manage the CP15 things
All the current CP15 access codes in ARM arch can be categorized and
conditioned by the defines as follows:
Related operation Safe condition
a. any CP15 access !CPU_CP15
b. alignment trap CPU_CP15_MMU
c. D-cache(C-bit) CPU_CP15
d. I-cache CPU_CP15 && !( CPU_ARM610 || CPU_ARM710 ||
CPU_ARM720 || CPU_ARM740 ||
CPU_XSCALE || CPU_XSC3 )
e. alternate vector CPU_CP15 && !CPU_ARM740
f. TTB CPU_CP15_MMU
g. Domain CPU_CP15_MMU
h. FSR/FAR CPU_CP15_MMU
For example, alternate vector is supported if and only if
"CPU_CP15 && !CPU_ARM740" is satisfied.
Signed-off-by: Hyok S. Choi <hyok.choi@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/Kconfig-nommu | 8 | ||||
-rw-r--r-- | arch/arm/boot/compressed/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/boot/compressed/head.S | 6 | ||||
-rw-r--r-- | arch/arm/kernel/head-nommu.S | 7 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 22 | ||||
-rw-r--r-- | arch/arm/mm/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mm/cache-v4.S | 10 |
8 files changed, 56 insertions, 12 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 0810d27c039e..2673fee3281c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -621,6 +621,7 @@ config LEDS_CPU | |||
621 | 621 | ||
622 | config ALIGNMENT_TRAP | 622 | config ALIGNMENT_TRAP |
623 | bool | 623 | bool |
624 | depends on CPU_CP15_MMU | ||
624 | default y if !ARCH_EBSA110 | 625 | default y if !ARCH_EBSA110 |
625 | help | 626 | help |
626 | ARM processors can not fetch/store information which is not | 627 | ARM processors can not fetch/store information which is not |
@@ -852,7 +853,7 @@ source "drivers/base/Kconfig" | |||
852 | 853 | ||
853 | source "drivers/connector/Kconfig" | 854 | source "drivers/connector/Kconfig" |
854 | 855 | ||
855 | if ALIGNMENT_TRAP | 856 | if ALIGNMENT_TRAP || !CPU_CP15_MMU |
856 | source "drivers/mtd/Kconfig" | 857 | source "drivers/mtd/Kconfig" |
857 | endif | 858 | endif |
858 | 859 | ||
diff --git a/arch/arm/Kconfig-nommu b/arch/arm/Kconfig-nommu index e1574be2ded6..f087376748d1 100644 --- a/arch/arm/Kconfig-nommu +++ b/arch/arm/Kconfig-nommu | |||
@@ -25,6 +25,14 @@ config FLASH_SIZE | |||
25 | hex 'FLASH Size' if SET_MEM_PARAM | 25 | hex 'FLASH Size' if SET_MEM_PARAM |
26 | default 0x00400000 | 26 | default 0x00400000 |
27 | 27 | ||
28 | config PROCESSOR_ID | ||
29 | hex | ||
30 | default 0x00007700 | ||
31 | depends on !CPU_CP15 | ||
32 | help | ||
33 | If processor has no CP15 register, this processor ID is | ||
34 | used instead of the auto-probing which utilizes the register. | ||
35 | |||
28 | config REMAP_VECTORS_TO_RAM | 36 | config REMAP_VECTORS_TO_RAM |
29 | bool 'Install vectors to the begining of RAM' if DRAM_BASE | 37 | bool 'Install vectors to the begining of RAM' if DRAM_BASE |
30 | depends on DRAM_BASE | 38 | depends on DRAM_BASE |
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 2adc1527e0eb..adddc7131685 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
@@ -51,7 +51,11 @@ OBJS += head-at91rm9200.o | |||
51 | endif | 51 | endif |
52 | 52 | ||
53 | ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) | 53 | ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) |
54 | ifeq ($(CONFIG_CPU_CP15),y) | ||
54 | OBJS += big-endian.o | 55 | OBJS += big-endian.o |
56 | else | ||
57 | # The endian should be set by h/w design. | ||
58 | endif | ||
55 | endif | 59 | endif |
56 | 60 | ||
57 | # | 61 | # |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 75df1f764a10..e5ab51b9cceb 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -82,9 +82,11 @@ | |||
82 | kphex r6, 8 /* processor id */ | 82 | kphex r6, 8 /* processor id */ |
83 | kputc #':' | 83 | kputc #':' |
84 | kphex r7, 8 /* architecture id */ | 84 | kphex r7, 8 /* architecture id */ |
85 | #ifdef CONFIG_CPU_CP15 | ||
85 | kputc #':' | 86 | kputc #':' |
86 | mrc p15, 0, r0, c1, c0 | 87 | mrc p15, 0, r0, c1, c0 |
87 | kphex r0, 8 /* control reg */ | 88 | kphex r0, 8 /* control reg */ |
89 | #endif | ||
88 | kputc #'\n' | 90 | kputc #'\n' |
89 | kphex r5, 8 /* decompressed kernel start */ | 91 | kphex r5, 8 /* decompressed kernel start */ |
90 | kputc #'-' | 92 | kputc #'-' |
@@ -507,7 +509,11 @@ call_kernel: bl cache_clean_flush | |||
507 | */ | 509 | */ |
508 | 510 | ||
509 | call_cache_fn: adr r12, proc_types | 511 | call_cache_fn: adr r12, proc_types |
512 | #ifdef CONFIG_CPU_CP15 | ||
510 | mrc p15, 0, r6, c0, c0 @ get processor ID | 513 | mrc p15, 0, r6, c0, c0 @ get processor ID |
514 | #else | ||
515 | ldr r6, =CONFIG_PROCESSOR_ID | ||
516 | #endif | ||
511 | 1: ldr r1, [r12, #0] @ get value | 517 | 1: ldr r1, [r12, #0] @ get value |
512 | ldr r2, [r12, #4] @ get mask | 518 | ldr r2, [r12, #4] @ get mask |
513 | eor r1, r1, r6 @ (real ^ match) | 519 | eor r1, r1, r6 @ (real ^ match) |
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index ac9eb3d30518..698a537915dd 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
@@ -9,7 +9,6 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | * | 10 | * |
11 | * Common kernel startup code (non-paged MM) | 11 | * Common kernel startup code (non-paged MM) |
12 | * for 32-bit CPUs which has a process ID register(CP15). | ||
13 | * | 12 | * |
14 | */ | 13 | */ |
15 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
@@ -40,7 +39,11 @@ | |||
40 | ENTRY(stext) | 39 | ENTRY(stext) |
41 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode | 40 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode |
42 | @ and irqs disabled | 41 | @ and irqs disabled |
42 | #ifndef CONFIG_CPU_CP15 | ||
43 | ldr r9, =CONFIG_PROCESSOR_ID | ||
44 | #else | ||
43 | mrc p15, 0, r9, c0, c0 @ get processor id | 45 | mrc p15, 0, r9, c0, c0 @ get processor id |
46 | #endif | ||
44 | bl __lookup_processor_type @ r5=procinfo r9=cpuid | 47 | bl __lookup_processor_type @ r5=procinfo r9=cpuid |
45 | movs r10, r5 @ invalid processor (r5=0)? | 48 | movs r10, r5 @ invalid processor (r5=0)? |
46 | beq __error_p @ yes, error 'p' | 49 | beq __error_p @ yes, error 'p' |
@@ -58,6 +61,7 @@ ENTRY(stext) | |||
58 | */ | 61 | */ |
59 | .type __after_proc_init, %function | 62 | .type __after_proc_init, %function |
60 | __after_proc_init: | 63 | __after_proc_init: |
64 | #ifdef CONFIG_CPU_CP15 | ||
61 | mrc p15, 0, r0, c1, c0, 0 @ read control reg | 65 | mrc p15, 0, r0, c1, c0, 0 @ read control reg |
62 | #ifdef CONFIG_ALIGNMENT_TRAP | 66 | #ifdef CONFIG_ALIGNMENT_TRAP |
63 | orr r0, r0, #CR_A | 67 | orr r0, r0, #CR_A |
@@ -74,6 +78,7 @@ __after_proc_init: | |||
74 | bic r0, r0, #CR_I | 78 | bic r0, r0, #CR_I |
75 | #endif | 79 | #endif |
76 | mcr p15, 0, r0, c1, c0, 0 @ write control reg | 80 | mcr p15, 0, r0, c1, c0, 0 @ write control reg |
81 | #endif /* CONFIG_CPU_CP15 */ | ||
77 | 82 | ||
78 | mov pc, r13 @ clear the BSS and jump | 83 | mov pc, r13 @ clear the BSS and jump |
79 | @ to start_kernel | 84 | @ to start_kernel |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 3079535afccd..bf35c178a877 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -221,16 +221,26 @@ void __show_regs(struct pt_regs *regs) | |||
221 | processor_modes[processor_mode(regs)], | 221 | processor_modes[processor_mode(regs)], |
222 | thumb_mode(regs) ? " (T)" : "", | 222 | thumb_mode(regs) ? " (T)" : "", |
223 | get_fs() == get_ds() ? "kernel" : "user"); | 223 | get_fs() == get_ds() ? "kernel" : "user"); |
224 | #if CONFIG_CPU_CP15 | ||
224 | { | 225 | { |
225 | unsigned int ctrl, transbase, dac; | 226 | unsigned int ctrl; |
226 | __asm__ ( | 227 | __asm__ ( |
227 | " mrc p15, 0, %0, c1, c0\n" | 228 | " mrc p15, 0, %0, c1, c0\n" |
228 | " mrc p15, 0, %1, c2, c0\n" | 229 | : "=r" (ctrl)); |
229 | " mrc p15, 0, %2, c3, c0\n" | 230 | printk("Control: %04X\n", ctrl); |
230 | : "=r" (ctrl), "=r" (transbase), "=r" (dac)); | ||
231 | printk("Control: %04X Table: %08X DAC: %08X\n", | ||
232 | ctrl, transbase, dac); | ||
233 | } | 231 | } |
232 | #ifdef CONFIG_CPU_CP15_MMU | ||
233 | { | ||
234 | unsigned int transbase, dac; | ||
235 | __asm__ ( | ||
236 | " mrc p15, 0, %0, c2, c0\n" | ||
237 | " mrc p15, 0, %1, c3, c0\n" | ||
238 | : "=r" (transbase), "=r" (dac)); | ||
239 | printk("Table: %08X DAC: %08X\n", | ||
240 | transbase, dac); | ||
241 | } | ||
242 | #endif | ||
243 | #endif | ||
234 | } | 244 | } |
235 | 245 | ||
236 | void show_regs(struct pt_regs * regs) | 246 | void show_regs(struct pt_regs * regs) |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index c7fb835c148c..0ac11ea84508 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -445,15 +445,15 @@ config CPU_BIG_ENDIAN | |||
445 | of your chipset/board/processor. | 445 | of your chipset/board/processor. |
446 | 446 | ||
447 | config CPU_ICACHE_DISABLE | 447 | config CPU_ICACHE_DISABLE |
448 | bool "Disable I-Cache" | 448 | bool "Disable I-Cache (I-bit)" |
449 | depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_V6 | 449 | depends on CPU_CP15 && !(CPU_ARM610 || CPU_ARM710 || CPU_ARM720T || CPU_ARM740T || CPU_XSCALE || CPU_XSC3) |
450 | help | 450 | help |
451 | Say Y here to disable the processor instruction cache. Unless | 451 | Say Y here to disable the processor instruction cache. Unless |
452 | you have a reason not to or are unsure, say N. | 452 | you have a reason not to or are unsure, say N. |
453 | 453 | ||
454 | config CPU_DCACHE_DISABLE | 454 | config CPU_DCACHE_DISABLE |
455 | bool "Disable D-Cache" | 455 | bool "Disable D-Cache (C-bit)" |
456 | depends on CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM1020 || CPU_V6 | 456 | depends on CPU_CP15 |
457 | help | 457 | help |
458 | Say Y here to disable the processor data cache. Unless | 458 | Say Y here to disable the processor data cache. Unless |
459 | you have a reason not to or are unsure, say N. | 459 | you have a reason not to or are unsure, say N. |
diff --git a/arch/arm/mm/cache-v4.S b/arch/arm/mm/cache-v4.S index b8ad5d58ebe2..b2908063ed6a 100644 --- a/arch/arm/mm/cache-v4.S +++ b/arch/arm/mm/cache-v4.S | |||
@@ -29,9 +29,13 @@ ENTRY(v4_flush_user_cache_all) | |||
29 | * Clean and invalidate the entire cache. | 29 | * Clean and invalidate the entire cache. |
30 | */ | 30 | */ |
31 | ENTRY(v4_flush_kern_cache_all) | 31 | ENTRY(v4_flush_kern_cache_all) |
32 | #ifdef CPU_CP15 | ||
32 | mov r0, #0 | 33 | mov r0, #0 |
33 | mcr p15, 0, r0, c7, c7, 0 @ flush ID cache | 34 | mcr p15, 0, r0, c7, c7, 0 @ flush ID cache |
34 | mov pc, lr | 35 | mov pc, lr |
36 | #else | ||
37 | /* FALLTHROUGH */ | ||
38 | #endif | ||
35 | 39 | ||
36 | /* | 40 | /* |
37 | * flush_user_cache_range(start, end, flags) | 41 | * flush_user_cache_range(start, end, flags) |
@@ -44,9 +48,13 @@ ENTRY(v4_flush_kern_cache_all) | |||
44 | * - flags - vma_area_struct flags describing address space | 48 | * - flags - vma_area_struct flags describing address space |
45 | */ | 49 | */ |
46 | ENTRY(v4_flush_user_cache_range) | 50 | ENTRY(v4_flush_user_cache_range) |
51 | #ifdef CPU_CP15 | ||
47 | mov ip, #0 | 52 | mov ip, #0 |
48 | mcreq p15, 0, ip, c7, c7, 0 @ flush ID cache | 53 | mcreq p15, 0, ip, c7, c7, 0 @ flush ID cache |
49 | mov pc, lr | 54 | mov pc, lr |
55 | #else | ||
56 | /* FALLTHROUGH */ | ||
57 | #endif | ||
50 | 58 | ||
51 | /* | 59 | /* |
52 | * coherent_kern_range(start, end) | 60 | * coherent_kern_range(start, end) |
@@ -108,8 +116,10 @@ ENTRY(v4_dma_inv_range) | |||
108 | * - end - virtual end address | 116 | * - end - virtual end address |
109 | */ | 117 | */ |
110 | ENTRY(v4_dma_flush_range) | 118 | ENTRY(v4_dma_flush_range) |
119 | #ifdef CPU_CP15 | ||
111 | mov r0, #0 | 120 | mov r0, #0 |
112 | mcr p15, 0, r0, c7, c7, 0 @ flush ID cache | 121 | mcr p15, 0, r0, c7, c7, 0 @ flush ID cache |
122 | #endif | ||
113 | /* FALLTHROUGH */ | 123 | /* FALLTHROUGH */ |
114 | 124 | ||
115 | /* | 125 | /* |