aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-05 21:18:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-05 21:18:20 -0400
commita6930aaee06755d1bdcfd943fbf614e4d92bb0c7 (patch)
tree488c83b9a888d967a7b8e31750e9295fc09bc9c3 /arch/m68k
parentd8ea757b25ec82687c497fc90aa83f9bcea24b5b (diff)
parent742859adc721da65ff4e8b59412d73bd3d2a57fe (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu
Pull m68knommu updates from Greg Ungerer: "The bulk of the changes here are to clean up the ColdFire 5441x SoC support so that it can run with MMU enabled. We have only supported it with MMU disabled up to now. There is also a few individual bug fixes across the ColdFire support code" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu: m68k: let clk_disable() return immediately if clk is NULL m68knommu: convert printk(KERN_INFO) to pr_info() m68knommu: clean up uClinux boot log output m68k: generalize uboot command line support m68k: don't panic if no hardware FPU defined m68k: only generate FPU instructions if CONFIG_FPU enabled m68k: always make available dump_fpu() m68k: generalize io memory region setup for ColdFire ACR registers m68k: move ColdFire _bootmem_alloc code m68k: report correct FPU type on ColdFire MMU platforms m68k: set appropriate machine type for m5411x SoC platforms m68k: move CONFIG_FPU set to per-CPU configuration m68knommu: fix IO write size in nettel pin set m68knommu: switch to using IO access methods in WildFire board code m68knommu: fix early setup to not access variables
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/Kconfig1
-rw-r--r--arch/m68k/Kconfig.cpu6
-rw-r--r--arch/m68k/coldfire/clk.c4
-rw-r--r--arch/m68k/coldfire/head.S8
-rw-r--r--arch/m68k/coldfire/m528x.c8
-rw-r--r--arch/m68k/coldfire/m53xx.c8
-rw-r--r--arch/m68k/coldfire/m54xx.c40
-rw-r--r--arch/m68k/include/asm/bootinfo.h6
-rw-r--r--arch/m68k/include/asm/m5441xsim.h4
-rw-r--r--arch/m68k/include/asm/m54xxacr.h2
-rw-r--r--arch/m68k/include/asm/m54xxsim.h4
-rw-r--r--arch/m68k/include/asm/mcfmmu.h1
-rw-r--r--arch/m68k/include/asm/nettel.h2
-rw-r--r--arch/m68k/include/uapi/asm/bootinfo.h1
-rw-r--r--arch/m68k/kernel/Makefile1
-rw-r--r--arch/m68k/kernel/process.c56
-rw-r--r--arch/m68k/kernel/setup_mm.c6
-rw-r--r--arch/m68k/kernel/setup_no.c103
-rw-r--r--arch/m68k/kernel/uboot.c107
-rw-r--r--arch/m68k/mm/mcfmmu.c31
20 files changed, 222 insertions, 177 deletions
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 498b567f007b..d140206d5d29 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -14,7 +14,6 @@ config M68K
14 select GENERIC_IOMAP 14 select GENERIC_IOMAP
15 select GENERIC_STRNCPY_FROM_USER if MMU 15 select GENERIC_STRNCPY_FROM_USER if MMU
16 select GENERIC_STRNLEN_USER if MMU 16 select GENERIC_STRNLEN_USER if MMU
17 select FPU if MMU
18 select ARCH_WANT_IPC_PARSE_VERSION 17 select ARCH_WANT_IPC_PARSE_VERSION
19 select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE 18 select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE
20 select HAVE_FUTEX_CMPXCHG if MMU && FUTEX 19 select HAVE_FUTEX_CMPXCHG if MMU && FUTEX
diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index 967260f2eb1c..d2219f30b78f 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -62,6 +62,7 @@ config MCPU32
62config M68020 62config M68020
63 bool "68020 support" 63 bool "68020 support"
64 depends on MMU 64 depends on MMU
65 select FPU
65 select CPU_HAS_ADDRESS_SPACES 66 select CPU_HAS_ADDRESS_SPACES
66 help 67 help
67 If you anticipate running this kernel on a computer with a MC68020 68 If you anticipate running this kernel on a computer with a MC68020
@@ -72,6 +73,7 @@ config M68020
72config M68030 73config M68030
73 bool "68030 support" 74 bool "68030 support"
74 depends on MMU && !MMU_SUN3 75 depends on MMU && !MMU_SUN3
76 select FPU
75 select CPU_HAS_ADDRESS_SPACES 77 select CPU_HAS_ADDRESS_SPACES
76 help 78 help
77 If you anticipate running this kernel on a computer with a MC68030 79 If you anticipate running this kernel on a computer with a MC68030
@@ -81,6 +83,7 @@ config M68030
81config M68040 83config M68040
82 bool "68040 support" 84 bool "68040 support"
83 depends on MMU && !MMU_SUN3 85 depends on MMU && !MMU_SUN3
86 select FPU
84 select CPU_HAS_ADDRESS_SPACES 87 select CPU_HAS_ADDRESS_SPACES
85 help 88 help
86 If you anticipate running this kernel on a computer with a MC68LC040 89 If you anticipate running this kernel on a computer with a MC68LC040
@@ -91,6 +94,7 @@ config M68040
91config M68060 94config M68060
92 bool "68060 support" 95 bool "68060 support"
93 depends on MMU && !MMU_SUN3 96 depends on MMU && !MMU_SUN3
97 select FPU
94 select CPU_HAS_ADDRESS_SPACES 98 select CPU_HAS_ADDRESS_SPACES
95 help 99 help
96 If you anticipate running this kernel on a computer with a MC68060 100 If you anticipate running this kernel on a computer with a MC68060
@@ -259,6 +263,7 @@ config M547x
259 bool "MCF547x" 263 bool "MCF547x"
260 select M54xx 264 select M54xx
261 select MMU_COLDFIRE if MMU 265 select MMU_COLDFIRE if MMU
266 select FPU if MMU
262 select HAVE_CACHE_CB 267 select HAVE_CACHE_CB
263 select HAVE_MBAR 268 select HAVE_MBAR
264 select CPU_NO_EFFICIENT_FFS 269 select CPU_NO_EFFICIENT_FFS
@@ -268,6 +273,7 @@ config M547x
268config M548x 273config M548x
269 bool "MCF548x" 274 bool "MCF548x"
270 select MMU_COLDFIRE if MMU 275 select MMU_COLDFIRE if MMU
276 select FPU if MMU
271 select M54xx 277 select M54xx
272 select HAVE_CACHE_CB 278 select HAVE_CACHE_CB
273 select HAVE_MBAR 279 select HAVE_MBAR
diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c
index fddfdccae63b..1e3c7e9193d1 100644
--- a/arch/m68k/coldfire/clk.c
+++ b/arch/m68k/coldfire/clk.c
@@ -101,6 +101,10 @@ EXPORT_SYMBOL(clk_enable);
101void clk_disable(struct clk *clk) 101void clk_disable(struct clk *clk)
102{ 102{
103 unsigned long flags; 103 unsigned long flags;
104
105 if (!clk)
106 return;
107
104 spin_lock_irqsave(&clk_lock, flags); 108 spin_lock_irqsave(&clk_lock, flags);
105 if ((--clk->enabled == 0) && clk->clk_ops) 109 if ((--clk->enabled == 0) && clk->clk_ops)
106 clk->clk_ops->disable(clk); 110 clk->clk_ops->disable(clk);
diff --git a/arch/m68k/coldfire/head.S b/arch/m68k/coldfire/head.S
index 73d92ea0ce65..bdb472c48401 100644
--- a/arch/m68k/coldfire/head.S
+++ b/arch/m68k/coldfire/head.S
@@ -280,10 +280,10 @@ _clear_bss:
280 movel %d0,m68k_cputype /* Mark us as a ColdFire */ 280 movel %d0,m68k_cputype /* Mark us as a ColdFire */
281 movel #MMU_COLDFIRE,%d0 281 movel #MMU_COLDFIRE,%d0
282 movel %d0,m68k_mmutype 282 movel %d0,m68k_mmutype
283 movel #FPU_COLDFIRE,%d0 283 movel #FPUTYPE,%d0
284 movel %d0,m68k_fputype 284 movel %d0,m68k_fputype /* Mark FPU type */
285 movel #MACH_M54XX,%d0 285 movel #MACHINE,%d0
286 movel %d0,m68k_machtype /* Mark us as a 54xx machine */ 286 movel %d0,m68k_machtype /* Mark machine type */
287 lea init_task,%a2 /* Set "current" init task */ 287 lea init_task,%a2 /* Set "current" init task */
288#endif 288#endif
289 289
diff --git a/arch/m68k/coldfire/m528x.c b/arch/m68k/coldfire/m528x.c
index 45e947aeade4..12f9e370d8dd 100644
--- a/arch/m68k/coldfire/m528x.c
+++ b/arch/m68k/coldfire/m528x.c
@@ -102,14 +102,14 @@ void wildfiremod_halt(void)
102 printk(KERN_INFO "WildFireMod hibernating...\n"); 102 printk(KERN_INFO "WildFireMod hibernating...\n");
103 103
104 /* Set portE.5 to Digital IO */ 104 /* Set portE.5 to Digital IO */
105 MCF5282_GPIO_PEPAR &= ~(1 << (5 * 2)); 105 writew(readw(MCFGPIO_PEPAR) & ~(1 << (5 * 2)), MCFGPIO_PEPAR);
106 106
107 /* Make portE.5 an output */ 107 /* Make portE.5 an output */
108 MCF5282_GPIO_DDRE |= (1 << 5); 108 writeb(readb(MCFGPIO_PDDR_E) | (1 << 5), MCFGPIO_PDDR_E);
109 109
110 /* Now toggle portE.5 from low to high */ 110 /* Now toggle portE.5 from low to high */
111 MCF5282_GPIO_PORTE &= ~(1 << 5); 111 writeb(readb(MCFGPIO_PODR_E) & ~(1 << 5), MCFGPIO_PODR_E);
112 MCF5282_GPIO_PORTE |= (1 << 5); 112 writeb(readb(MCFGPIO_PODR_E) | (1 << 5), MCFGPIO_PODR_E);
113 113
114 printk(KERN_EMERG "Failed to hibernate. Halting!\n"); 114 printk(KERN_EMERG "Failed to hibernate. Halting!\n");
115} 115}
diff --git a/arch/m68k/coldfire/m53xx.c b/arch/m68k/coldfire/m53xx.c
index 80879a7fe3d5..2502f63960bc 100644
--- a/arch/m68k/coldfire/m53xx.c
+++ b/arch/m68k/coldfire/m53xx.c
@@ -271,9 +271,6 @@ void __init config_BSP(char *commandp, int size)
271 271
272#define NAND_FLASH_ADDRESS (0xD0000000) 272#define NAND_FLASH_ADDRESS (0xD0000000)
273 273
274int sys_clk_khz = 0;
275int sys_clk_mhz = 0;
276
277void wtm_init(void); 274void wtm_init(void);
278void scm_init(void); 275void scm_init(void);
279void gpio_init(void); 276void gpio_init(void);
@@ -286,9 +283,8 @@ int get_sys_clock (void);
286 283
287asmlinkage void __init sysinit(void) 284asmlinkage void __init sysinit(void)
288{ 285{
289 sys_clk_khz = clock_pll(0, 0); 286 clock_pll(0, 0);
290 sys_clk_mhz = sys_clk_khz/1000; 287
291
292 wtm_init(); 288 wtm_init();
293 scm_init(); 289 scm_init();
294 gpio_init(); 290 gpio_init();
diff --git a/arch/m68k/coldfire/m54xx.c b/arch/m68k/coldfire/m54xx.c
index c32f76791f48..386df3b68cdf 100644
--- a/arch/m68k/coldfire/m54xx.c
+++ b/arch/m68k/coldfire/m54xx.c
@@ -25,7 +25,6 @@
25#include <asm/m54xxgpt.h> 25#include <asm/m54xxgpt.h>
26#ifdef CONFIG_MMU 26#ifdef CONFIG_MMU
27#include <asm/mmu_context.h> 27#include <asm/mmu_context.h>
28#include <linux/pfn.h>
29#endif 28#endif
30 29
31/***************************************************************************/ 30/***************************************************************************/
@@ -78,47 +77,10 @@ static void mcf54xx_reset(void)
78 77
79/***************************************************************************/ 78/***************************************************************************/
80 79
81#ifdef CONFIG_MMU
82
83unsigned long num_pages;
84
85static void __init mcf54xx_bootmem_alloc(void)
86{
87 unsigned long start_pfn;
88 unsigned long memstart;
89
90 /* _rambase and _ramend will be naturally page aligned */
91 m68k_memory[0].addr = _rambase;
92 m68k_memory[0].size = _ramend - _rambase;
93
94 /* compute total pages in system */
95 num_pages = PFN_DOWN(_ramend - _rambase);
96
97 /* page numbers */
98 memstart = PAGE_ALIGN(_ramstart);
99 min_low_pfn = PFN_DOWN(_rambase);
100 start_pfn = PFN_DOWN(memstart);
101 max_pfn = max_low_pfn = PFN_DOWN(_ramend);
102 high_memory = (void *)_ramend;
103
104 m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;
105 module_fixup(NULL, __start_fixup, __stop_fixup);
106
107 /* setup bootmem data */
108 m68k_setup_node(0);
109 memstart += init_bootmem_node(NODE_DATA(0), start_pfn,
110 min_low_pfn, max_low_pfn);
111 free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart);
112}
113
114#endif /* CONFIG_MMU */
115
116/***************************************************************************/
117
118void __init config_BSP(char *commandp, int size) 80void __init config_BSP(char *commandp, int size)
119{ 81{
120#ifdef CONFIG_MMU 82#ifdef CONFIG_MMU
121 mcf54xx_bootmem_alloc(); 83 cf_bootmem_alloc();
122 mmu_context_init(); 84 mmu_context_init();
123#endif 85#endif
124 mach_reset = mcf54xx_reset; 86 mach_reset = mcf54xx_reset;
diff --git a/arch/m68k/include/asm/bootinfo.h b/arch/m68k/include/asm/bootinfo.h
index 8e213267f8e7..81c91af8ec6c 100644
--- a/arch/m68k/include/asm/bootinfo.h
+++ b/arch/m68k/include/asm/bootinfo.h
@@ -22,6 +22,12 @@ extern void save_bootinfo(const struct bi_record *bi);
22static inline void save_bootinfo(const struct bi_record *bi) {} 22static inline void save_bootinfo(const struct bi_record *bi) {}
23#endif 23#endif
24 24
25#ifdef CONFIG_UBOOT
26void process_uboot_commandline(char *commandp, int size);
27#else
28static inline void process_uboot_commandline(char *commandp, int size) {}
29#endif
30
25#endif /* __ASSEMBLY__ */ 31#endif /* __ASSEMBLY__ */
26 32
27 33
diff --git a/arch/m68k/include/asm/m5441xsim.h b/arch/m68k/include/asm/m5441xsim.h
index cc798ab9524b..64f60be47066 100644
--- a/arch/m68k/include/asm/m5441xsim.h
+++ b/arch/m68k/include/asm/m5441xsim.h
@@ -10,6 +10,10 @@
10#define CPU_NAME "COLDFIRE(m5441x)" 10#define CPU_NAME "COLDFIRE(m5441x)"
11#define CPU_INSTR_PER_JIFFY 2 11#define CPU_INSTR_PER_JIFFY 2
12#define MCF_BUSCLK (MCF_CLK / 2) 12#define MCF_BUSCLK (MCF_CLK / 2)
13#define MACHINE MACH_M5441X
14#define FPUTYPE 0
15#define IOMEMBASE 0xe0000000
16#define IOMEMSIZE 0x20000000
13 17
14#include <asm/m54xxacr.h> 18#include <asm/m54xxacr.h>
15 19
diff --git a/arch/m68k/include/asm/m54xxacr.h b/arch/m68k/include/asm/m54xxacr.h
index 59e171063c2f..c6ac05cda282 100644
--- a/arch/m68k/include/asm/m54xxacr.h
+++ b/arch/m68k/include/asm/m54xxacr.h
@@ -94,7 +94,7 @@
94 * register region as non-cacheable. And then we map all our RAM as 94 * register region as non-cacheable. And then we map all our RAM as
95 * cacheable and supervisor access only. 95 * cacheable and supervisor access only.
96 */ 96 */
97#define ACR0_MODE (ACR_BA(CONFIG_MBAR)+ACR_ADMSK(0x1000000)+ \ 97#define ACR0_MODE (ACR_BA(IOMEMBASE)+ACR_ADMSK(IOMEMSIZE)+ \
98 ACR_ENABLE+ACR_SUPER+ACR_CM_OFF_PRE+ACR_SP) 98 ACR_ENABLE+ACR_SUPER+ACR_CM_OFF_PRE+ACR_SP)
99#if defined(CONFIG_CACHE_COPYBACK) 99#if defined(CONFIG_CACHE_COPYBACK)
100#define ACR1_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \ 100#define ACR1_MODE (ACR_BA(CONFIG_RAMBASE)+ACR_ADMSK(CONFIG_RAMSIZE)+ \
diff --git a/arch/m68k/include/asm/m54xxsim.h b/arch/m68k/include/asm/m54xxsim.h
index a5fbd17ab0a5..73d937ff36eb 100644
--- a/arch/m68k/include/asm/m54xxsim.h
+++ b/arch/m68k/include/asm/m54xxsim.h
@@ -8,6 +8,10 @@
8#define CPU_NAME "COLDFIRE(m54xx)" 8#define CPU_NAME "COLDFIRE(m54xx)"
9#define CPU_INSTR_PER_JIFFY 2 9#define CPU_INSTR_PER_JIFFY 2
10#define MCF_BUSCLK (MCF_CLK / 2) 10#define MCF_BUSCLK (MCF_CLK / 2)
11#define MACHINE MACH_M54XX
12#define FPUTYPE FPU_COLDFIRE
13#define IOMEMBASE MCF_MBAR
14#define IOMEMSIZE 0x01000000
11 15
12#include <asm/m54xxacr.h> 16#include <asm/m54xxacr.h>
13 17
diff --git a/arch/m68k/include/asm/mcfmmu.h b/arch/m68k/include/asm/mcfmmu.h
index 8824236e303f..10f9930ec49a 100644
--- a/arch/m68k/include/asm/mcfmmu.h
+++ b/arch/m68k/include/asm/mcfmmu.h
@@ -105,6 +105,7 @@ static inline void mmu_write(u32 a, u32 v)
105 __asm__ __volatile__ ("nop"); 105 __asm__ __volatile__ ("nop");
106} 106}
107 107
108void cf_bootmem_alloc(void);
108int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word); 109int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word);
109 110
110#endif 111#endif
diff --git a/arch/m68k/include/asm/nettel.h b/arch/m68k/include/asm/nettel.h
index 2a7a7667d807..926375d538ec 100644
--- a/arch/m68k/include/asm/nettel.h
+++ b/arch/m68k/include/asm/nettel.h
@@ -92,7 +92,7 @@ static __inline__ unsigned int mcf_getppdata(void)
92 92
93static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits) 93static __inline__ void mcf_setppdata(unsigned int mask, unsigned int bits)
94{ 94{
95 write((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT); 95 writew((readw(MCFSIM_PBDAT) & ~mask) | bits, MCFSIM_PBDAT);
96} 96}
97#endif 97#endif
98 98
diff --git a/arch/m68k/include/uapi/asm/bootinfo.h b/arch/m68k/include/uapi/asm/bootinfo.h
index cdeb26a015b0..a48cf544c762 100644
--- a/arch/m68k/include/uapi/asm/bootinfo.h
+++ b/arch/m68k/include/uapi/asm/bootinfo.h
@@ -81,6 +81,7 @@ struct mem_info {
81#define MACH_Q40 10 81#define MACH_Q40 10
82#define MACH_SUN3X 11 82#define MACH_SUN3X 11
83#define MACH_M54XX 12 83#define MACH_M54XX 12
84#define MACH_M5441X 13
84 85
85 86
86 /* 87 /*
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
index e47778f8588d..8a1c4d3f91c8 100644
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_HAS_DMA) += dma.o
24 24
25obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 25obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
26obj-$(CONFIG_BOOTINFO_PROC) += bootinfo_proc.o 26obj-$(CONFIG_BOOTINFO_PROC) += bootinfo_proc.o
27obj-$(CONFIG_UBOOT) += uboot.o
27 28
28obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 29obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
29 30
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index c55ff719fa72..4ba1ae7345c3 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -203,11 +203,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
203} 203}
204 204
205/* Fill in the fpu structure for a core dump. */ 205/* Fill in the fpu structure for a core dump. */
206#ifdef CONFIG_FPU
207int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu) 206int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
208{ 207{
209 char fpustate[216];
210
211 if (FPU_IS_EMU) { 208 if (FPU_IS_EMU) {
212 int i; 209 int i;
213 210
@@ -222,37 +219,40 @@ int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
222 return 1; 219 return 1;
223 } 220 }
224 221
225 /* First dump the fpu context to avoid protocol violation. */ 222 if (IS_ENABLED(CONFIG_FPU)) {
226 asm volatile ("fsave %0" :: "m" (fpustate[0]) : "memory"); 223 char fpustate[216];
227 if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2])
228 return 0;
229 224
230 if (CPU_IS_COLDFIRE) { 225 /* First dump the fpu context to avoid protocol violation. */
231 asm volatile ("fmovel %/fpiar,%0\n\t" 226 asm volatile ("fsave %0" :: "m" (fpustate[0]) : "memory");
232 "fmovel %/fpcr,%1\n\t" 227 if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2])
233 "fmovel %/fpsr,%2\n\t" 228 return 0;
234 "fmovemd %/fp0-%/fp7,%3" 229
235 : 230 if (CPU_IS_COLDFIRE) {
236 : "m" (fpu->fpcntl[0]), 231 asm volatile ("fmovel %/fpiar,%0\n\t"
237 "m" (fpu->fpcntl[1]), 232 "fmovel %/fpcr,%1\n\t"
238 "m" (fpu->fpcntl[2]), 233 "fmovel %/fpsr,%2\n\t"
239 "m" (fpu->fpregs[0]) 234 "fmovemd %/fp0-%/fp7,%3"
240 : "memory"); 235 :
241 } else { 236 : "m" (fpu->fpcntl[0]),
242 asm volatile ("fmovem %/fpiar/%/fpcr/%/fpsr,%0" 237 "m" (fpu->fpcntl[1]),
243 : 238 "m" (fpu->fpcntl[2]),
244 : "m" (fpu->fpcntl[0]) 239 "m" (fpu->fpregs[0])
245 : "memory"); 240 : "memory");
246 asm volatile ("fmovemx %/fp0-%/fp7,%0" 241 } else {
247 : 242 asm volatile ("fmovem %/fpiar/%/fpcr/%/fpsr,%0"
248 : "m" (fpu->fpregs[0]) 243 :
249 : "memory"); 244 : "m" (fpu->fpcntl[0])
245 : "memory");
246 asm volatile ("fmovemx %/fp0-%/fp7,%0"
247 :
248 : "m" (fpu->fpregs[0])
249 : "memory");
250 }
250 } 251 }
251 252
252 return 1; 253 return 1;
253} 254}
254EXPORT_SYMBOL(dump_fpu); 255EXPORT_SYMBOL(dump_fpu);
255#endif /* CONFIG_FPU */
256 256
257unsigned long get_wchan(struct task_struct *p) 257unsigned long get_wchan(struct task_struct *p)
258{ 258{
diff --git a/arch/m68k/kernel/setup_mm.c b/arch/m68k/kernel/setup_mm.c
index 50633c38f1e2..7a2c21212820 100644
--- a/arch/m68k/kernel/setup_mm.c
+++ b/arch/m68k/kernel/setup_mm.c
@@ -245,7 +245,7 @@ void __init setup_arch(char **cmdline_p)
245 * We should really do our own FPU check at startup. 245 * We should really do our own FPU check at startup.
246 * [what do we do with buggy 68LC040s? if we have problems 246 * [what do we do with buggy 68LC040s? if we have problems
247 * with them, we should add a test to check_bugs() below] */ 247 * with them, we should add a test to check_bugs() below] */
248#ifndef CONFIG_M68KFPU_EMU_ONLY 248#if defined(CONFIG_FPU) && !defined(CONFIG_M68KFPU_EMU_ONLY)
249 /* clear the fpu if we have one */ 249 /* clear the fpu if we have one */
250 if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060|FPU_COLDFIRE)) { 250 if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060|FPU_COLDFIRE)) {
251 volatile int zero = 0; 251 volatile int zero = 0;
@@ -274,6 +274,7 @@ void __init setup_arch(char **cmdline_p)
274 strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE); 274 strncpy(m68k_command_line, CONFIG_BOOTPARAM_STRING, CL_SIZE);
275 m68k_command_line[CL_SIZE - 1] = 0; 275 m68k_command_line[CL_SIZE - 1] = 0;
276#endif /* CONFIG_BOOTPARAM */ 276#endif /* CONFIG_BOOTPARAM */
277 process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
277 *cmdline_p = m68k_command_line; 278 *cmdline_p = m68k_command_line;
278 memcpy(boot_command_line, *cmdline_p, CL_SIZE); 279 memcpy(boot_command_line, *cmdline_p, CL_SIZE);
279 280
@@ -341,6 +342,7 @@ void __init setup_arch(char **cmdline_p)
341#endif 342#endif
342#ifdef CONFIG_COLDFIRE 343#ifdef CONFIG_COLDFIRE
343 case MACH_M54XX: 344 case MACH_M54XX:
345 case MACH_M5441X:
344 config_BSP(NULL, 0); 346 config_BSP(NULL, 0);
345 break; 347 break;
346#endif 348#endif
@@ -548,7 +550,7 @@ module_init(proc_hardware_init);
548 550
549void check_bugs(void) 551void check_bugs(void)
550{ 552{
551#ifndef CONFIG_M68KFPU_EMU 553#if defined(CONFIG_FPU) && !defined(CONFIG_M68KFPU_EMU)
552 if (m68k_fputype == 0) { 554 if (m68k_fputype == 0) {
553 pr_emerg("*** YOU DO NOT HAVE A FLOATING POINT UNIT, " 555 pr_emerg("*** YOU DO NOT HAVE A FLOATING POINT UNIT, "
554 "WHICH IS REQUIRED BY LINUX/M68K ***\n"); 556 "WHICH IS REQUIRED BY LINUX/M68K ***\n");
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index 9309789215a8..8afe6f651c1c 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -34,6 +34,7 @@
34#include <linux/rtc.h> 34#include <linux/rtc.h>
35 35
36#include <asm/setup.h> 36#include <asm/setup.h>
37#include <asm/bootinfo.h>
37#include <asm/irq.h> 38#include <asm/irq.h>
38#include <asm/machdep.h> 39#include <asm/machdep.h>
39#include <asm/pgtable.h> 40#include <asm/pgtable.h>
@@ -82,69 +83,6 @@ void (*mach_power_off)(void);
82#define CPU_INSTR_PER_JIFFY 16 83#define CPU_INSTR_PER_JIFFY 16
83#endif 84#endif
84 85
85#if defined(CONFIG_UBOOT)
86/*
87 * parse_uboot_commandline
88 *
89 * Copies u-boot commandline arguments and store them in the proper linux
90 * variables.
91 *
92 * Assumes:
93 * _init_sp global contains the address in the stack pointer when the
94 * kernel starts (see head.S::_start)
95 *
96 * U-Boot calling convention:
97 * (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
98 *
99 * _init_sp can be parsed as such
100 *
101 * _init_sp+00 = u-boot cmd after jsr into kernel (skip)
102 * _init_sp+04 = &kernel board_info (residual data)
103 * _init_sp+08 = &initrd_start
104 * _init_sp+12 = &initrd_end
105 * _init_sp+16 = &cmd_start
106 * _init_sp+20 = &cmd_end
107 *
108 * This also assumes that the memory locations pointed to are still
109 * unmodified. U-boot places them near the end of external SDRAM.
110 *
111 * Argument(s):
112 * commandp = the linux commandline arg container to fill.
113 * size = the sizeof commandp.
114 *
115 * Returns:
116 */
117static void __init parse_uboot_commandline(char *commandp, int size)
118{
119 extern unsigned long _init_sp;
120 unsigned long *sp;
121 unsigned long uboot_kbd;
122 unsigned long uboot_initrd_start, uboot_initrd_end;
123 unsigned long uboot_cmd_start, uboot_cmd_end;
124
125
126 sp = (unsigned long *)_init_sp;
127 uboot_kbd = sp[1];
128 uboot_initrd_start = sp[2];
129 uboot_initrd_end = sp[3];
130 uboot_cmd_start = sp[4];
131 uboot_cmd_end = sp[5];
132
133 if (uboot_cmd_start && uboot_cmd_end)
134 strncpy(commandp, (const char *)uboot_cmd_start, size);
135#if defined(CONFIG_BLK_DEV_INITRD)
136 if (uboot_initrd_start && uboot_initrd_end &&
137 (uboot_initrd_end > uboot_initrd_start)) {
138 initrd_start = uboot_initrd_start;
139 initrd_end = uboot_initrd_end;
140 ROOT_DEV = Root_RAM0;
141 printk(KERN_INFO "initrd at 0x%lx:0x%lx\n",
142 initrd_start, initrd_end);
143 }
144#endif /* if defined(CONFIG_BLK_DEV_INITRD) */
145}
146#endif /* #if defined(CONFIG_UBOOT) */
147
148void __init setup_arch(char **cmdline_p) 86void __init setup_arch(char **cmdline_p)
149{ 87{
150 int bootmap_size; 88 int bootmap_size;
@@ -164,53 +102,38 @@ void __init setup_arch(char **cmdline_p)
164 command_line[sizeof(command_line) - 1] = 0; 102 command_line[sizeof(command_line) - 1] = 0;
165#endif /* CONFIG_BOOTPARAM */ 103#endif /* CONFIG_BOOTPARAM */
166 104
167#if defined(CONFIG_UBOOT) 105 process_uboot_commandline(&command_line[0], sizeof(command_line));
168 /* CONFIG_UBOOT and CONFIG_BOOTPARAM defined, concatenate cmdline */
169 #if defined(CONFIG_BOOTPARAM)
170 /* Add the whitespace separator */
171 command_line[strlen(CONFIG_BOOTPARAM_STRING)] = ' ';
172 /* Parse uboot command line into the rest of the buffer */
173 parse_uboot_commandline(
174 &command_line[(strlen(CONFIG_BOOTPARAM_STRING)+1)],
175 (sizeof(command_line) -
176 (strlen(CONFIG_BOOTPARAM_STRING)+1)));
177 /* Only CONFIG_UBOOT defined, create cmdline */
178 #else
179 parse_uboot_commandline(&command_line[0], sizeof(command_line));
180 #endif /* CONFIG_BOOTPARAM */
181 command_line[sizeof(command_line) - 1] = 0;
182#endif /* CONFIG_UBOOT */
183 106
184 printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU_NAME "\n"); 107 pr_info("uClinux with CPU " CPU_NAME "\n");
185 108
186#ifdef CONFIG_UCDIMM 109#ifdef CONFIG_UCDIMM
187 printk(KERN_INFO "uCdimm by Lineo, Inc. <www.lineo.com>\n"); 110 pr_info("uCdimm by Lineo, Inc. <www.lineo.com>\n");
188#endif 111#endif
189#ifdef CONFIG_M68VZ328 112#ifdef CONFIG_M68VZ328
190 printk(KERN_INFO "M68VZ328 support by Evan Stawnyczy <e@lineo.ca>\n"); 113 pr_info("M68VZ328 support by Evan Stawnyczy <e@lineo.ca>\n");
191#endif 114#endif
192#ifdef CONFIG_COLDFIRE 115#ifdef CONFIG_COLDFIRE
193 printk(KERN_INFO "COLDFIRE port done by Greg Ungerer, gerg@snapgear.com\n"); 116 pr_info("COLDFIRE port done by Greg Ungerer, gerg@snapgear.com\n");
194#ifdef CONFIG_M5307 117#ifdef CONFIG_M5307
195 printk(KERN_INFO "Modified for M5307 by Dave Miller, dmiller@intellistor.com\n"); 118 pr_info("Modified for M5307 by Dave Miller, dmiller@intellistor.com\n");
196#endif 119#endif
197#ifdef CONFIG_ELITE 120#ifdef CONFIG_ELITE
198 printk(KERN_INFO "Modified for M5206eLITE by Rob Scott, rscott@mtrob.fdns.net\n"); 121 pr_info("Modified for M5206eLITE by Rob Scott, rscott@mtrob.fdns.net\n");
199#endif 122#endif
200#endif 123#endif
201 printk(KERN_INFO "Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n"); 124 pr_info("Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n");
202 125
203#if defined( CONFIG_PILOT ) && defined( CONFIG_M68328 ) 126#if defined( CONFIG_PILOT ) && defined( CONFIG_M68328 )
204 printk(KERN_INFO "TRG SuperPilot FLASH card support <info@trgnet.com>\n"); 127 pr_info("TRG SuperPilot FLASH card support <info@trgnet.com>\n");
205#endif 128#endif
206#if defined( CONFIG_PILOT ) && defined( CONFIG_M68EZ328 ) 129#if defined( CONFIG_PILOT ) && defined( CONFIG_M68EZ328 )
207 printk(KERN_INFO "PalmV support by Lineo Inc. <jeff@uclinux.com>\n"); 130 pr_info("PalmV support by Lineo Inc. <jeff@uclinux.com>\n");
208#endif 131#endif
209#ifdef CONFIG_DRAGEN2 132#ifdef CONFIG_DRAGEN2
210 printk(KERN_INFO "DragonEngine II board support by Georges Menie\n"); 133 pr_info("DragonEngine II board support by Georges Menie\n");
211#endif 134#endif
212#ifdef CONFIG_M5235EVB 135#ifdef CONFIG_M5235EVB
213 printk(KERN_INFO "Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)\n"); 136 pr_info("Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)\n");
214#endif 137#endif
215 138
216 pr_debug("KERNEL -> TEXT=0x%p-0x%p DATA=0x%p-0x%p BSS=0x%p-0x%p\n", 139 pr_debug("KERNEL -> TEXT=0x%p-0x%p DATA=0x%p-0x%p BSS=0x%p-0x%p\n",
diff --git a/arch/m68k/kernel/uboot.c b/arch/m68k/kernel/uboot.c
new file mode 100644
index 000000000000..b3536a82a262
--- /dev/null
+++ b/arch/m68k/kernel/uboot.c
@@ -0,0 +1,107 @@
1/*
2 * uboot.c -- uboot arguments support
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
7 */
8
9#include <linux/kernel.h>
10#include <linux/sched.h>
11#include <linux/delay.h>
12#include <linux/interrupt.h>
13#include <linux/fb.h>
14#include <linux/module.h>
15#include <linux/mm.h>
16#include <linux/console.h>
17#include <linux/errno.h>
18#include <linux/string.h>
19#include <linux/bootmem.h>
20#include <linux/seq_file.h>
21#include <linux/init.h>
22#include <linux/initrd.h>
23#include <linux/root_dev.h>
24#include <linux/rtc.h>
25
26#include <asm/setup.h>
27#include <asm/irq.h>
28#include <asm/machdep.h>
29#include <asm/pgtable.h>
30#include <asm/sections.h>
31
32/*
33 * parse_uboot_commandline
34 *
35 * Copies u-boot commandline arguments and store them in the proper linux
36 * variables.
37 *
38 * Assumes:
39 * _init_sp global contains the address in the stack pointer when the
40 * kernel starts (see head.S::_start)
41 *
42 * U-Boot calling convention:
43 * (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
44 *
45 * _init_sp can be parsed as such
46 *
47 * _init_sp+00 = u-boot cmd after jsr into kernel (skip)
48 * _init_sp+04 = &kernel board_info (residual data)
49 * _init_sp+08 = &initrd_start
50 * _init_sp+12 = &initrd_end
51 * _init_sp+16 = &cmd_start
52 * _init_sp+20 = &cmd_end
53 *
54 * This also assumes that the memory locations pointed to are still
55 * unmodified. U-boot places them near the end of external SDRAM.
56 *
57 * Argument(s):
58 * commandp = the linux commandline arg container to fill.
59 * size = the sizeof commandp.
60 *
61 * Returns:
62 */
63static void __init parse_uboot_commandline(char *commandp, int size)
64{
65 extern unsigned long _init_sp;
66 unsigned long *sp;
67 unsigned long uboot_kbd;
68 unsigned long uboot_initrd_start, uboot_initrd_end;
69 unsigned long uboot_cmd_start, uboot_cmd_end;
70
71 sp = (unsigned long *)_init_sp;
72 uboot_kbd = sp[1];
73 uboot_initrd_start = sp[2];
74 uboot_initrd_end = sp[3];
75 uboot_cmd_start = sp[4];
76 uboot_cmd_end = sp[5];
77
78 if (uboot_cmd_start && uboot_cmd_end)
79 strncpy(commandp, (const char *)uboot_cmd_start, size);
80#if defined(CONFIG_BLK_DEV_INITRD)
81 if (uboot_initrd_start && uboot_initrd_end &&
82 (uboot_initrd_end > uboot_initrd_start)) {
83 initrd_start = uboot_initrd_start;
84 initrd_end = uboot_initrd_end;
85 ROOT_DEV = Root_RAM0;
86 printk(KERN_INFO "initrd at 0x%lx:0x%lx\n",
87 initrd_start, initrd_end);
88 }
89#endif /* if defined(CONFIG_BLK_DEV_INITRD) */
90}
91
92__init void process_uboot_commandline(char *commandp, int size)
93{
94 int len, n;
95
96 n = strnlen(commandp, size);
97 commandp += n;
98 len = size - n;
99 if (len) {
100 /* Add the whitespace separator */
101 *commandp++ = ' ';
102 len--;
103 }
104
105 parse_uboot_commandline(commandp, len);
106 commandp[size - 1] = 0;
107}
diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
index f58fafe7e4c9..87131cd3bc8f 100644
--- a/arch/m68k/mm/mcfmmu.c
+++ b/arch/m68k/mm/mcfmmu.c
@@ -27,7 +27,7 @@ mm_context_t next_mmu_context;
27unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1]; 27unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1];
28atomic_t nr_free_contexts; 28atomic_t nr_free_contexts;
29struct mm_struct *context_mm[LAST_CONTEXT+1]; 29struct mm_struct *context_mm[LAST_CONTEXT+1];
30extern unsigned long num_pages; 30unsigned long num_pages;
31 31
32/* 32/*
33 * ColdFire paging_init derived from sun3. 33 * ColdFire paging_init derived from sun3.
@@ -150,6 +150,35 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
150 return 0; 150 return 0;
151} 151}
152 152
153void __init cf_bootmem_alloc(void)
154{
155 unsigned long start_pfn;
156 unsigned long memstart;
157
158 /* _rambase and _ramend will be naturally page aligned */
159 m68k_memory[0].addr = _rambase;
160 m68k_memory[0].size = _ramend - _rambase;
161
162 /* compute total pages in system */
163 num_pages = PFN_DOWN(_ramend - _rambase);
164
165 /* page numbers */
166 memstart = PAGE_ALIGN(_ramstart);
167 min_low_pfn = PFN_DOWN(_rambase);
168 start_pfn = PFN_DOWN(memstart);
169 max_pfn = max_low_pfn = PFN_DOWN(_ramend);
170 high_memory = (void *)_ramend;
171
172 m68k_virt_to_node_shift = fls(_ramend - _rambase - 1) - 6;
173 module_fixup(NULL, __start_fixup, __stop_fixup);
174
175 /* setup bootmem data */
176 m68k_setup_node(0);
177 memstart += init_bootmem_node(NODE_DATA(0), start_pfn,
178 min_low_pfn, max_low_pfn);
179 free_bootmem_node(NODE_DATA(0), memstart, _ramend - memstart);
180}
181
153/* 182/*
154 * Initialize the context management stuff. 183 * Initialize the context management stuff.
155 * The following was taken from arch/ppc/mmu_context.c 184 * The following was taken from arch/ppc/mmu_context.c