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