linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH 9/13] Factor zImage's 44x reset code out of ebony.c
Date: Wed, 13 Jun 2007 14:52:58 +1000 (EST)	[thread overview]
Message-ID: <20070613045259.56CF4DDF12@ozlabs.org> (raw)
In-Reply-To: <20070613045031.GD16148@localhost.localdomain>

The ebony_exit() function which resets the Ebony board should in fact
be common to most if not all 44x boards.  This patch moves the
function out into 44x.c, renaming it, so it can be used by other 44x
platforms.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---

 arch/powerpc/boot/44x.c   |   16 ++++++++++++++++
 arch/powerpc/boot/44x.h   |    2 ++
 arch/powerpc/boot/ebony.c |   18 +-----------------
 3 files changed, 19 insertions(+), 17 deletions(-)

Index: working-2.6/arch/powerpc/boot/44x.c
===================================================================
--- working-2.6.orig/arch/powerpc/boot/44x.c	2007-05-08 15:07:45.000000000 +1000
+++ working-2.6/arch/powerpc/boot/44x.c	2007-05-16 16:45:01.000000000 +1000
@@ -38,3 +38,19 @@ void ibm44x_fixup_memsize(void)
 
 	dt_fixup_memory(0, memsize);
 }
+
+#define SPRN_DBCR0		0x134
+#define   DBCR0_RST_SYSTEM	0x30000000
+
+void ibm44x_dbcr_reset(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)
+		);
+
+}
Index: working-2.6/arch/powerpc/boot/44x.h
===================================================================
--- working-2.6.orig/arch/powerpc/boot/44x.h	2007-05-08 15:07:45.000000000 +1000
+++ working-2.6/arch/powerpc/boot/44x.h	2007-05-16 16:45:01.000000000 +1000
@@ -11,6 +11,8 @@
 #define _PPC_BOOT_44X_H_
 
 void ibm44x_fixup_memsize(void);
+
+void ibm44x_dbcr_reset(void);
 void ebony_init(void *mac0, void *mac1);
 
 #endif /* _PPC_BOOT_44X_H_ */
Index: working-2.6/arch/powerpc/boot/ebony.c
===================================================================
--- working-2.6.orig/arch/powerpc/boot/ebony.c	2007-05-08 15:07:45.000000000 +1000
+++ working-2.6/arch/powerpc/boot/ebony.c	2007-05-16 16:45:00.000000000 +1000
@@ -102,26 +102,10 @@ static void ebony_fixups(void)
 	dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
 }
 
-#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 ebony_init(void *mac0, void *mac1)
 {
 	platform_ops.fixups = ebony_fixups;
-	platform_ops.exit = ebony_exit;
+	platform_ops.exit = ibm44x_dbcr_reset;
 	ebony_mac0 = mac0;
 	ebony_mac1 = mac1;
 	ft_init(_dtb_start, _dtb_end - _dtb_start, 32);

  parent reply	other threads:[~2007-06-13  4:52 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13  4:50 [0/13] Queued patches for 2.6.13 David Gibson
2007-06-13  4:52 ` [PATCH 1/13] Split low-level OF-related bootloader code into separate files David Gibson
2007-06-13  4:52 ` [PATCH 2/13] Split out asm-ppc/mmu.h portions for the "classic" hash-based MMU David Gibson
2007-06-13  4:52 ` [PATCH 3/13] Abolish iopa(), mm_ptov(), io_block_mapping() from arch/powerpc David Gibson
2007-06-16  0:55   ` Benjamin Herrenschmidt
2007-06-13  4:52 ` [PATCH 4/13] Remove the dregs of APUS support " David Gibson
2007-06-13  4:52 ` [PATCH 7/13] Kill typedef-ed structs for hash PTEs and BATs David Gibson
2007-06-13  4:52 ` [PATCH 5/13] Remove a couple of unused definitions from pgtable_32.c David Gibson
2007-06-14 21:04   ` Kumar Gala
2007-06-14 21:50     ` Andy Fleming
2007-06-15 15:40       ` Kumar Gala
2007-06-13  4:52 ` [PATCH 6/13] Start factoring pgtable-ppc32.h and pgtable-ppc64.h David Gibson
2007-06-14 14:05   ` Segher Boessenkool
2007-06-13  4:52 ` [PATCH 8/13] Merge CPU features pertaining to icache coherency David Gibson
2007-06-13  4:52 ` David Gibson [this message]
2007-06-13  4:52 ` [PATCH 10/13] Derive ebc ranges property from EBC registers David Gibson
2007-06-14 14:12   ` Segher Boessenkool
2007-06-14 14:14   ` Segher Boessenkool
2007-06-13  4:53 ` [PATCH 11/13] Consolidate cuboot initialization code David Gibson
2007-06-13  4:53 ` [PATCH 13/13] Fix problems with device tree representation of TSI-1xx bridges David Gibson
2007-06-14 14:24   ` Segher Boessenkool
2007-06-13  4:53 ` [PATCH 12/13] Don't store a command line in the Holly device tree David Gibson
2007-06-13  5:10 ` [0/13] Queued patches for 2.6.13 Segher Boessenkool
2007-06-13  6:09 ` [0/13] Queued patches for 2.6.23 David Gibson

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=20070613045259.56CF4DDF12@ozlabs.org \
    --to=david@gibson.dropbear.id.au \
    --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).