From: David Gibson <david@gibson.dropbear.id.au>
To: <linuxppc-dev@ozlabs.org>
Subject: [PATCH 15/15] Add support for reset on Ebony
Date: Mon, 5 Mar 2007 14:24:53 +1100 (EST) [thread overview]
Message-ID: <20070305032453.8CA47DDF18@ozlabs.org> (raw)
In-Reply-To: <20070305032307.GB31417@localhost.localdomain>
This patch implements the appropriate hooks to allow both the kernel
and the zImage wrapper to reboot an Ebony. In the process we move the
low-level abort() function from head_44x.S to misc_44x.S and rename it
something clearer.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
---
arch/powerpc/boot/ebony.c | 17 +++++++++++++++++
arch/powerpc/kernel/head_44x.S | 10 ----------
arch/powerpc/platforms/4xx/44x.h | 1 +
arch/powerpc/platforms/4xx/ebony.c | 2 ++
arch/powerpc/platforms/4xx/misc_44x.S | 10 ++++++++++
5 files changed, 30 insertions(+), 10 deletions(-)
Index: working-2.6/arch/powerpc/kernel/head_44x.S
===================================================================
--- working-2.6.orig/arch/powerpc/kernel/head_44x.S 2007-03-02 17:19:37.000000000 +1100
+++ working-2.6/arch/powerpc/kernel/head_44x.S 2007-03-02 17:19:38.000000000 +1100
@@ -701,16 +701,6 @@ _GLOBAL(giveup_fpu)
blr
#endif
-/*
- * extern void abort(void)
- *
- * At present, this routine just applies a system reset.
- */
-_GLOBAL(abort)
- mfspr r13,SPRN_DBCR0
- oris r13,r13,DBCR0_RST_SYSTEM@h
- mtspr SPRN_DBCR0,r13
-
_GLOBAL(set_context)
#ifdef CONFIG_BDI_SWITCH
Index: working-2.6/arch/powerpc/platforms/4xx/misc_44x.S
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/4xx/misc_44x.S 2007-03-02 17:19:37.000000000 +1100
+++ working-2.6/arch/powerpc/platforms/4xx/misc_44x.S 2007-03-02 17:19:38.000000000 +1100
@@ -44,3 +44,13 @@ _GLOBAL(as1_writeb)
sync
isync
blr
+
+/*
+ * void ppc44x_reset_system(char *cmd)
+ *
+ * At present, this routine just applies a system reset.
+ */
+_GLOBAL(ppc44x_reset_system)
+ mfspr r13,SPRN_DBCR0
+ oris r13,r13,DBCR0_RST_SYSTEM@h
+ mtspr SPRN_DBCR0,r13
Index: working-2.6/arch/powerpc/platforms/4xx/44x.h
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/4xx/44x.h 2007-03-02 17:19:37.000000000 +1100
+++ working-2.6/arch/powerpc/platforms/4xx/44x.h 2007-03-02 17:19:38.000000000 +1100
@@ -3,6 +3,7 @@
extern u8 as1_readb(volatile u8 __iomem *addr);
extern void as1_writeb(u8 data, volatile u8 __iomem *addr);
+extern void ppc44x_reset_system(char *cmd);
#endif /* __POWERPC_PLATFORMS_4XX_44X_H */
Index: working-2.6/arch/powerpc/platforms/4xx/ebony.c
===================================================================
--- working-2.6.orig/arch/powerpc/platforms/4xx/ebony.c 2007-03-02 17:19:37.000000000 +1100
+++ working-2.6/arch/powerpc/platforms/4xx/ebony.c 2007-03-02 17:19:38.000000000 +1100
@@ -23,6 +23,7 @@
#include <asm/time.h>
#include <asm/uic.h>
#include <asm/of_platform.h>
+#include "44x.h"
static struct of_device_id ebony_of_bus[] = {
{ .type = "ibm,plb", },
@@ -65,5 +66,6 @@ define_machine(ebony) {
.progress = udbg_progress,
.init_IRQ = uic_init_tree,
.get_irq = uic_get_irq,
+ .restart = ppc44x_reset_system,
.calibrate_decr = generic_calibrate_decr,
};
Index: working-2.6/arch/powerpc/boot/ebony.c
===================================================================
--- working-2.6.orig/arch/powerpc/boot/ebony.c 2007-03-02 17:19:39.000000000 +1100
+++ working-2.6/arch/powerpc/boot/ebony.c 2007-03-02 17:30:23.000000000 +1100
@@ -177,11 +177,28 @@ static void ebony_fixups(void)
mac1, 6);
}
+#define SPRN_DBCR0 0x134
+#define DBCR0_RST_SYSTEM 0x30000000
+
+static void ebony_exit(void)
+{
+ unsigned long tmp;
+
+ asm volatile (
+ "mfspr %0,%1\n"
+ "oris %0,%0,%2@h\n"
+ "mtspr %1,%0"
+ : "=&r"(tmp) : "i"(SPRN_DBCR0), "i"(DBCR0_RST_SYSTEM)
+ );
+
+}
+
void platform_init(unsigned long r3, unsigned long r4, unsigned long r5)
{
u32 heapsize = 0x8000000 - (u32)_end; /* 128M */
platform_ops.fixups = ebony_fixups;
+ platform_ops.exit = ebony_exit;
simple_alloc_init(_end, heapsize, 32, 64);
ft_init(_dtb_start, 0, 32);
serial_console_init();
next prev parent reply other threads:[~2007-03-05 3:24 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-05 3:23 [0/15] Ebony support, spin 3 David Gibson
2007-03-05 3:24 ` [PATCH 1/15] powerpc: Allow duplicate lmb_reserve() calls David Gibson
2007-03-05 3:24 ` [PATCH 3/15] Define FIXED_PORT flag for serial_core David Gibson
2007-03-05 3:24 ` [PATCH 2/15] Automatically lmb_reserve() initrd David Gibson
2007-04-18 11:43 ` Uytterhoeven, Geert
2007-03-05 3:24 ` [PATCH 10/15] Add device tree for Ebony David Gibson
2007-03-05 14:23 ` Josh Boyer
2007-03-06 0:04 ` David Gibson
2007-03-05 3:24 ` [PATCH 6/15] zImage: Add more flexible gunzip convenience functions David Gibson
2007-03-16 16:24 ` Geoff Levand
2007-03-17 12:59 ` David Gibson
2007-03-05 3:24 ` [PATCH 9/15] Add arch/powerpc driver for UIC, PPC4xx interrupt controller David Gibson
2007-03-05 3:24 ` [PATCH 8/15] zImage: Cleanup and improve zImage entry point David Gibson
2007-03-15 22:35 ` Mark A. Greer
2007-03-16 0:14 ` David Gibson
2007-03-16 1:01 ` Mark A. Greer
2007-03-16 1:50 ` David Gibson
2007-03-16 3:36 ` Mark A. Greer
2007-03-20 20:20 ` Mark A. Greer
2007-03-15 23:02 ` Mark A. Greer
2007-03-16 0:18 ` David Gibson
2007-03-16 0:47 ` Mark A. Greer
2007-03-16 0:50 ` David Gibson
2007-03-16 3:45 ` Mark A. Greer
2007-03-16 4:02 ` David Gibson
2007-03-16 16:21 ` Scott Wood
2007-03-17 1:38 ` David Gibson
2007-03-17 3:15 ` Geoff Levand
2007-03-19 15:06 ` Scott Wood
2007-03-20 0:45 ` David Gibson
2007-03-05 3:24 ` [PATCH 4/15] Use resource_size_t for serial port IO addresses David Gibson
2007-03-05 3:24 ` [PATCH 11/15] zImage wrapper for Ebony David Gibson
2007-03-05 17:10 ` Mark A. Greer
2007-03-06 0:09 ` David Gibson
2007-03-07 19:47 ` Scott Wood
2007-03-08 0:24 ` David Gibson
2007-03-08 0:54 ` Mark A. Greer
2007-03-08 1:35 ` Josh Boyer
2007-03-09 17:50 ` Josh Boyer
2007-03-10 4:08 ` David Gibson
2007-03-05 3:24 ` [PATCH 5/15] Re-organize Kconfig code for 4xx in arch/powerpc David Gibson
2007-03-05 3:24 ` [PATCH 7/15] zImage: Cleanup and improve prep_kernel() David Gibson
2007-03-05 3:24 ` David Gibson [this message]
2007-03-05 3:24 ` [PATCH 14/15] Early serial debug support for PPC44x David Gibson
2007-03-08 19:44 ` Josh Boyer
2007-03-09 17:42 ` Josh Boyer
2007-03-09 23:43 ` David Gibson
2007-03-05 3:24 ` [PATCH 12/15] Support for Ebony in arch/powerpc David Gibson
2007-03-05 3:24 ` [PATCH 13/15] Port 44x MMU definitions to ARCH=powerpc David Gibson
2007-03-05 8:02 ` Real time clock support in arch/powerpc Zang Roy-r61911
2007-03-05 15:10 ` Kumar Gala
2007-03-05 17:04 ` Mark A. Greer
2007-03-05 13:57 ` [0/15] Ebony support, spin 3 Josh Boyer
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=20070305032453.8CA47DDF18@ozlabs.org \
--to=david@gibson.dropbear.id.au \
--cc=linuxppc-dev@ozlabs.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).