Module Name:    src
Committed By:   jakllsch
Date:           Tue Feb  1 22:54:24 UTC 2011

Modified Files:
        src/sys/arch/arm/marvell: mvsocreg.h
        src/sys/arch/evbarm/marvell: marvell_machdep.c

Log Message:
Address 3rd issue in PR#43990.
Different implementation but same method as suggested.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/marvell/mvsocreg.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/evbarm/marvell/marvell_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/marvell/mvsocreg.h
diff -u src/sys/arch/arm/marvell/mvsocreg.h:1.1 src/sys/arch/arm/marvell/mvsocreg.h:1.2
--- src/sys/arch/arm/marvell/mvsocreg.h:1.1	Sun Oct  3 05:49:24 2010
+++ src/sys/arch/arm/marvell/mvsocreg.h	Tue Feb  1 22:54:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsocreg.h,v 1.1 2010/10/03 05:49:24 kiyohara Exp $	*/
+/*	$NetBSD: mvsocreg.h,v 1.2 2011/02/01 22:54:24 jakllsch Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -102,7 +102,11 @@
 #define MVSOC_MLMB_CPUCR		  0x100	/* CPU Configuration Register */
 #define MVSOC_MLMB_CPUCSR		  0x104	/* CPU Control/Status Register*/
 #define MVSOC_MLMB_RSTOUTNMASKR		  0x108 /* RSTOUTn Mask Register */
+#define MVSOC_MLMB_RSTOUTNMASKR_PEXRSTOUTEN     (1 << 0)
+#define MVSOC_MLMB_RSTOUTNMASKR_WDRSTOUTEN      (1 << 1)
+#define MVSOC_MLMB_RSTOUTNMASKR_SOFTRSTOUTEN    (1 << 2)
 #define MVSOC_MLMB_SSRR			  0x10c	/* System Soft Reset Register */
+#define MVSOC_MLMB_SSRR_SYSTEMSOFTRST           (1 << 0)
 #define MVSOC_MLMB_MLMBICR		  0x110	/*Mb-L to Mb Bridge Intr Cause*/
 #define MVSOC_MLMB_MLMBIMR		  0x114	/*Mb-L to Mb Bridge Intr Mask */
 

Index: src/sys/arch/evbarm/marvell/marvell_machdep.c
diff -u src/sys/arch/evbarm/marvell/marvell_machdep.c:1.2 src/sys/arch/evbarm/marvell/marvell_machdep.c:1.3
--- src/sys/arch/evbarm/marvell/marvell_machdep.c:1.2	Tue Feb  1 22:36:41 2011
+++ src/sys/arch/evbarm/marvell/marvell_machdep.c	Tue Feb  1 22:54:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvell_machdep.c,v 1.2 2011/02/01 22:36:41 jakllsch Exp $ */
+/*	$NetBSD: marvell_machdep.c,v 1.3 2011/02/01 22:54:24 jakllsch Exp $ */
 /*
  * Copyright (c) 2007, 2008, 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: marvell_machdep.c,v 1.2 2011/02/01 22:36:41 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: marvell_machdep.c,v 1.3 2011/02/01 22:54:24 jakllsch Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_ddb.h"
@@ -175,6 +175,18 @@
 static void marvell_startend_by_tag(int, uint64_t *, uint64_t *);
 #endif
 
+static void
+marvell_system_reset(void)
+{
+	/* unmask soft reset */
+	write_mlmbreg(MVSOC_MLMB_RSTOUTNMASKR,
+	    MVSOC_MLMB_RSTOUTNMASKR_SOFTRSTOUTEN);
+	/* assert soft reset */
+	write_mlmbreg(MVSOC_MLMB_SSRR, MVSOC_MLMB_SSRR_SYSTEMSOFTRST);
+	/* if we're still running, jump to the reset address */
+	cpu_reset();
+	/*NOTREACHED*/
+}
 
 void
 cpu_reboot(int howto, char *bootstr)
@@ -190,7 +202,7 @@
 		printf("Please press any key to reboot.\r\n");
 		cngetc();
 		printf("rebooting...\r\n");
-		cpu_reset();
+		marvell_system_reset();
 	}
 
 	/*
@@ -223,7 +235,7 @@
 	}
 
 	printf("rebooting...\r\n");
-	cpu_reset();
+	marvell_system_reset();
 
 	/*NOTREACHED*/
 }

Reply via email to