Module Name:    src
Committed By:   kiyohara
Date:           Wed Nov 20 12:59:22 UTC 2013

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

Log Message:
Rename marvell_system_reset_old from marvell_system_reset.
And add reset function for ArmadaXP.  It named marvell_system_reset.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 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/evbarm/marvell/marvell_machdep.c
diff -u src/sys/arch/evbarm/marvell/marvell_machdep.c:1.23 src/sys/arch/evbarm/marvell/marvell_machdep.c:1.24
--- src/sys/arch/evbarm/marvell/marvell_machdep.c:1.23	Wed Nov 20 12:52:24 2013
+++ src/sys/arch/evbarm/marvell/marvell_machdep.c	Wed Nov 20 12:59:21 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: marvell_machdep.c,v 1.23 2013/11/20 12:52:24 kiyohara Exp $ */
+/*	$NetBSD: marvell_machdep.c,v 1.24 2013/11/20 12:59:21 kiyohara 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.23 2013/11/20 12:52:24 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: marvell_machdep.c,v 1.24 2013/11/20 12:59:21 kiyohara Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_ddb.h"
@@ -132,20 +132,41 @@ static void marvell_device_register(devi
 static void marvell_startend_by_tag(int, uint64_t *, uint64_t *);
 #endif
 
+#if defined(ORION) || defined(KIRKWOOD) || defined(MV78XX0)
 static void
-marvell_system_reset(void)
+marvell_system_reset_old(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_address = 0;
 	cpu_reset_address_paddr = 0xffff0000;
 	cpu_reset();
 	/*NOTREACHED*/
 }
+#endif
+
+#if defined(ARMADAXP)
+static void
+marvell_system_reset(void)
+{
+
+	/* Unmask soft reset */
+	write_miscreg(MVSOC_MISC_RSTOUTNMASKR,
+	    MVSOC_MISC_RSTOUTNMASKR_GLOBALSOFTRSTOUTEN);
+	/* Assert soft reset */
+	write_miscreg(MVSOC_MISC_SSRR, MVSOC_MISC_SSRR_GLOBALSOFTRST);
+
+	while (1);
+
+	/*NOTREACHED*/
+}
+#endif
+
 
 static inline
 pd_entry_t *
@@ -213,9 +234,6 @@ initarm(void *arg)
 	uint32_t target, attr, base, size;
 	int cs, memtag = 0, iotag = 0, window;
 
-	/* Use the mapped reset routine! */
-	cpu_reset_address = marvell_system_reset;
-
 	mvsoc_bootstrap(MARVELL_INTERREGS_VBASE);
 
 	/*
@@ -265,6 +283,8 @@ initarm(void *arg)
 	case MARVELL_ORION_1_88W8660:
 	case MARVELL_ORION_2_88F1281:
 	case MARVELL_ORION_2_88F5281:
+		cpu_reset_address = marvell_system_reset_old;
+
 		orion_intr_bootstrap();
 
 		memtag = ORION_TAG_PEX0_MEM;
@@ -281,6 +301,8 @@ initarm(void *arg)
 	case MARVELL_KIRKWOOD_88F6192:
 	case MARVELL_KIRKWOOD_88F6281:
 	case MARVELL_KIRKWOOD_88F6282:
+		cpu_reset_address = marvell_system_reset_old;
+
 		kirkwood_intr_bootstrap();
 
 		memtag = KIRKWOOD_TAG_PEX_MEM;
@@ -295,6 +317,8 @@ initarm(void *arg)
 #ifdef MV78XX0
 	case MARVELL_MV78XX0_MV78100:
 	case MARVELL_MV78XX0_MV78200:
+		cpu_reset_address = marvell_system_reset_old;
+
 		mv78xx0_intr_bootstrap();
 
 		memtag = MV78XX0_TAG_PEX0_MEM;
@@ -312,6 +336,8 @@ initarm(void *arg)
 	case MARVELL_ARMADAXP_MV78230:
 	case MARVELL_ARMADAXP_MV78260:
 	case MARVELL_ARMADAXP_MV78460:
+		cpu_reset_address = marvell_system_reset;
+
 		armadaxp_intr_bootstrap(MARVELL_INTERREGS_PBASE);
 
 		memtag = ARMADAXP_TAG_PEX00_MEM;

Reply via email to