linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Lynch <ntl@pobox.com>
To: linuxppc-dev@ozlabs.org
Cc: paulus@samba.org
Subject: [PATCH 4/4] maple: use RTAS for reboot and halt
Date: Wed,  6 Dec 2006 18:50:46 -0600	[thread overview]
Message-ID: <11654526562443-git-send-email-ntl@pobox.com> (raw)
In-Reply-To: <11654526533213-git-send-email-ntl@pobox.com>

On maple, use the RTAS "system-reboot" and "power-off" methods if they
are available.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
---
 arch/powerpc/platforms/maple/setup.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 094989d..f12d5c6 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -60,6 +60,7 @@
 #include <asm/of_device.h>
 #include <asm/lmb.h>
 #include <asm/mpic.h>
+#include <asm/rtas.h>
 #include <asm/udbg.h>
 
 #include "maple.h"
@@ -166,6 +167,16 @@ struct smp_ops_t maple_smp_ops = {
 };
 #endif /* CONFIG_SMP */
 
+static void __init maple_use_rtas_reboot_and_halt_if_present(void)
+{
+	if (rtas_service_present("system-reboot") &&
+	    rtas_service_present("power-off")) {
+		ppc_md.restart = rtas_restart;
+		ppc_md.power_off = rtas_power_off;
+		ppc_md.halt = rtas_halt;
+	}
+}
+
 void __init maple_setup_arch(void)
 {
 	/* init to some ~sane value until calibrate_delay() runs */
@@ -181,6 +192,7 @@ void __init maple_setup_arch(void)
 #ifdef CONFIG_DUMMY_CONSOLE
 	conswitchp = &dummy_con;
 #endif
+	maple_use_rtas_reboot_and_halt_if_present();
 
 	printk(KERN_DEBUG "Using native/NAP idle loop\n");
 }
-- 
1.4.4.1

  reply	other threads:[~2006-12-07  1:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-07  0:50 [PATCH 1/4] maple: match "pcie" name for CPC945 Nathan Lynch
2006-12-07  0:50 ` [PATCH 2/4] maple: select PPC_RTAS Nathan Lynch
2006-12-07  0:50   ` [PATCH 3/4] add rtas_service_present() helper Nathan Lynch
2006-12-07  0:50     ` Nathan Lynch [this message]
2006-12-07  2:51     ` Michael Ellerman
2006-12-07  3:25       ` Nathan Lynch
2006-12-07 21:05       ` Linas Vepstas
2006-12-07  3:20 ` [PATCH 1/4] maple: match "pcie" name for CPC945 Olof Johansson
2006-12-07  8:41   ` Segher Boessenkool
2006-12-07  8:30 ` Segher Boessenkool
2006-12-11 22:38   ` Nathan Lynch
2006-12-12 22:26     ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11654526562443-git-send-email-ntl@pobox.com \
    --to=ntl@pobox.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).