Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/amlogic Don't rely on the existing state of the...



details:   https://anonhg.NetBSD.org/src/rev/6741c673ac71
branches:  trunk
changeset: 450654:6741c673ac71
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Apr 21 13:49:47 2019 +0000

description:
Don't rely on the existing state of the GX watchdog control register when
resetting.

diffstat:

 sys/arch/arm/amlogic/meson_platform.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r ca572572330a -r 6741c673ac71 sys/arch/arm/amlogic/meson_platform.c
--- a/sys/arch/arm/amlogic/meson_platform.c     Sun Apr 21 13:08:48 2019 +0000
+++ b/sys/arch/arm/amlogic/meson_platform.c     Sun Apr 21 13:49:47 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_platform.c,v 1.9 2019/04/21 12:36:39 jmcneill Exp $ */
+/* $NetBSD: meson_platform.c,v 1.10 2019/04/21 13:49:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
 #include "arml2cc.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.9 2019/04/21 12:36:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_platform.c,v 1.10 2019/04/21 13:49:47 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -81,7 +81,9 @@
 #define        MESONGX_WATCHDOG_BASE   0xc11098d0
 #define        MESONGX_WATCHDOG_SIZE   0x10
 #define         MESONGX_WATCHDOG_CNTL  0x00
-#define          MESONGX_WATCHDOG_CNTL_WDOG_EN __BIT(18)
+#define          MESONGX_WATCHDOG_CNTL_CLK_EN          __BIT(24)
+#define          MESONGX_WATCHDOG_CNTL_SYS_RESET_N_EN  __BIT(21)
+#define          MESONGX_WATCHDOG_CNTL_WDOG_EN         __BIT(18)
 #define         MESONGX_WATCHDOG_CNTL1 0x04
 #define         MESONGX_WATCHDOG_TCNT  0x08
 #define          MESONGX_WATCHDOG_TCNT_COUNT   __BITS(15,0)
@@ -463,8 +465,9 @@
 
        bus_space_map(bst, MESONGX_WATCHDOG_BASE, MESONGX_WATCHDOG_SIZE, 0, &bsh);
 
-       val = bus_space_read_4(bst, bsh, MESONGX_WATCHDOG_CNTL);
-       val |= MESONGX_WATCHDOG_CNTL_WDOG_EN;
+       val = MESONGX_WATCHDOG_CNTL_SYS_RESET_N_EN |
+             MESONGX_WATCHDOG_CNTL_WDOG_EN |
+             MESONGX_WATCHDOG_CNTL_CLK_EN;
        bus_space_write_4(bst, bsh, MESONGX_WATCHDOG_CNTL, val);
 
        bus_space_write_4(bst, bsh, MESONGX_WATCHDOG_TCNT, 1);



Home | Main Index | Thread Index | Old Index