diff --git a/sys/arch/arm/marvell/mvsocreg.h b/sys/arch/arm/marvell/mvsocreg.h index f126fe4312c1..7169fe558160 100644 --- a/sys/arch/arm/marvell/mvsocreg.h +++ b/sys/arch/arm/marvell/mvsocreg.h @@ -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 */ diff --git a/sys/arch/evbarm/marvell/marvell_machdep.c b/sys/arch/evbarm/marvell/marvell_machdep.c index adb32583a145..7a4606425826 100644 --- a/sys/arch/evbarm/marvell/marvell_machdep.c +++ b/sys/arch/evbarm/marvell/marvell_machdep.c @@ -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 -__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_device_register(device_t, void *); 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 @@ cpu_reboot(int howto, char *bootstr) printf("Please press any key to reboot.\r\n"); cngetc(); printf("rebooting...\r\n"); - cpu_reset(); + marvell_system_reset(); } /* @@ -223,7 +235,7 @@ cpu_reboot(int howto, char *bootstr) } printf("rebooting...\r\n"); - cpu_reset(); + marvell_system_reset(); /*NOTREACHED*/ }