[PATCH] [POWERPC] 40X: Add Default Restart Machdep Method to 40X Platforms

STALE6733d

4 messages, 3 authors, 2008-03-01 · open the first message on its own page

[PATCH] [POWERPC] 40X: Add Default Restart Machdep Method to 40X Platforms

From: Grant Erickson <hidden>
Date: 2008-02-22 23:44:08

This patch restores the reset on restart functionality to 40x-based
platforms that was formerly provided--but not used in arch/powerpc--by
abort() in head_40x.S. This functionality is now provided by
ppc40x_reset_system(char *) in a fashion similar to that of the 44x-based
platforms.

Compiled, linked and tested against the AMCC Haleakala board.

Signed-off-by: Grant Erickson <redacted>
---
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/kernel/head_40x.S
linux-2.6.25-rc2-git1.N/arch/powerpc/kernel/head_40x.S
--- linux-2.6.25-rc2-git1/arch/powerpc/kernel/head_40x.S    2008-01-24
14:58:37.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/kernel/head_40x.S    2008-02-22
11:02:56.000000000 -0800
@@ -961,11 +961,6 @@
 
     blr
 
-_GLOBAL(abort)
-        mfspr   r13,SPRN_DBCR0
-        oris    r13,r13,DBCR0_RST_SYSTEM@h
-        mtspr   SPRN_DBCR0,r13
-
 _GLOBAL(set_context)
 
 #ifdef CONFIG_BDI_SWITCH
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/40x.h
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/40x.h
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/40x.h    1969-12-31
16:00:00.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/40x.h    2008-02-22
11:02:56.000000000 -0800
@@ -0,0 +1,6 @@
+#ifndef __POWERPC_PLATFORMS_40X_40X_H
+#define __POWERPC_PLATFORMS_40X_40X_H
+
+extern void ppc40x_reset_system(char *cmd);
+
+#endif /* __POWERPC_PLATFORMS_40X_40X_H */
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/ep405.c
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/ep405.c
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/ep405.c    2008-02-22
11:07:53.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/ep405.c    2008-02-22
11:02:56.000000000 -0800
@@ -30,6 +30,8 @@
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
 
+#include "40x.h"
+
 static struct device_node *bcsr_node;
 static void __iomem *bcsr_regs;
 
@@ -119,5 +121,6 @@
     .progress        = udbg_progress,
     .init_IRQ        = uic_init_tree,
     .get_irq        = uic_get_irq,
-    .calibrate_decr        = generic_calibrate_decr,
+    .restart        = ppc40x_reset_system,
+    .calibrate_decr    = generic_calibrate_decr,
 };
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/kilauea.c
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/kilauea.c
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/kilauea.c    2008-02-22
11:07:53.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/kilauea.c
2008-02-22 11:02:56.000000000 -0800
@@ -21,6 +21,8 @@
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
 
+#include "40x.h"
+
 static __initdata struct of_device_id kilauea_of_bus[] = {
     { .compatible = "ibm,plb4", },
     { .compatible = "ibm,opb", },
@@ -54,5 +56,6 @@
     .progress             = udbg_progress,
     .init_IRQ             = uic_init_tree,
     .get_irq             = uic_get_irq,
-    .calibrate_decr            = generic_calibrate_decr,
+    .restart            = ppc40x_reset_system,
+    .calibrate_decr        = generic_calibrate_decr,
 };
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/makalu.c
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/makalu.c
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/makalu.c    2008-02-22
11:07:53.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/makalu.c
2008-02-22 11:02:56.000000000 -0800
@@ -21,6 +21,8 @@
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
 
+#include "40x.h"
+
 static __initdata struct of_device_id makalu_of_bus[] = {
     { .compatible = "ibm,plb4", },
     { .compatible = "ibm,opb", },
@@ -54,5 +56,6 @@
     .progress             = udbg_progress,
     .init_IRQ             = uic_init_tree,
     .get_irq             = uic_get_irq,
-    .calibrate_decr            = generic_calibrate_decr,
+    .restart            = ppc40x_reset_system,
+    .calibrate_decr        = generic_calibrate_decr,
 };
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/Makefile
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/Makefile
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/Makefile    2008-02-22
11:07:53.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/Makefile
2008-02-22 11:02:56.000000000 -0800
@@ -1,3 +1,4 @@
+obj-$(CONFIG_40x)                += misc_40x.o
 obj-$(CONFIG_KILAUEA)                += kilauea.o
 obj-$(CONFIG_MAKALU)                += makalu.o
 obj-$(CONFIG_WALNUT)                += walnut.o
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/misc_40x.S
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/misc_40x.S
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/misc_40x.S
1969-12-31 16:00:00.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/misc_40x.S
2008-02-22 15:19:14.000000000 -0800
@@ -0,0 +1,30 @@
+/*
+ * This file contains miscellaneous low-level functions for PPC 40x.
+ *
+ *    Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
+ *    Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ *
+ */
+
+#include <asm/reg.h>
+#include <asm/ppc_asm.h>
+
+    .text
+
+/*
+ * void ppc40x_reset_system(char *cmd)
+ *
+ * At present, this just applies a system reset which, historically, when
+ * this routine existed as '_abort' in head_40x.S was sufficient for most
+ * systems.
+ */
+_GLOBAL(ppc40x_reset_system)
+        mfspr   r13,SPRN_DBCR0
+        oris    r13,r13,DBCR0_RST_SYSTEM@h
+        mtspr   SPRN_DBCR0,r13
+    b    .                /* Just in case reset fails. */
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/virtex.c
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/virtex.c
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/virtex.c    2008-02-22
11:07:53.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/virtex.c
2008-02-22 11:02:56.000000000 -0800
@@ -15,6 +15,8 @@
 #include <asm/time.h>
 #include <asm/xilinx_intc.h>
 
+#include "40x.h"
+
 static struct of_device_id xilinx_of_bus_ids[] __initdata = {
     { .compatible = "xlnx,plb-v46-1.00.a", },
     { .compatible = "xlnx,plb-v34-1.01.a", },
@@ -48,5 +50,6 @@
     .probe            = virtex_probe,
     .init_IRQ        = xilinx_intc_init_tree,
     .get_irq        = xilinx_intc_get_irq,
-    .calibrate_decr        = generic_calibrate_decr,
+    .restart        = ppc40x_reset_system,
+    .calibrate_decr    = generic_calibrate_decr,
 };
diff -rauN linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/walnut.c
linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/walnut.c
--- linux-2.6.25-rc2-git1/arch/powerpc/platforms/40x/walnut.c    2008-02-22
11:07:53.000000000 -0800
+++ linux-2.6.25-rc2-git1.N/arch/powerpc/platforms/40x/walnut.c
2008-02-22 11:02:56.000000000 -0800
@@ -27,6 +27,8 @@
 #include <asm/uic.h>
 #include <asm/pci-bridge.h>
 
+#include "40x.h"
+
 static __initdata struct of_device_id walnut_of_bus[] = {
     { .compatible = "ibm,plb3", },
     { .compatible = "ibm,opb", },
@@ -61,5 +63,6 @@
     .progress        = udbg_progress,
     .init_IRQ        = uic_init_tree,
     .get_irq        = uic_get_irq,
+    .restart        = ppc40x_reset_system,
     .calibrate_decr    = generic_calibrate_decr,
 };

Re: [PATCH] [POWERPC] 40X: Add Default Restart Machdep Method to 40X Platforms

From: Josh Boyer <hidden>
Date: 2008-02-23 16:37:57

On Fri, 22 Feb 2008 15:28:44 -0800
Grant Erickson [off-list ref] wrote:
This patch restores the reset on restart functionality to 40x-based
platforms that was formerly provided--but not used in arch/powerpc--by
abort() in head_40x.S. This functionality is now provided by
ppc40x_reset_system(char *) in a fashion similar to that of the 44x-based
platforms.

Compiled, linked and tested against the AMCC Haleakala board.

Signed-off-by: Grant Erickson <redacted>
This patch is word wrapped.  Seems your mailer decided to eat tabs as
well.

josh

Re: [PATCH] [POWERPC] 40X: Add Default Restart Machdep Method to 40X Platforms

From: Stefan Roese <sr@denx.de>
Date: 2008-03-01 11:33:09

On Saturday 23 February 2008, Grant Erickson wrote:
This patch restores the reset on restart functionality to 40x-based
platforms that was formerly provided--but not used in arch/powerpc--by
abort() in head_40x.S. This functionality is now provided by
ppc40x_reset_system(char *) in a fashion similar to that of the 44x-based
platforms.

Compiled, linked and tested against the AMCC Haleakala board.
Instead of duplicating this code in platform/40x/ which is already present in 
platforms/44x/misc_44x.S, why not move this misc_44x.S code into a common 
place for all 4xx (40x and 44x) PPC's? There seems to be nothing 44x 
specific.

I suggest to introduce platforms/4xx/misc.S or sysdev/ppc4xx_misc.S with these 
functions and change the code referencing it accordingly.

Comments/thoughts?

Best regards,
Stefan

Re: [PATCH] [POWERPC] 40X: Add Default Restart Machdep Method to 40X Platforms

From: Josh Boyer <hidden>
Date: 2008-03-01 13:17:41

On Sat, 1 Mar 2008 12:32:54 +0100
Stefan Roese [off-list ref] wrote:
On Saturday 23 February 2008, Grant Erickson wrote:
quoted
This patch restores the reset on restart functionality to 40x-based
platforms that was formerly provided--but not used in arch/powerpc--by
abort() in head_40x.S. This functionality is now provided by
ppc40x_reset_system(char *) in a fashion similar to that of the 44x-based
platforms.

Compiled, linked and tested against the AMCC Haleakala board.
Instead of duplicating this code in platform/40x/ which is already present in 
platforms/44x/misc_44x.S, why not move this misc_44x.S code into a common 
place for all 4xx (40x and 44x) PPC's? There seems to be nothing 44x 
specific.

I suggest to introduce platforms/4xx/misc.S or sysdev/ppc4xx_misc.S with these 
functions and change the code referencing it accordingly.

Comments/thoughts?
It's a good idea.  I'd rather avoid platforms/4xx for now, but
sysdev/ppc4xx_misc.S seems reasonable.

I'll move it in my tree soon and do the necessary makefile fixups.

josh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help