acpi_pad: build only on X86
[linux-2.6/linux-acpi-2.6.git] / arch / m68knommu / kernel / setup.c
blob5c2bb3eeaaa2ec98ecdead8e7a2f03a3d9d51e34
1 /*
2 * linux/arch/m68knommu/kernel/setup.c
4 * Copyright (C) 1999-2007 Greg Ungerer (gerg@snapgear.com)
5 * Copyright (C) 1998,1999 D. Jeff Dionne <jeff@uClinux.org>
6 * Copyleft ()) 2000 James D. Schettine {james@telos-systems.com}
7 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
8 * Copyright (C) 1995 Hamish Macdonald
9 * Copyright (C) 2000 Lineo Inc. (www.lineo.com)
10 * Copyright (C) 2001 Lineo, Inc. <www.lineo.com>
12 * 68VZ328 Fixes/support Evan Stawnyczy <e@lineo.ca>
16 * This file handles the architecture-dependent parts of system setup
19 #include <linux/kernel.h>
20 #include <linux/sched.h>
21 #include <linux/delay.h>
22 #include <linux/interrupt.h>
23 #include <linux/fb.h>
24 #include <linux/module.h>
25 #include <linux/mm.h>
26 #include <linux/console.h>
27 #include <linux/errno.h>
28 #include <linux/string.h>
29 #include <linux/bootmem.h>
30 #include <linux/seq_file.h>
31 #include <linux/init.h>
33 #include <asm/setup.h>
34 #include <asm/irq.h>
35 #include <asm/machdep.h>
36 #include <asm/pgtable.h>
38 unsigned long memory_start;
39 unsigned long memory_end;
41 EXPORT_SYMBOL(memory_start);
42 EXPORT_SYMBOL(memory_end);
44 char __initdata command_line[COMMAND_LINE_SIZE];
46 /* machine dependent timer functions */
47 void (*mach_gettod)(int*, int*, int*, int*, int*, int*);
48 int (*mach_set_clock_mmss)(unsigned long);
50 /* machine dependent reboot functions */
51 void (*mach_reset)(void);
52 void (*mach_halt)(void);
53 void (*mach_power_off)(void);
56 #ifdef CONFIG_M68000
57 #define CPU "MC68000"
58 #endif
59 #ifdef CONFIG_M68328
60 #define CPU "MC68328"
61 #endif
62 #ifdef CONFIG_M68EZ328
63 #define CPU "MC68EZ328"
64 #endif
65 #ifdef CONFIG_M68VZ328
66 #define CPU "MC68VZ328"
67 #endif
68 #ifdef CONFIG_M68360
69 #define CPU "MC68360"
70 #endif
71 #if defined(CONFIG_M5206)
72 #define CPU "COLDFIRE(m5206)"
73 #endif
74 #if defined(CONFIG_M5206e)
75 #define CPU "COLDFIRE(m5206e)"
76 #endif
77 #if defined(CONFIG_M520x)
78 #define CPU "COLDFIRE(m520x)"
79 #endif
80 #if defined(CONFIG_M523x)
81 #define CPU "COLDFIRE(m523x)"
82 #endif
83 #if defined(CONFIG_M5249)
84 #define CPU "COLDFIRE(m5249)"
85 #endif
86 #if defined(CONFIG_M5271)
87 #define CPU "COLDFIRE(m5270/5271)"
88 #endif
89 #if defined(CONFIG_M5272)
90 #define CPU "COLDFIRE(m5272)"
91 #endif
92 #if defined(CONFIG_M5275)
93 #define CPU "COLDFIRE(m5274/5275)"
94 #endif
95 #if defined(CONFIG_M528x)
96 #define CPU "COLDFIRE(m5280/5282)"
97 #endif
98 #if defined(CONFIG_M5307)
99 #define CPU "COLDFIRE(m5307)"
100 #endif
101 #if defined(CONFIG_M532x)
102 #define CPU "COLDFIRE(m532x)"
103 #endif
104 #if defined(CONFIG_M5407)
105 #define CPU "COLDFIRE(m5407)"
106 #endif
107 #ifndef CPU
108 #define CPU "UNKNOWN"
109 #endif
111 extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end;
112 extern int _ramstart, _ramend;
114 void __init setup_arch(char **cmdline_p)
116 int bootmap_size;
118 memory_start = PAGE_ALIGN(_ramstart);
119 memory_end = _ramend;
121 init_mm.start_code = (unsigned long) &_stext;
122 init_mm.end_code = (unsigned long) &_etext;
123 init_mm.end_data = (unsigned long) &_edata;
124 init_mm.brk = (unsigned long) 0;
126 config_BSP(&command_line[0], sizeof(command_line));
128 #if defined(CONFIG_BOOTPARAM)
129 strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line));
130 command_line[sizeof(command_line) - 1] = 0;
131 #endif
133 printk(KERN_INFO "\x0F\r\n\nuClinux/" CPU "\n");
135 #ifdef CONFIG_UCDIMM
136 printk(KERN_INFO "uCdimm by Lineo, Inc. <www.lineo.com>\n");
137 #endif
138 #ifdef CONFIG_M68VZ328
139 printk(KERN_INFO "M68VZ328 support by Evan Stawnyczy <e@lineo.ca>\n");
140 #endif
141 #ifdef CONFIG_COLDFIRE
142 printk(KERN_INFO "COLDFIRE port done by Greg Ungerer, gerg@snapgear.com\n");
143 #ifdef CONFIG_M5307
144 printk(KERN_INFO "Modified for M5307 by Dave Miller, dmiller@intellistor.com\n");
145 #endif
146 #ifdef CONFIG_ELITE
147 printk(KERN_INFO "Modified for M5206eLITE by Rob Scott, rscott@mtrob.fdns.net\n");
148 #endif
149 #endif
150 printk(KERN_INFO "Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne\n");
152 #if defined( CONFIG_PILOT ) && defined( CONFIG_M68328 )
153 printk(KERN_INFO "TRG SuperPilot FLASH card support <info@trgnet.com>\n");
154 #endif
155 #if defined( CONFIG_PILOT ) && defined( CONFIG_M68EZ328 )
156 printk(KERN_INFO "PalmV support by Lineo Inc. <jeff@uclinux.com>\n");
157 #endif
158 #if defined (CONFIG_M68360)
159 printk(KERN_INFO "QUICC port done by SED Systems <hamilton@sedsystems.ca>,\n");
160 printk(KERN_INFO "based on 2.0.38 port by Lineo Inc. <mleslie@lineo.com>.\n");
161 #endif
162 #ifdef CONFIG_DRAGEN2
163 printk(KERN_INFO "DragonEngine II board support by Georges Menie\n");
164 #endif
165 #ifdef CONFIG_M5235EVB
166 printk(KERN_INFO "Motorola M5235EVB support (C)2005 Syn-tech Systems, Inc. (Jate Sujjavanich)\n");
167 #endif
169 pr_debug("KERNEL -> TEXT=0x%06x-0x%06x DATA=0x%06x-0x%06x "
170 "BSS=0x%06x-0x%06x\n", (int) &_stext, (int) &_etext,
171 (int) &_sdata, (int) &_edata,
172 (int) &_sbss, (int) &_ebss);
173 pr_debug("MEMORY -> ROMFS=0x%06x-0x%06x MEM=0x%06x-0x%06x\n ",
174 (int) &_ebss, (int) memory_start,
175 (int) memory_start, (int) memory_end);
177 /* Keep a copy of command line */
178 *cmdline_p = &command_line[0];
179 memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
180 boot_command_line[COMMAND_LINE_SIZE-1] = 0;
182 #ifdef DEBUG
183 if (strlen(*cmdline_p))
184 printk(KERN_DEBUG "Command line: '%s'\n", *cmdline_p);
185 #endif
187 #if defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_DUMMY_CONSOLE)
188 conswitchp = &dummy_con;
189 #endif
192 * Give all the memory to the bootmap allocator, tell it to put the
193 * boot mem_map at the start of memory.
195 bootmap_size = init_bootmem_node(
196 NODE_DATA(0),
197 memory_start >> PAGE_SHIFT, /* map goes here */
198 PAGE_OFFSET >> PAGE_SHIFT, /* 0 on coldfire */
199 memory_end >> PAGE_SHIFT);
201 * Free the usable memory, we have to make sure we do not free
202 * the bootmem bitmap so we then reserve it after freeing it :-)
204 free_bootmem(memory_start, memory_end - memory_start);
205 reserve_bootmem(memory_start, bootmap_size, BOOTMEM_DEFAULT);
208 * Get kmalloc into gear.
210 paging_init();
214 * Get CPU information for use by the procfs.
216 static int show_cpuinfo(struct seq_file *m, void *v)
218 char *cpu, *mmu, *fpu;
219 u_long clockfreq;
221 cpu = CPU;
222 mmu = "none";
223 fpu = "none";
225 #ifdef CONFIG_COLDFIRE
226 clockfreq = (loops_per_jiffy * HZ) * 3;
227 #else
228 clockfreq = (loops_per_jiffy * HZ) * 16;
229 #endif
231 seq_printf(m, "CPU:\t\t%s\n"
232 "MMU:\t\t%s\n"
233 "FPU:\t\t%s\n"
234 "Clocking:\t%lu.%1luMHz\n"
235 "BogoMips:\t%lu.%02lu\n"
236 "Calibration:\t%lu loops\n",
237 cpu, mmu, fpu,
238 clockfreq / 1000000,
239 (clockfreq / 100000) % 10,
240 (loops_per_jiffy * HZ) / 500000,
241 ((loops_per_jiffy * HZ) / 5000) % 100,
242 (loops_per_jiffy * HZ));
244 return 0;
247 static void *c_start(struct seq_file *m, loff_t *pos)
249 return *pos < NR_CPUS ? ((void *) 0x12345678) : NULL;
252 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
254 ++*pos;
255 return c_start(m, pos);
258 static void c_stop(struct seq_file *m, void *v)
262 const struct seq_operations cpuinfo_op = {
263 .start = c_start,
264 .next = c_next,
265 .stop = c_stop,
266 .show = show_cpuinfo,