diff options
Diffstat (limited to 'arch/powerpc/platforms/powermac')
-rw-r--r-- | arch/powerpc/platforms/powermac/setup.c | 68 |
1 files changed, 2 insertions, 66 deletions
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c index 840f5b45384d..02c533096627 100644 --- a/arch/powerpc/platforms/powermac/setup.c +++ b/arch/powerpc/platforms/powermac/setup.c | |||
@@ -387,69 +387,13 @@ static void __init pmac_setup_arch(void) | |||
387 | #endif /* CONFIG_ADB */ | 387 | #endif /* CONFIG_ADB */ |
388 | } | 388 | } |
389 | 389 | ||
390 | char *bootpath; | ||
391 | char *bootdevice; | ||
392 | void *boot_host; | ||
393 | int boot_target; | ||
394 | int boot_part; | ||
395 | static dev_t boot_dev; | ||
396 | |||
397 | #ifdef CONFIG_SCSI | 390 | #ifdef CONFIG_SCSI |
398 | void note_scsi_host(struct device_node *node, void *host) | 391 | void note_scsi_host(struct device_node *node, void *host) |
399 | { | 392 | { |
400 | int l; | ||
401 | char *p; | ||
402 | |||
403 | l = strlen(node->full_name); | ||
404 | if (bootpath != NULL && bootdevice != NULL | ||
405 | && strncmp(node->full_name, bootdevice, l) == 0 | ||
406 | && (bootdevice[l] == '/' || bootdevice[l] == 0)) { | ||
407 | boot_host = host; | ||
408 | /* | ||
409 | * There's a bug in OF 1.0.5. (Why am I not surprised.) | ||
410 | * If you pass a path like scsi/sd@1:0 to canon, it returns | ||
411 | * something like /bandit@F2000000/gc@10/53c94@10000/sd@0,0 | ||
412 | * That is, the scsi target number doesn't get preserved. | ||
413 | * So we pick the target number out of bootpath and use that. | ||
414 | */ | ||
415 | p = strstr(bootpath, "/sd@"); | ||
416 | if (p != NULL) { | ||
417 | p += 4; | ||
418 | boot_target = simple_strtoul(p, NULL, 10); | ||
419 | p = strchr(p, ':'); | ||
420 | if (p != NULL) | ||
421 | boot_part = simple_strtoul(p + 1, NULL, 10); | ||
422 | } | ||
423 | } | ||
424 | } | 393 | } |
425 | EXPORT_SYMBOL(note_scsi_host); | 394 | EXPORT_SYMBOL(note_scsi_host); |
426 | #endif | 395 | #endif |
427 | 396 | ||
428 | #if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC) | ||
429 | static dev_t __init find_ide_boot(void) | ||
430 | { | ||
431 | char *p; | ||
432 | int n; | ||
433 | dev_t __init pmac_find_ide_boot(char *bootdevice, int n); | ||
434 | |||
435 | if (bootdevice == NULL) | ||
436 | return 0; | ||
437 | p = strrchr(bootdevice, '/'); | ||
438 | if (p == NULL) | ||
439 | return 0; | ||
440 | n = p - bootdevice; | ||
441 | |||
442 | return pmac_find_ide_boot(bootdevice, n); | ||
443 | } | ||
444 | #endif /* CONFIG_BLK_DEV_IDE && CONFIG_BLK_DEV_IDE_PMAC */ | ||
445 | |||
446 | static void __init find_boot_device(void) | ||
447 | { | ||
448 | #if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC) | ||
449 | boot_dev = find_ide_boot(); | ||
450 | #endif | ||
451 | } | ||
452 | |||
453 | static int initializing = 1; | 397 | static int initializing = 1; |
454 | 398 | ||
455 | static int pmac_late_init(void) | 399 | static int pmac_late_init(void) |
@@ -474,7 +418,6 @@ late_initcall(pmac_late_init); | |||
474 | */ | 418 | */ |
475 | void __init_refok note_bootable_part(dev_t dev, int part, int goodness) | 419 | void __init_refok note_bootable_part(dev_t dev, int part, int goodness) |
476 | { | 420 | { |
477 | static int found_boot = 0; | ||
478 | char *p; | 421 | char *p; |
479 | 422 | ||
480 | if (!initializing) | 423 | if (!initializing) |
@@ -486,15 +429,8 @@ void __init_refok note_bootable_part(dev_t dev, int part, int goodness) | |||
486 | if (p != NULL && (p == boot_command_line || p[-1] == ' ')) | 429 | if (p != NULL && (p == boot_command_line || p[-1] == ' ')) |
487 | return; | 430 | return; |
488 | 431 | ||
489 | if (!found_boot) { | 432 | ROOT_DEV = dev + part; |
490 | find_boot_device(); | 433 | current_root_goodness = goodness; |
491 | found_boot = 1; | ||
492 | } | ||
493 | if (!boot_dev || dev == boot_dev) { | ||
494 | ROOT_DEV = dev + part; | ||
495 | boot_dev = 0; | ||
496 | current_root_goodness = goodness; | ||
497 | } | ||
498 | } | 434 | } |
499 | 435 | ||
500 | #ifdef CONFIG_ADB_CUDA | 436 | #ifdef CONFIG_ADB_CUDA |