[PATCH] ppc32: Added support for the Book-E style Watchdog Timer
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / ppc / kernel / setup.c
blobcf74a744e375f3384fbb035a89e94084f9bfba37
1 /*
2 * Common prep/pmac/chrp boot and setup code.
3 */
5 #include <linux/config.h>
6 #include <linux/module.h>
7 #include <linux/string.h>
8 #include <linux/sched.h>
9 #include <linux/init.h>
10 #include <linux/kernel.h>
11 #include <linux/reboot.h>
12 #include <linux/delay.h>
13 #include <linux/initrd.h>
14 #include <linux/ide.h>
15 #include <linux/tty.h>
16 #include <linux/bootmem.h>
17 #include <linux/seq_file.h>
18 #include <linux/root_dev.h>
19 #include <linux/cpu.h>
20 #include <linux/console.h>
22 #include <asm/residual.h>
23 #include <asm/io.h>
24 #include <asm/prom.h>
25 #include <asm/processor.h>
26 #include <asm/pgtable.h>
27 #include <asm/bootinfo.h>
28 #include <asm/setup.h>
29 #include <asm/amigappc.h>
30 #include <asm/smp.h>
31 #include <asm/elf.h>
32 #include <asm/cputable.h>
33 #include <asm/bootx.h>
34 #include <asm/btext.h>
35 #include <asm/machdep.h>
36 #include <asm/uaccess.h>
37 #include <asm/system.h>
38 #include <asm/pmac_feature.h>
39 #include <asm/sections.h>
40 #include <asm/nvram.h>
41 #include <asm/xmon.h>
42 #include <asm/ocp.h>
44 #if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE)
45 #include <asm/ppc_sys.h>
46 #endif
48 #if defined CONFIG_KGDB
49 #include <asm/kgdb.h>
50 #endif
52 extern void platform_init(unsigned long r3, unsigned long r4,
53 unsigned long r5, unsigned long r6, unsigned long r7);
54 extern void bootx_init(unsigned long r4, unsigned long phys);
55 extern void identify_cpu(unsigned long offset, unsigned long cpu);
56 extern void do_cpu_ftr_fixups(unsigned long offset);
57 extern void reloc_got2(unsigned long offset);
59 extern void ppc6xx_idle(void);
60 extern void power4_idle(void);
62 extern boot_infos_t *boot_infos;
63 struct ide_machdep_calls ppc_ide_md;
65 /* Used with the BI_MEMSIZE bootinfo parameter to store the memory
66 size value reported by the boot loader. */
67 unsigned long boot_mem_size;
69 unsigned long ISA_DMA_THRESHOLD;
70 unsigned long DMA_MODE_READ, DMA_MODE_WRITE;
72 #ifdef CONFIG_PPC_MULTIPLATFORM
73 int _machine = 0;
75 extern void prep_init(unsigned long r3, unsigned long r4,
76 unsigned long r5, unsigned long r6, unsigned long r7);
77 extern void pmac_init(unsigned long r3, unsigned long r4,
78 unsigned long r5, unsigned long r6, unsigned long r7);
79 extern void chrp_init(unsigned long r3, unsigned long r4,
80 unsigned long r5, unsigned long r6, unsigned long r7);
81 #endif /* CONFIG_PPC_MULTIPLATFORM */
83 #ifdef CONFIG_MAGIC_SYSRQ
84 unsigned long SYSRQ_KEY = 0x54;
85 #endif /* CONFIG_MAGIC_SYSRQ */
87 #ifdef CONFIG_VGA_CONSOLE
88 unsigned long vgacon_remap_base;
89 #endif
91 struct machdep_calls ppc_md;
94 * These are used in binfmt_elf.c to put aux entries on the stack
95 * for each elf executable being started.
97 int dcache_bsize;
98 int icache_bsize;
99 int ucache_bsize;
101 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_FB_VGA16) || \
102 defined(CONFIG_FB_VGA16_MODULE) || defined(CONFIG_FB_VESA)
103 struct screen_info screen_info = {
104 0, 25, /* orig-x, orig-y */
105 0, /* unused */
106 0, /* orig-video-page */
107 0, /* orig-video-mode */
108 80, /* orig-video-cols */
109 0,0,0, /* ega_ax, ega_bx, ega_cx */
110 25, /* orig-video-lines */
111 1, /* orig-video-isVGA */
112 16 /* orig-video-points */
114 #endif /* CONFIG_VGA_CONSOLE || CONFIG_FB_VGA16 || CONFIG_FB_VESA */
116 void machine_restart(char *cmd)
118 #ifdef CONFIG_NVRAM
119 nvram_sync();
120 #endif
121 ppc_md.restart(cmd);
124 void machine_power_off(void)
126 #ifdef CONFIG_NVRAM
127 nvram_sync();
128 #endif
129 ppc_md.power_off();
132 void machine_halt(void)
134 #ifdef CONFIG_NVRAM
135 nvram_sync();
136 #endif
137 ppc_md.halt();
140 void (*pm_power_off)(void) = machine_power_off;
142 #ifdef CONFIG_TAU
143 extern u32 cpu_temp(unsigned long cpu);
144 extern u32 cpu_temp_both(unsigned long cpu);
145 #endif /* CONFIG_TAU */
147 int show_cpuinfo(struct seq_file *m, void *v)
149 int i = (int) v - 1;
150 int err = 0;
151 unsigned int pvr;
152 unsigned short maj, min;
153 unsigned long lpj;
155 if (i >= NR_CPUS) {
156 /* Show summary information */
157 #ifdef CONFIG_SMP
158 unsigned long bogosum = 0;
159 for (i = 0; i < NR_CPUS; ++i)
160 if (cpu_online(i))
161 bogosum += cpu_data[i].loops_per_jiffy;
162 seq_printf(m, "total bogomips\t: %lu.%02lu\n",
163 bogosum/(500000/HZ), bogosum/(5000/HZ) % 100);
164 #endif /* CONFIG_SMP */
166 if (ppc_md.show_cpuinfo != NULL)
167 err = ppc_md.show_cpuinfo(m);
168 return err;
171 #ifdef CONFIG_SMP
172 if (!cpu_online(i))
173 return 0;
174 pvr = cpu_data[i].pvr;
175 lpj = cpu_data[i].loops_per_jiffy;
176 #else
177 pvr = mfspr(SPRN_PVR);
178 lpj = loops_per_jiffy;
179 #endif
181 seq_printf(m, "processor\t: %d\n", i);
182 seq_printf(m, "cpu\t\t: ");
184 if (cur_cpu_spec[i]->pvr_mask)
185 seq_printf(m, "%s", cur_cpu_spec[i]->cpu_name);
186 else
187 seq_printf(m, "unknown (%08x)", pvr);
188 #ifdef CONFIG_ALTIVEC
189 if (cur_cpu_spec[i]->cpu_features & CPU_FTR_ALTIVEC)
190 seq_printf(m, ", altivec supported");
191 #endif
192 seq_printf(m, "\n");
194 #ifdef CONFIG_TAU
195 if (cur_cpu_spec[i]->cpu_features & CPU_FTR_TAU) {
196 #ifdef CONFIG_TAU_AVERAGE
197 /* more straightforward, but potentially misleading */
198 seq_printf(m, "temperature \t: %u C (uncalibrated)\n",
199 cpu_temp(i));
200 #else
201 /* show the actual temp sensor range */
202 u32 temp;
203 temp = cpu_temp_both(i);
204 seq_printf(m, "temperature \t: %u-%u C (uncalibrated)\n",
205 temp & 0xff, temp >> 16);
206 #endif
208 #endif /* CONFIG_TAU */
210 if (ppc_md.show_percpuinfo != NULL) {
211 err = ppc_md.show_percpuinfo(m, i);
212 if (err)
213 return err;
216 /* If we are a Freescale core do a simple check so
217 * we dont have to keep adding cases in the future */
218 if ((PVR_VER(pvr) & 0x8000) == 0x8000) {
219 maj = PVR_MAJ(pvr);
220 min = PVR_MIN(pvr);
221 } else {
222 switch (PVR_VER(pvr)) {
223 case 0x0020: /* 403 family */
224 maj = PVR_MAJ(pvr) + 1;
225 min = PVR_MIN(pvr);
226 break;
227 case 0x1008: /* 740P/750P ?? */
228 maj = ((pvr >> 8) & 0xFF) - 1;
229 min = pvr & 0xFF;
230 break;
231 default:
232 maj = (pvr >> 8) & 0xFF;
233 min = pvr & 0xFF;
234 break;
238 seq_printf(m, "revision\t: %hd.%hd (pvr %04x %04x)\n",
239 maj, min, PVR_VER(pvr), PVR_REV(pvr));
241 seq_printf(m, "bogomips\t: %lu.%02lu\n",
242 lpj / (500000/HZ), (lpj / (5000/HZ)) % 100);
244 #if defined(CONFIG_85xx) || defined(CONFIG_83xx) || defined(CONFIG_MPC10X_BRIDGE)
245 if (cur_ppc_sys_spec->ppc_sys_name)
246 seq_printf(m, "chipset\t\t: %s\n",
247 cur_ppc_sys_spec->ppc_sys_name);
248 #endif
250 #ifdef CONFIG_SMP
251 seq_printf(m, "\n");
252 #endif
254 return 0;
257 static void *c_start(struct seq_file *m, loff_t *pos)
259 int i = *pos;
261 return i <= NR_CPUS? (void *) (i + 1): NULL;
264 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
266 ++*pos;
267 return c_start(m, pos);
270 static void c_stop(struct seq_file *m, void *v)
274 struct seq_operations cpuinfo_op = {
275 .start =c_start,
276 .next = c_next,
277 .stop = c_stop,
278 .show = show_cpuinfo,
282 * We're called here very early in the boot. We determine the machine
283 * type and call the appropriate low-level setup functions.
284 * -- Cort <cort@fsmlabs.com>
286 * Note that the kernel may be running at an address which is different
287 * from the address that it was linked at, so we must use RELOC/PTRRELOC
288 * to access static data (including strings). -- paulus
290 __init
291 unsigned long
292 early_init(int r3, int r4, int r5)
294 unsigned long phys;
295 unsigned long offset = reloc_offset();
297 /* Default */
298 phys = offset + KERNELBASE;
300 /* First zero the BSS -- use memset, some arches don't have
301 * caches on yet */
302 memset_io(PTRRELOC(&__bss_start), 0, _end - __bss_start);
305 * Identify the CPU type and fix up code sections
306 * that depend on which cpu we have.
308 identify_cpu(offset, 0);
309 do_cpu_ftr_fixups(offset);
311 #if defined(CONFIG_PPC_MULTIPLATFORM)
312 reloc_got2(offset);
314 /* If we came here from BootX, clear the screen,
315 * set up some pointers and return. */
316 if ((r3 == 0x426f6f58) && (r5 == 0))
317 bootx_init(r4, phys);
320 * don't do anything on prep
321 * for now, don't use bootinfo because it breaks yaboot 0.5
322 * and assume that if we didn't find a magic number, we have OF
324 else if (*(unsigned long *)(0) != 0xdeadc0de)
325 phys = prom_init(r3, r4, (prom_entry)r5);
327 reloc_got2(-offset);
328 #endif
330 return phys;
333 #ifdef CONFIG_PPC_OF
335 * Assume here that all clock rates are the same in a
336 * smp system. -- Cort
338 int __openfirmware
339 of_show_percpuinfo(struct seq_file *m, int i)
341 struct device_node *cpu_node;
342 u32 *fp;
343 int s;
345 cpu_node = find_type_devices("cpu");
346 if (!cpu_node)
347 return 0;
348 for (s = 0; s < i && cpu_node->next; s++)
349 cpu_node = cpu_node->next;
350 fp = (u32 *)get_property(cpu_node, "clock-frequency", NULL);
351 if (fp)
352 seq_printf(m, "clock\t\t: %dMHz\n", *fp / 1000000);
353 return 0;
356 void __init
357 intuit_machine_type(void)
359 char *model;
360 struct device_node *root;
362 /* ask the OF info if we're a chrp or pmac */
363 root = find_path_device("/");
364 if (root != 0) {
365 /* assume pmac unless proven to be chrp -- Cort */
366 _machine = _MACH_Pmac;
367 model = get_property(root, "device_type", NULL);
368 if (model && !strncmp("chrp", model, 4))
369 _machine = _MACH_chrp;
370 else {
371 model = get_property(root, "model", NULL);
372 if (model && !strncmp(model, "IBM", 3))
373 _machine = _MACH_chrp;
377 #endif
379 #ifdef CONFIG_PPC_MULTIPLATFORM
381 * The PPC_MULTIPLATFORM version of platform_init...
383 void __init
384 platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
385 unsigned long r6, unsigned long r7)
387 #ifdef CONFIG_BOOTX_TEXT
388 if (boot_text_mapped) {
389 btext_clearscreen();
390 btext_welcome();
392 #endif
394 parse_bootinfo(find_bootinfo());
396 /* if we didn't get any bootinfo telling us what we are... */
397 if (_machine == 0) {
398 /* prep boot loader tells us if we're prep or not */
399 if ( *(unsigned long *)(KERNELBASE) == (0xdeadc0de) )
400 _machine = _MACH_prep;
403 /* not much more to do here, if prep */
404 if (_machine == _MACH_prep) {
405 prep_init(r3, r4, r5, r6, r7);
406 return;
409 /* prom_init has already been called from __start */
410 if (boot_infos)
411 relocate_nodes();
413 /* If we aren't PReP, we can find out if we're Pmac
414 * or CHRP with this. */
415 if (_machine == 0)
416 intuit_machine_type();
418 /* finish_device_tree may need _machine defined. */
419 finish_device_tree();
422 * If we were booted via quik, r3 points to the physical
423 * address of the command-line parameters.
424 * If we were booted from an xcoff image (i.e. netbooted or
425 * booted from floppy), we get the command line from the
426 * bootargs property of the /chosen node.
427 * If an initial ramdisk is present, r3 and r4
428 * are used for initrd_start and initrd_size,
429 * otherwise they contain 0xdeadbeef.
431 if (r3 >= 0x4000 && r3 < 0x800000 && r4 == 0) {
432 strlcpy(cmd_line, (char *)r3 + KERNELBASE,
433 sizeof(cmd_line));
434 } else if (boot_infos != 0) {
435 /* booted by BootX - check for ramdisk */
436 if (boot_infos->kernelParamsOffset != 0)
437 strlcpy(cmd_line, (char *) boot_infos
438 + boot_infos->kernelParamsOffset,
439 sizeof(cmd_line));
440 #ifdef CONFIG_BLK_DEV_INITRD
441 if (boot_infos->ramDisk) {
442 initrd_start = (unsigned long) boot_infos
443 + boot_infos->ramDisk;
444 initrd_end = initrd_start + boot_infos->ramDiskSize;
445 initrd_below_start_ok = 1;
447 #endif
448 } else {
449 struct device_node *chosen;
450 char *p;
452 #ifdef CONFIG_BLK_DEV_INITRD
453 if (r3 && r4 && r4 != 0xdeadbeef) {
454 if (r3 < KERNELBASE)
455 r3 += KERNELBASE;
456 initrd_start = r3;
457 initrd_end = r3 + r4;
458 ROOT_DEV = Root_RAM0;
459 initrd_below_start_ok = 1;
461 #endif
462 chosen = find_devices("chosen");
463 if (chosen != NULL) {
464 p = get_property(chosen, "bootargs", NULL);
465 if (p && *p) {
466 strlcpy(cmd_line, p, sizeof(cmd_line));
470 #ifdef CONFIG_ADB
471 if (strstr(cmd_line, "adb_sync")) {
472 extern int __adb_probe_sync;
473 __adb_probe_sync = 1;
475 #endif /* CONFIG_ADB */
477 switch (_machine) {
478 case _MACH_Pmac:
479 pmac_init(r3, r4, r5, r6, r7);
480 break;
481 case _MACH_chrp:
482 chrp_init(r3, r4, r5, r6, r7);
483 break;
487 #ifdef CONFIG_SERIAL_CORE_CONSOLE
488 extern char *of_stdout_device;
490 static int __init set_preferred_console(void)
492 struct device_node *prom_stdout;
493 char *name;
494 int offset = 0;
496 if (of_stdout_device == NULL)
497 return -ENODEV;
499 /* The user has requested a console so this is already set up. */
500 if (strstr(saved_command_line, "console="))
501 return -EBUSY;
503 prom_stdout = find_path_device(of_stdout_device);
504 if (!prom_stdout)
505 return -ENODEV;
507 name = (char *)get_property(prom_stdout, "name", NULL);
508 if (!name)
509 return -ENODEV;
511 if (strcmp(name, "serial") == 0) {
512 int i;
513 u32 *reg = (u32 *)get_property(prom_stdout, "reg", &i);
514 if (i > 8) {
515 switch (reg[1]) {
516 case 0x3f8:
517 offset = 0;
518 break;
519 case 0x2f8:
520 offset = 1;
521 break;
522 case 0x898:
523 offset = 2;
524 break;
525 case 0x890:
526 offset = 3;
527 break;
528 default:
529 /* We dont recognise the serial port */
530 return -ENODEV;
533 } else if (strcmp(name, "ch-a") == 0)
534 offset = 0;
535 else if (strcmp(name, "ch-b") == 0)
536 offset = 1;
537 else
538 return -ENODEV;
539 return add_preferred_console("ttyS", offset, NULL);
541 console_initcall(set_preferred_console);
542 #endif /* CONFIG_SERIAL_CORE_CONSOLE */
543 #endif /* CONFIG_PPC_MULTIPLATFORM */
545 struct bi_record *find_bootinfo(void)
547 struct bi_record *rec;
549 rec = (struct bi_record *)_ALIGN((ulong)__bss_start+(1<<20)-1,(1<<20));
550 if ( rec->tag != BI_FIRST ) {
552 * This 0x10000 offset is a terrible hack but it will go away when
553 * we have the bootloader handle all the relocation and
554 * prom calls -- Cort
556 rec = (struct bi_record *)_ALIGN((ulong)__bss_start+0x10000+(1<<20)-1,(1<<20));
557 if ( rec->tag != BI_FIRST )
558 return NULL;
560 return rec;
563 void parse_bootinfo(struct bi_record *rec)
565 if (rec == NULL || rec->tag != BI_FIRST)
566 return;
567 while (rec->tag != BI_LAST) {
568 ulong *data = rec->data;
569 switch (rec->tag) {
570 case BI_CMD_LINE:
571 strlcpy(cmd_line, (void *)data, sizeof(cmd_line));
572 break;
573 #ifdef CONFIG_BLK_DEV_INITRD
574 case BI_INITRD:
575 initrd_start = data[0] + KERNELBASE;
576 initrd_end = data[0] + data[1] + KERNELBASE;
577 break;
578 #endif /* CONFIG_BLK_DEV_INITRD */
579 #ifdef CONFIG_PPC_MULTIPLATFORM
580 case BI_MACHTYPE:
581 _machine = data[0];
582 break;
583 #endif
584 case BI_MEMSIZE:
585 boot_mem_size = data[0];
586 break;
588 rec = (struct bi_record *)((ulong)rec + rec->size);
593 * Find out what kind of machine we're on and save any data we need
594 * from the early boot process (devtree is copied on pmac by prom_init()).
595 * This is called very early on the boot process, after a minimal
596 * MMU environment has been set up but before MMU_init is called.
598 void __init
599 machine_init(unsigned long r3, unsigned long r4, unsigned long r5,
600 unsigned long r6, unsigned long r7)
602 #ifdef CONFIG_CMDLINE
603 strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
604 #endif /* CONFIG_CMDLINE */
606 #ifdef CONFIG_6xx
607 ppc_md.power_save = ppc6xx_idle;
608 #endif
609 #ifdef CONFIG_POWER4
610 ppc_md.power_save = power4_idle;
611 #endif
613 platform_init(r3, r4, r5, r6, r7);
615 if (ppc_md.progress)
616 ppc_md.progress("id mach(): done", 0x200);
618 #ifdef CONFIG_BOOKE_WDT
619 /* Checks wdt=x and wdt_period=xx command-line option */
620 int __init early_parse_wdt(char *p)
622 extern u32 wdt_enable;
624 if (p && strncmp(p, "0", 1) != 0)
625 wdt_enable = 1;
627 return 0;
629 early_param("wdt", early_parse_wdt);
631 int __init early_parse_wdt_period (char *p)
633 extern u32 wdt_period;
635 if (p)
636 wdt_period = simple_strtoul(p, NULL, 0);
638 return 0;
640 early_param("wdt_period", early_parse_wdt_period);
641 #endif /* CONFIG_BOOKE_WDT */
643 /* Checks "l2cr=xxxx" command-line option */
644 int __init ppc_setup_l2cr(char *str)
646 if (cpu_has_feature(CPU_FTR_L2CR)) {
647 unsigned long val = simple_strtoul(str, NULL, 0);
648 printk(KERN_INFO "l2cr set to %lx\n", val);
649 _set_L2CR(0); /* force invalidate by disable cache */
650 _set_L2CR(val); /* and enable it */
652 return 1;
654 __setup("l2cr=", ppc_setup_l2cr);
656 #ifdef CONFIG_GENERIC_NVRAM
658 /* Generic nvram hooks used by drivers/char/gen_nvram.c */
659 unsigned char nvram_read_byte(int addr)
661 if (ppc_md.nvram_read_val)
662 return ppc_md.nvram_read_val(addr);
663 return 0xff;
665 EXPORT_SYMBOL(nvram_read_byte);
667 void nvram_write_byte(unsigned char val, int addr)
669 if (ppc_md.nvram_write_val)
670 ppc_md.nvram_write_val(addr, val);
672 EXPORT_SYMBOL(nvram_write_byte);
674 void nvram_sync(void)
676 if (ppc_md.nvram_sync)
677 ppc_md.nvram_sync();
679 EXPORT_SYMBOL(nvram_sync);
681 #endif /* CONFIG_NVRAM */
683 static struct cpu cpu_devices[NR_CPUS];
685 int __init ppc_init(void)
687 int i;
689 /* clear the progress line */
690 if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff);
692 /* register CPU devices */
693 for (i = 0; i < NR_CPUS; i++)
694 if (cpu_possible(i))
695 register_cpu(&cpu_devices[i], i, NULL);
697 /* call platform init */
698 if (ppc_md.init != NULL) {
699 ppc_md.init();
701 return 0;
704 arch_initcall(ppc_init);
706 /* Warning, IO base is not yet inited */
707 void __init setup_arch(char **cmdline_p)
709 extern char *klimit;
710 extern void do_init_bootmem(void);
712 /* so udelay does something sensible, assume <= 1000 bogomips */
713 loops_per_jiffy = 500000000 / HZ;
715 #ifdef CONFIG_PPC_MULTIPLATFORM
716 /* This could be called "early setup arch", it must be done
717 * now because xmon need it
719 if (_machine == _MACH_Pmac)
720 pmac_feature_init(); /* New cool way */
721 #endif
723 #ifdef CONFIG_XMON
724 xmon_map_scc();
725 if (strstr(cmd_line, "xmon"))
726 xmon(NULL);
727 #endif /* CONFIG_XMON */
728 if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab);
730 #if defined(CONFIG_KGDB)
731 if (ppc_md.kgdb_map_scc)
732 ppc_md.kgdb_map_scc();
733 set_debug_traps();
734 if (strstr(cmd_line, "gdb")) {
735 if (ppc_md.progress)
736 ppc_md.progress("setup_arch: kgdb breakpoint", 0x4000);
737 printk("kgdb breakpoint activated\n");
738 breakpoint();
740 #endif
743 * Set cache line size based on type of cpu as a default.
744 * Systems with OF can look in the properties on the cpu node(s)
745 * for a possibly more accurate value.
747 if (cpu_has_feature(CPU_FTR_SPLIT_ID_CACHE)) {
748 dcache_bsize = cur_cpu_spec[0]->dcache_bsize;
749 icache_bsize = cur_cpu_spec[0]->icache_bsize;
750 ucache_bsize = 0;
751 } else
752 ucache_bsize = dcache_bsize = icache_bsize
753 = cur_cpu_spec[0]->dcache_bsize;
755 /* reboot on panic */
756 panic_timeout = 180;
758 init_mm.start_code = PAGE_OFFSET;
759 init_mm.end_code = (unsigned long) _etext;
760 init_mm.end_data = (unsigned long) _edata;
761 init_mm.brk = (unsigned long) klimit;
763 /* Save unparsed command line copy for /proc/cmdline */
764 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
765 *cmdline_p = cmd_line;
767 parse_early_param();
769 /* set up the bootmem stuff with available memory */
770 do_init_bootmem();
771 if ( ppc_md.progress ) ppc_md.progress("setup_arch: bootmem", 0x3eab);
773 #ifdef CONFIG_PPC_OCP
774 /* Initialize OCP device list */
775 ocp_early_init();
776 if ( ppc_md.progress ) ppc_md.progress("ocp: exit", 0x3eab);
777 #endif
779 #ifdef CONFIG_DUMMY_CONSOLE
780 conswitchp = &dummy_con;
781 #endif
783 ppc_md.setup_arch();
784 if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
786 paging_init();
788 /* this is for modules since _machine can be a define -- Cort */
789 ppc_md.ppc_machine = _machine;