m68knommu: move CPU reset code for the 5272 ColdFire into its platform code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 11, 2009 - 8:59 pm

Gitweb:     http://git.kernel.org/linus/05728aec8b05ec3fa859add8b22ba46432611e9e
Commit:     05728aec8b05ec3fa859add8b22ba46432611e9e
Parent:     dd65b1de553ddfd85e8fea9d3aa9db7479ccf2aa
Author:     Greg Ungerer <gerg@uclinux.org>
AuthorDate: Thu Apr 30 23:32:52 2009 +1000
Committer:  Greg Ungerer <gerg@uclinux.org>
CommitDate: Thu Jun 11 13:09:10 2009 +1000

    m68knommu: move CPU reset code for the 5272 ColdFire into its platform code
    
    Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 arch/m68knommu/platform/5272/config.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index e049245..5f95fcd 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/config.c
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/param.h>
 #include <linux/init.h>
-#include <linux/interrupt.h>
 #include <linux/io.h>
 #include <asm/machdep.h>
 #include <asm/coldfire.h>
@@ -21,8 +20,6 @@
 
 /***************************************************************************/
 
-void coldfire_reset(void);
-
 extern unsigned int mcf_timervector;
 extern unsigned int mcf_profilevector;
 extern unsigned int mcf_timerlevel;
@@ -170,6 +167,19 @@ void mcf_settimericr(int timer, int level)
 
 /***************************************************************************/
 
+static void m5272_cpu_reset(void)
+{
+	local_irq_disable();
+	/* Set watchdog to reset, and enabled */
+	__raw_writew(0, MCF_MBAR + MCFSIM_WIRR);
+	__raw_writew(1, MCF_MBAR + MCFSIM_WRRR);
+	__raw_writew(0, MCF_MBAR + MCFSIM_WCR);
+	for (;;)
+		/* wait for watchdog to timeout */;
+}
+
+/***************************************************************************/
+
 void __init config_BSP(char *commandp, int size)
 {
 #if defined (CONFIG_MOD5272)
@@ -194,7 +204,7 @@ void __init config_BSP(char *commandp, int size)
 
 	mcf_timervector = 69;
 	mcf_profilevector = 70;
-	mach_reset = coldfire_reset;
+	mach_reset = m5272_cpu_reset;
 }
 
 /***************************************************************************/
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
m68knommu: move CPU reset code for the 5272 ColdFire into ..., Linux Kernel Mailing ..., (Thu Jun 11, 8:59 pm)