diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-18 11:05:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-18 11:05:20 -0500 |
commit | 6a7f6ec9512970874fa9fc883ea44d77d0f287c2 (patch) | |
tree | 2bce1665b5a9e81bdd95f6e34410bdf13c58350e /arch/m68knommu/platform | |
parent | c6fa63c659b3dd121f21afe7529f505505e79b23 (diff) | |
parent | 4c65595ec506ff65c90b1d9fed17333005fa5eb5 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: (25 commits)
m68knommu: fix broken setting of irq_chip and handler
m68knommu: switch to using -mcpu= flags for ColdFire targets
m68knommu: arch/m68knommu/Kconfig whitespace cleanup
m68knommu: create optimal separate instruction and data cache for ColdFire
m68knommu: support ColdFire caches that do copyback and write-through
m68knommu: support version 2 ColdFire split cache
m68knommu: make cache push code ColdFire generic
m68knommu: clean up ColdFire cache control code
m68knommu: move inclusion of ColdFire v4 cache registers
m68knommu: merge bit definitions for version 3 ColdFire cache controller
m68knommu: create bit definitions for the version 2 ColdFire cache controller
m68knommu: remove empty __iounmap() it is no used
m68knommu: remove kernel_map() code, it is not used
m68knommu: remove do_page_fault(), it is not used
m68knommu: use user stack pointer hardware on some ColdFire cores
m68knommu: remove command line printing DEBUG
m68knommu: remove fasthandler interrupt code
m68knommu: move UART addressing to part specific includes
m68knommu: fix clock rate value reported for ColdFire 54xx parts
m68knommu: move ColdFire CPU names into their headers
...
Diffstat (limited to 'arch/m68knommu/platform')
-rw-r--r-- | arch/m68knommu/platform/54xx/Makefile (renamed from arch/m68knommu/platform/548x/Makefile) | 0 | ||||
-rw-r--r-- | arch/m68knommu/platform/54xx/config.c (renamed from arch/m68knommu/platform/548x/config.c) | 32 | ||||
-rw-r--r-- | arch/m68knommu/platform/68328/ints.c | 4 | ||||
-rw-r--r-- | arch/m68knommu/platform/coldfire/Makefile | 4 | ||||
-rw-r--r-- | arch/m68knommu/platform/coldfire/cache.c | 48 | ||||
-rw-r--r-- | arch/m68knommu/platform/coldfire/entry.S | 56 | ||||
-rw-r--r-- | arch/m68knommu/platform/coldfire/head.S | 26 |
7 files changed, 99 insertions, 71 deletions
diff --git a/arch/m68knommu/platform/548x/Makefile b/arch/m68knommu/platform/54xx/Makefile index e6035e7a2d3f..e6035e7a2d3f 100644 --- a/arch/m68knommu/platform/548x/Makefile +++ b/arch/m68knommu/platform/54xx/Makefile | |||
diff --git a/arch/m68knommu/platform/548x/config.c b/arch/m68knommu/platform/54xx/config.c index 9888846bd1cf..78130984db95 100644 --- a/arch/m68knommu/platform/548x/config.c +++ b/arch/m68knommu/platform/54xx/config.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /***************************************************************************/ | 1 | /***************************************************************************/ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * linux/arch/m68knommu/platform/548x/config.c | 4 | * linux/arch/m68knommu/platform/54xx/config.c |
5 | * | 5 | * |
6 | * Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be> | 6 | * Copyright (C) 2010, Philippe De Muyter <phdm@macqel.be> |
7 | */ | 7 | */ |
@@ -15,13 +15,13 @@ | |||
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/machdep.h> | 16 | #include <asm/machdep.h> |
17 | #include <asm/coldfire.h> | 17 | #include <asm/coldfire.h> |
18 | #include <asm/m548xsim.h> | 18 | #include <asm/m54xxsim.h> |
19 | #include <asm/mcfuart.h> | 19 | #include <asm/mcfuart.h> |
20 | #include <asm/m548xgpt.h> | 20 | #include <asm/m54xxgpt.h> |
21 | 21 | ||
22 | /***************************************************************************/ | 22 | /***************************************************************************/ |
23 | 23 | ||
24 | static struct mcf_platform_uart m548x_uart_platform[] = { | 24 | static struct mcf_platform_uart m54xx_uart_platform[] = { |
25 | { | 25 | { |
26 | .mapbase = MCF_MBAR + MCFUART_BASE1, | 26 | .mapbase = MCF_MBAR + MCFUART_BASE1, |
27 | .irq = 64 + 35, | 27 | .irq = 64 + 35, |
@@ -40,20 +40,20 @@ static struct mcf_platform_uart m548x_uart_platform[] = { | |||
40 | }, | 40 | }, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | static struct platform_device m548x_uart = { | 43 | static struct platform_device m54xx_uart = { |
44 | .name = "mcfuart", | 44 | .name = "mcfuart", |
45 | .id = 0, | 45 | .id = 0, |
46 | .dev.platform_data = m548x_uart_platform, | 46 | .dev.platform_data = m54xx_uart_platform, |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static struct platform_device *m548x_devices[] __initdata = { | 49 | static struct platform_device *m54xx_devices[] __initdata = { |
50 | &m548x_uart, | 50 | &m54xx_uart, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | 53 | ||
54 | /***************************************************************************/ | 54 | /***************************************************************************/ |
55 | 55 | ||
56 | static void __init m548x_uart_init_line(int line, int irq) | 56 | static void __init m54xx_uart_init_line(int line, int irq) |
57 | { | 57 | { |
58 | int rts_cts; | 58 | int rts_cts; |
59 | 59 | ||
@@ -72,18 +72,18 @@ static void __init m548x_uart_init_line(int line, int irq) | |||
72 | MCF_MBAR + MCF_PAR_PSC(line)); | 72 | MCF_MBAR + MCF_PAR_PSC(line)); |
73 | } | 73 | } |
74 | 74 | ||
75 | static void __init m548x_uarts_init(void) | 75 | static void __init m54xx_uarts_init(void) |
76 | { | 76 | { |
77 | const int nrlines = ARRAY_SIZE(m548x_uart_platform); | 77 | const int nrlines = ARRAY_SIZE(m54xx_uart_platform); |
78 | int line; | 78 | int line; |
79 | 79 | ||
80 | for (line = 0; (line < nrlines); line++) | 80 | for (line = 0; (line < nrlines); line++) |
81 | m548x_uart_init_line(line, m548x_uart_platform[line].irq); | 81 | m54xx_uart_init_line(line, m54xx_uart_platform[line].irq); |
82 | } | 82 | } |
83 | 83 | ||
84 | /***************************************************************************/ | 84 | /***************************************************************************/ |
85 | 85 | ||
86 | static void mcf548x_reset(void) | 86 | static void mcf54xx_reset(void) |
87 | { | 87 | { |
88 | /* disable interrupts and enable the watchdog */ | 88 | /* disable interrupts and enable the watchdog */ |
89 | asm("movew #0x2700, %sr\n"); | 89 | asm("movew #0x2700, %sr\n"); |
@@ -97,8 +97,8 @@ static void mcf548x_reset(void) | |||
97 | 97 | ||
98 | void __init config_BSP(char *commandp, int size) | 98 | void __init config_BSP(char *commandp, int size) |
99 | { | 99 | { |
100 | mach_reset = mcf548x_reset; | 100 | mach_reset = mcf54xx_reset; |
101 | m548x_uarts_init(); | 101 | m54xx_uarts_init(); |
102 | } | 102 | } |
103 | 103 | ||
104 | /***************************************************************************/ | 104 | /***************************************************************************/ |
@@ -106,7 +106,7 @@ void __init config_BSP(char *commandp, int size) | |||
106 | static int __init init_BSP(void) | 106 | static int __init init_BSP(void) |
107 | { | 107 | { |
108 | 108 | ||
109 | platform_add_devices(m548x_devices, ARRAY_SIZE(m548x_devices)); | 109 | platform_add_devices(m54xx_devices, ARRAY_SIZE(m54xx_devices)); |
110 | return 0; | 110 | return 0; |
111 | } | 111 | } |
112 | 112 | ||
diff --git a/arch/m68knommu/platform/68328/ints.c b/arch/m68knommu/platform/68328/ints.c index 865852806a17..2a3af193ccd3 100644 --- a/arch/m68knommu/platform/68328/ints.c +++ b/arch/m68knommu/platform/68328/ints.c | |||
@@ -179,8 +179,8 @@ void __init init_IRQ(void) | |||
179 | IMR = ~0; | 179 | IMR = ~0; |
180 | 180 | ||
181 | for (i = 0; (i < NR_IRQS); i++) { | 181 | for (i = 0; (i < NR_IRQS); i++) { |
182 | set_irq_chip(irq, &intc_irq_chip); | 182 | set_irq_chip(i, &intc_irq_chip); |
183 | set_irq_handler(irq, handle_level_irq); | 183 | set_irq_handler(i, handle_level_irq); |
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
diff --git a/arch/m68knommu/platform/coldfire/Makefile b/arch/m68knommu/platform/coldfire/Makefile index 45f501fa4525..a8967baabd72 100644 --- a/arch/m68knommu/platform/coldfire/Makefile +++ b/arch/m68knommu/platform/coldfire/Makefile | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 | 15 | asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 |
16 | 16 | ||
17 | obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o | 17 | obj-$(CONFIG_COLDFIRE) += cache.o clk.o dma.o entry.o vectors.o |
18 | obj-$(CONFIG_M5206) += timers.o intc.o | 18 | obj-$(CONFIG_M5206) += timers.o intc.o |
19 | obj-$(CONFIG_M5206e) += timers.o intc.o | 19 | obj-$(CONFIG_M5206e) += timers.o intc.o |
20 | obj-$(CONFIG_M520x) += pit.o intc-simr.o | 20 | obj-$(CONFIG_M520x) += pit.o intc-simr.o |
@@ -26,7 +26,7 @@ obj-$(CONFIG_M528x) += pit.o intc-2.o | |||
26 | obj-$(CONFIG_M5307) += timers.o intc.o | 26 | obj-$(CONFIG_M5307) += timers.o intc.o |
27 | obj-$(CONFIG_M532x) += timers.o intc-simr.o | 27 | obj-$(CONFIG_M532x) += timers.o intc-simr.o |
28 | obj-$(CONFIG_M5407) += timers.o intc.o | 28 | obj-$(CONFIG_M5407) += timers.o intc.o |
29 | obj-$(CONFIG_M548x) += sltimers.o intc-2.o | 29 | obj-$(CONFIG_M54xx) += sltimers.o intc-2.o |
30 | 30 | ||
31 | obj-y += pinmux.o gpio.o | 31 | obj-y += pinmux.o gpio.o |
32 | extra-y := head.o | 32 | extra-y := head.o |
diff --git a/arch/m68knommu/platform/coldfire/cache.c b/arch/m68knommu/platform/coldfire/cache.c new file mode 100644 index 000000000000..235d3c4f4f0f --- /dev/null +++ b/arch/m68knommu/platform/coldfire/cache.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /***************************************************************************/ | ||
2 | |||
3 | /* | ||
4 | * cache.c -- general ColdFire Cache maintainence code | ||
5 | * | ||
6 | * Copyright (C) 2010, Greg Ungerer (gerg@snapgear.com) | ||
7 | */ | ||
8 | |||
9 | /***************************************************************************/ | ||
10 | |||
11 | #include <linux/kernel.h> | ||
12 | #include <asm/coldfire.h> | ||
13 | #include <asm/mcfsim.h> | ||
14 | |||
15 | /***************************************************************************/ | ||
16 | #ifdef CACHE_PUSH | ||
17 | /***************************************************************************/ | ||
18 | |||
19 | /* | ||
20 | * Use cpushl to push all dirty cache lines back to memory. | ||
21 | * Older versions of GAS don't seem to know how to generate the | ||
22 | * ColdFire cpushl instruction... Oh well, bit stuff it for now. | ||
23 | */ | ||
24 | |||
25 | void mcf_cache_push(void) | ||
26 | { | ||
27 | __asm__ __volatile__ ( | ||
28 | "clrl %%d0\n\t" | ||
29 | "1:\n\t" | ||
30 | "movel %%d0,%%a0\n\t" | ||
31 | "2:\n\t" | ||
32 | ".word 0xf468\n\t" | ||
33 | "addl %0,%%a0\n\t" | ||
34 | "cmpl %1,%%a0\n\t" | ||
35 | "blt 2b\n\t" | ||
36 | "addql #1,%%d0\n\t" | ||
37 | "cmpil %2,%%d0\n\t" | ||
38 | "bne 1b\n\t" | ||
39 | : /* No output */ | ||
40 | : "i" (CACHE_LINE_SIZE), | ||
41 | "i" (DCACHE_SIZE / CACHE_WAYS), | ||
42 | "i" (CACHE_WAYS) | ||
43 | : "d0", "a0" ); | ||
44 | } | ||
45 | |||
46 | /***************************************************************************/ | ||
47 | #endif /* CACHE_PUSH */ | ||
48 | /***************************************************************************/ | ||
diff --git a/arch/m68knommu/platform/coldfire/entry.S b/arch/m68knommu/platform/coldfire/entry.S index e1debc8285ef..4ddfc3da70d8 100644 --- a/arch/m68knommu/platform/coldfire/entry.S +++ b/arch/m68knommu/platform/coldfire/entry.S | |||
@@ -36,13 +36,16 @@ | |||
36 | #include <asm/asm-offsets.h> | 36 | #include <asm/asm-offsets.h> |
37 | #include <asm/entry.h> | 37 | #include <asm/entry.h> |
38 | 38 | ||
39 | #ifdef CONFIG_COLDFIRE_SW_A7 | ||
40 | /* | ||
41 | * Define software copies of the supervisor and user stack pointers. | ||
42 | */ | ||
39 | .bss | 43 | .bss |
40 | |||
41 | sw_ksp: | 44 | sw_ksp: |
42 | .long 0 | 45 | .long 0 |
43 | |||
44 | sw_usp: | 46 | sw_usp: |
45 | .long 0 | 47 | .long 0 |
48 | #endif /* CONFIG_COLDFIRE_SW_A7 */ | ||
46 | 49 | ||
47 | .text | 50 | .text |
48 | 51 | ||
@@ -51,7 +54,6 @@ sw_usp: | |||
51 | .globl ret_from_exception | 54 | .globl ret_from_exception |
52 | .globl ret_from_signal | 55 | .globl ret_from_signal |
53 | .globl sys_call_table | 56 | .globl sys_call_table |
54 | .globl ret_from_interrupt | ||
55 | .globl inthandler | 57 | .globl inthandler |
56 | .globl fasthandler | 58 | .globl fasthandler |
57 | 59 | ||
@@ -140,20 +142,7 @@ Luser_return: | |||
140 | jne Lwork_to_do /* still work to do */ | 142 | jne Lwork_to_do /* still work to do */ |
141 | 143 | ||
142 | Lreturn: | 144 | Lreturn: |
143 | move #0x2700,%sr /* disable intrs */ | 145 | RESTORE_USER |
144 | movel sw_usp,%a0 /* get usp */ | ||
145 | movel %sp@(PT_OFF_PC),%a0@- /* copy exception program counter */ | ||
146 | movel %sp@(PT_OFF_FORMATVEC),%a0@- /* copy exception format/vector/sr */ | ||
147 | moveml %sp@,%d1-%d5/%a0-%a2 | ||
148 | lea %sp@(32),%sp /* space for 8 regs */ | ||
149 | movel %sp@+,%d0 | ||
150 | addql #4,%sp /* orig d0 */ | ||
151 | addl %sp@+,%sp /* stk adj */ | ||
152 | addql #8,%sp /* remove exception */ | ||
153 | movel %sp,sw_ksp /* save ksp */ | ||
154 | subql #8,sw_usp /* set exception */ | ||
155 | movel sw_usp,%sp /* restore usp */ | ||
156 | rte | ||
157 | 146 | ||
158 | Lwork_to_do: | 147 | Lwork_to_do: |
159 | movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */ | 148 | movel %a0@(TI_FLAGS),%d1 /* get thread_info->flags */ |
@@ -191,31 +180,7 @@ ENTRY(inthandler) | |||
191 | jbsr do_IRQ /* call high level irq handler */ | 180 | jbsr do_IRQ /* call high level irq handler */ |
192 | lea %sp@(8),%sp /* pop args off stack */ | 181 | lea %sp@(8),%sp /* pop args off stack */ |
193 | 182 | ||
194 | bra ret_from_interrupt /* this was fallthrough */ | 183 | bra ret_from_exception |
195 | |||
196 | /* | ||
197 | * This is the fast interrupt handler (for certain hardware interrupt | ||
198 | * sources). Unlike the normal interrupt handler it just uses the | ||
199 | * current stack (doesn't care if it is user or kernel). It also | ||
200 | * doesn't bother doing the bottom half handlers. | ||
201 | */ | ||
202 | ENTRY(fasthandler) | ||
203 | SAVE_LOCAL | ||
204 | |||
205 | movew %sp@(PT_OFF_FORMATVEC),%d0 | ||
206 | andl #0x03fc,%d0 /* mask out vector only */ | ||
207 | |||
208 | movel %sp,%sp@- /* push regs arg */ | ||
209 | lsrl #2,%d0 /* calculate real vector # */ | ||
210 | movel %d0,%sp@- /* push vector number */ | ||
211 | jbsr do_IRQ /* call high level irq handler */ | ||
212 | lea %sp@(8),%sp /* pop args off stack */ | ||
213 | |||
214 | RESTORE_LOCAL | ||
215 | |||
216 | ENTRY(ret_from_interrupt) | ||
217 | /* the fasthandler is confusing me, haven't seen any user */ | ||
218 | jmp ret_from_exception | ||
219 | 184 | ||
220 | /* | 185 | /* |
221 | * Beware - when entering resume, prev (the current task) is | 186 | * Beware - when entering resume, prev (the current task) is |
@@ -226,9 +191,8 @@ ENTRY(ret_from_interrupt) | |||
226 | */ | 191 | */ |
227 | ENTRY(resume) | 192 | ENTRY(resume) |
228 | movel %a0, %d1 /* get prev thread in d1 */ | 193 | movel %a0, %d1 /* get prev thread in d1 */ |
229 | 194 | RDUSP | |
230 | movel sw_usp,%d0 /* save usp */ | 195 | movel %a2,%a0@(TASK_THREAD+THREAD_USP) |
231 | movel %d0,%a0@(TASK_THREAD+THREAD_USP) | ||
232 | 196 | ||
233 | SAVE_SWITCH_STACK | 197 | SAVE_SWITCH_STACK |
234 | movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */ | 198 | movel %sp,%a0@(TASK_THREAD+THREAD_KSP) /* save kernel stack pointer */ |
@@ -236,5 +200,5 @@ ENTRY(resume) | |||
236 | RESTORE_SWITCH_STACK | 200 | RESTORE_SWITCH_STACK |
237 | 201 | ||
238 | movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ | 202 | movel %a1@(TASK_THREAD+THREAD_USP),%a0 /* restore thread user stack */ |
239 | movel %a0, sw_usp | 203 | WRUSP |
240 | rts | 204 | rts |
diff --git a/arch/m68knommu/platform/coldfire/head.S b/arch/m68knommu/platform/coldfire/head.S index 0b2d7c7adf79..d5977909ae5f 100644 --- a/arch/m68knommu/platform/coldfire/head.S +++ b/arch/m68knommu/platform/coldfire/head.S | |||
@@ -3,7 +3,7 @@ | |||
3 | /* | 3 | /* |
4 | * head.S -- common startup code for ColdFire CPUs. | 4 | * head.S -- common startup code for ColdFire CPUs. |
5 | * | 5 | * |
6 | * (C) Copyright 1999-2006, Greg Ungerer <gerg@snapgear.com>. | 6 | * (C) Copyright 1999-2010, Greg Ungerer <gerg@snapgear.com>. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /*****************************************************************************/ | 9 | /*****************************************************************************/ |
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <asm/asm-offsets.h> | 14 | #include <asm/asm-offsets.h> |
15 | #include <asm/coldfire.h> | 15 | #include <asm/coldfire.h> |
16 | #include <asm/mcfcache.h> | ||
17 | #include <asm/mcfsim.h> | 16 | #include <asm/mcfsim.h> |
18 | #include <asm/thread_info.h> | 17 | #include <asm/thread_info.h> |
19 | 18 | ||
@@ -173,10 +172,27 @@ _start: | |||
173 | 172 | ||
174 | /* | 173 | /* |
175 | * Now that we know what the memory is, lets enable cache | 174 | * Now that we know what the memory is, lets enable cache |
176 | * and get things moving. This is Coldfire CPU specific. | 175 | * and get things moving. This is Coldfire CPU specific. Not |
176 | * all version cores have identical cache register setup. But | ||
177 | * it is very similar. Define the exact settings in the headers | ||
178 | * then the code here is the same for all. | ||
177 | */ | 179 | */ |
178 | CACHE_ENABLE /* enable CPU cache */ | 180 | movel #CACHE_INIT,%d0 /* invalidate whole cache */ |
179 | 181 | movec %d0,%CACR | |
182 | nop | ||
183 | movel #ACR0_MODE,%d0 /* set RAM region for caching */ | ||
184 | movec %d0,%ACR0 | ||
185 | movel #ACR1_MODE,%d0 /* anything else to cache? */ | ||
186 | movec %d0,%ACR1 | ||
187 | #ifdef ACR2_MODE | ||
188 | movel #ACR2_MODE,%d0 | ||
189 | movec %d0,%ACR2 | ||
190 | movel #ACR3_MODE,%d0 | ||
191 | movec %d0,%ACR3 | ||
192 | #endif | ||
193 | movel #CACHE_MODE,%d0 /* enable cache */ | ||
194 | movec %d0,%CACR | ||
195 | nop | ||
180 | 196 | ||
181 | #ifdef CONFIG_ROMFS_FS | 197 | #ifdef CONFIG_ROMFS_FS |
182 | /* | 198 | /* |