m68knommu: move CPU reset code for the 523x ColdFire into its platform code
authorGreg Ungerer <gerg@uclinux.org>
Thu, 30 Apr 2009 12:58:35 +0000 (22:58 +1000)
committerGreg Ungerer <gerg@uclinux.org>
Thu, 11 Jun 2009 03:09:10 +0000 (13:09 +1000)
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68k/include/asm/m523xsim.h
arch/m68knommu/platform/523x/config.c

index bf39731..55183b5 100644 (file)
 #define        MCFSIM_DACR1            0x50            /* SDRAM base address 1 */
 #define        MCFSIM_DMR1             0x54            /* SDRAM address mask 1 */
 
+/*
+ *  Reset Controll Unit (relative to IPSBAR).
+ */
+#define        MCF_RCR                 0x110000
+#define        MCF_RSR                 0x110001
+
+#define        MCF_RCR_SWRESET         0x80            /* Software reset bit */
+#define        MCF_RCR_FRCSTOUT        0x40            /* Force external reset */
+
 /****************************************************************************/
 #endif /* m523xsim_h */
index 74133f2..961fefe 100644 (file)
@@ -15,7 +15,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>
 
 /***************************************************************************/
 
-void coldfire_reset(void);
-
-/***************************************************************************/
-
 static struct mcf_platform_uart m523x_uart_platform[] = {
        {
                .mapbase        = MCF_MBAR + MCFUART_BASE1,
@@ -145,13 +140,20 @@ void mcf_autovector(unsigned int vec)
 {
        /* Everything is auto-vectored on the 523x */
 }
+/***************************************************************************/
+
+static void m523x_cpu_reset(void)
+{
+       local_irq_disable();
+       __raw_writeb(MCF_RCR_SWRESET, MCF_IPSBAR + MCF_RCR);
+}
 
 /***************************************************************************/
 
 void __init config_BSP(char *commandp, int size)
 {
        mcf_disableall();
-       mach_reset = coldfire_reset;
+       mach_reset = m523x_cpu_reset;
        m523x_uarts_init();
        m523x_fec_init();
 }