diff options
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 89cfaf49d3de..370803722e47 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include <linux/initrd.h> | 22 | #include <linux/initrd.h> |
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/ide.h> | ||
25 | #include <linux/seq_file.h> | 24 | #include <linux/seq_file.h> |
26 | #include <linux/ioport.h> | 25 | #include <linux/ioport.h> |
27 | #include <linux/console.h> | 26 | #include <linux/console.h> |
@@ -304,26 +303,8 @@ struct seq_operations cpuinfo_op = { | |||
304 | void __init check_for_initrd(void) | 303 | void __init check_for_initrd(void) |
305 | { | 304 | { |
306 | #ifdef CONFIG_BLK_DEV_INITRD | 305 | #ifdef CONFIG_BLK_DEV_INITRD |
307 | const unsigned int *prop; | 306 | DBG(" -> check_for_initrd() initrd_start=0x%lx initrd_end=0x%lx\n", |
308 | int len; | 307 | initrd_start, initrd_end); |
309 | |||
310 | DBG(" -> check_for_initrd()\n"); | ||
311 | |||
312 | if (of_chosen) { | ||
313 | prop = get_property(of_chosen, "linux,initrd-start", &len); | ||
314 | if (prop != NULL) { | ||
315 | initrd_start = (unsigned long) | ||
316 | __va(of_read_ulong(prop, len / 4)); | ||
317 | prop = get_property(of_chosen, | ||
318 | "linux,initrd-end", &len); | ||
319 | if (prop != NULL) { | ||
320 | initrd_end = (unsigned long) | ||
321 | __va(of_read_ulong(prop, len / 4)); | ||
322 | initrd_below_start_ok = 1; | ||
323 | } else | ||
324 | initrd_start = 0; | ||
325 | } | ||
326 | } | ||
327 | 308 | ||
328 | /* If we were passed an initrd, set the ROOT_DEV properly if the values | 309 | /* If we were passed an initrd, set the ROOT_DEV properly if the values |
329 | * look sensible. If not, clear initrd reference. | 310 | * look sensible. If not, clear initrd reference. |
@@ -371,11 +352,12 @@ void __init smp_setup_cpu_maps(void) | |||
371 | const int *intserv; | 352 | const int *intserv; |
372 | int j, len = sizeof(u32), nthreads = 1; | 353 | int j, len = sizeof(u32), nthreads = 1; |
373 | 354 | ||
374 | intserv = get_property(dn, "ibm,ppc-interrupt-server#s", &len); | 355 | intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", |
356 | &len); | ||
375 | if (intserv) | 357 | if (intserv) |
376 | nthreads = len / sizeof(int); | 358 | nthreads = len / sizeof(int); |
377 | else { | 359 | else { |
378 | intserv = get_property(dn, "reg", NULL); | 360 | intserv = of_get_property(dn, "reg", NULL); |
379 | if (!intserv) | 361 | if (!intserv) |
380 | intserv = &cpu; /* assume logical == phys */ | 362 | intserv = &cpu; /* assume logical == phys */ |
381 | } | 363 | } |
@@ -398,10 +380,10 @@ void __init smp_setup_cpu_maps(void) | |||
398 | int num_addr_cell, num_size_cell, maxcpus; | 380 | int num_addr_cell, num_size_cell, maxcpus; |
399 | const unsigned int *ireg; | 381 | const unsigned int *ireg; |
400 | 382 | ||
401 | num_addr_cell = prom_n_addr_cells(dn); | 383 | num_addr_cell = of_n_addr_cells(dn); |
402 | num_size_cell = prom_n_size_cells(dn); | 384 | num_size_cell = of_n_size_cells(dn); |
403 | 385 | ||
404 | ireg = get_property(dn, "ibm,lrdr-capacity", NULL); | 386 | ireg = of_get_property(dn, "ibm,lrdr-capacity", NULL); |
405 | 387 | ||
406 | if (!ireg) | 388 | if (!ireg) |
407 | goto out; | 389 | goto out; |
@@ -496,11 +478,39 @@ void probe_machine(void) | |||
496 | printk(KERN_INFO "Using %s machine description\n", ppc_md.name); | 478 | printk(KERN_INFO "Using %s machine description\n", ppc_md.name); |
497 | } | 479 | } |
498 | 480 | ||
481 | /* Match a class of boards, not a specific device configuration. */ | ||
499 | int check_legacy_ioport(unsigned long base_port) | 482 | int check_legacy_ioport(unsigned long base_port) |
500 | { | 483 | { |
501 | if (ppc_md.check_legacy_ioport == NULL) | 484 | struct device_node *parent, *np = NULL; |
502 | return 0; | 485 | int ret = -ENODEV; |
503 | return ppc_md.check_legacy_ioport(base_port); | 486 | |
487 | switch(base_port) { | ||
488 | case I8042_DATA_REG: | ||
489 | np = of_find_node_by_type(NULL, "8042"); | ||
490 | break; | ||
491 | case FDC_BASE: /* FDC1 */ | ||
492 | np = of_find_node_by_type(NULL, "fdc"); | ||
493 | break; | ||
494 | #ifdef CONFIG_PPC_PREP | ||
495 | case _PIDXR: | ||
496 | case _PNPWRP: | ||
497 | case PNPBIOS_BASE: | ||
498 | /* implement me */ | ||
499 | #endif | ||
500 | default: | ||
501 | /* ipmi is supposed to fail here */ | ||
502 | break; | ||
503 | } | ||
504 | if (!np) | ||
505 | return ret; | ||
506 | parent = of_get_parent(np); | ||
507 | if (parent) { | ||
508 | if (strcmp(parent->type, "isa") == 0) | ||
509 | ret = 0; | ||
510 | of_node_put(parent); | ||
511 | } | ||
512 | of_node_put(np); | ||
513 | return ret; | ||
504 | } | 514 | } |
505 | EXPORT_SYMBOL(check_legacy_ioport); | 515 | EXPORT_SYMBOL(check_legacy_ioport); |
506 | 516 | ||