setup.c (ac98695d6c1508b724f246f38ce57fb4e3cec356) setup.c (5d30bf309717a518d0c4180af41650d4dcd3bb38)
1/*
2 * 64-bit pSeries and RS/6000 setup code.
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu)
7 * Modified by PPC64 Team, IBM Corp
8 *

--- 472 unchanged lines hidden (view full) ---

481
482static int pSeries_pci_probe_mode(struct pci_bus *bus)
483{
484 if (firmware_has_feature(FW_FEATURE_LPAR))
485 return PCI_PROBE_DEVTREE;
486 return PCI_PROBE_NORMAL;
487}
488
1/*
2 * 64-bit pSeries and RS/6000 setup code.
3 *
4 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu)
7 * Modified by PPC64 Team, IBM Corp
8 *

--- 472 unchanged lines hidden (view full) ---

481
482static int pSeries_pci_probe_mode(struct pci_bus *bus)
483{
484 if (firmware_has_feature(FW_FEATURE_LPAR))
485 return PCI_PROBE_DEVTREE;
486 return PCI_PROBE_NORMAL;
487}
488
489/**
490 * pSeries_power_off - tell firmware about how to power off the system.
491 *
492 * This function calls either the power-off rtas token in normal cases
493 * or the ibm,power-off-ups token (if present & requested) in case of
494 * a power failure. If power-off token is used, power on will only be
495 * possible with power button press. If ibm,power-off-ups token is used
496 * it will allow auto poweron after power is restored.
497 */
498void pSeries_power_off(void)
499{
500 int rc;
501 int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");
502
503 if (rtas_flash_term_hook)
504 rtas_flash_term_hook(SYS_POWER_OFF);
505
506 if (rtas_poweron_auto == 0 ||
507 rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
508 rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);
509 printk(KERN_INFO "RTAS power-off returned %d\n", rc);
510 } else {
511 rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
512 printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);
513 }
514 for (;;);
515}
516
489define_machine(pseries) {
490 .name = "pSeries",
491 .probe = pSeries_probe,
492 .setup_arch = pSeries_setup_arch,
493 .init_early = pSeries_init_early,
494 .show_cpuinfo = pSeries_show_cpuinfo,
495 .log_error = pSeries_log_error,
496 .pcibios_fixup = pSeries_final_fixup,
497 .pci_probe_mode = pSeries_pci_probe_mode,
498 .restart = rtas_restart,
517define_machine(pseries) {
518 .name = "pSeries",
519 .probe = pSeries_probe,
520 .setup_arch = pSeries_setup_arch,
521 .init_early = pSeries_init_early,
522 .show_cpuinfo = pSeries_show_cpuinfo,
523 .log_error = pSeries_log_error,
524 .pcibios_fixup = pSeries_final_fixup,
525 .pci_probe_mode = pSeries_pci_probe_mode,
526 .restart = rtas_restart,
499 .power_off = rtas_power_off,
527 .power_off = pSeries_power_off,
500 .halt = rtas_halt,
501 .panic = rtas_os_term,
502 .get_boot_time = rtas_get_boot_time,
503 .get_rtc_time = rtas_get_rtc_time,
504 .set_rtc_time = rtas_set_rtc_time,
505 .calibrate_decr = generic_calibrate_decr,
506 .progress = rtas_progress,
507 .check_legacy_ioport = pSeries_check_legacy_ioport,
508 .system_reset_exception = pSeries_system_reset_exception,
509 .machine_check_exception = pSeries_machine_check_exception,
510};
528 .halt = rtas_halt,
529 .panic = rtas_os_term,
530 .get_boot_time = rtas_get_boot_time,
531 .get_rtc_time = rtas_get_rtc_time,
532 .set_rtc_time = rtas_set_rtc_time,
533 .calibrate_decr = generic_calibrate_decr,
534 .progress = rtas_progress,
535 .check_legacy_ioport = pSeries_check_legacy_ioport,
536 .system_reset_exception = pSeries_system_reset_exception,
537 .machine_check_exception = pSeries_machine_check_exception,
538};