Source-Changes-HG archive

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

[src/trunk]: src/sys/arch undo 'typo' fix and restore 'frequency' to dictionary



details:   https://anonhg.NetBSD.org/src/rev/d06d4b656b34
branches:  trunk
changeset: 812408:d06d4b656b34
user:      marty <marty%NetBSD.org@localhost>
date:      Sun Dec 13 22:28:09 2015 +0000

description:
undo 'typo' fix and restore 'frequency' to dictionary

Oops.  The 'typo' was elsewhere and I accidently removed setting
the frequency.  Fix that.

diffstat:

 sys/arch/arm/samsung/exynos_wdt.c       |  13 ++++++-------
 sys/arch/evbarm/exynos/exynos_machdep.c |   7 +++++--
 2 files changed, 11 insertions(+), 9 deletions(-)

diffs (91 lines):

diff -r f194757db6f8 -r d06d4b656b34 sys/arch/arm/samsung/exynos_wdt.c
--- a/sys/arch/arm/samsung/exynos_wdt.c Sun Dec 13 22:05:52 2015 +0000
+++ b/sys/arch/arm/samsung/exynos_wdt.c Sun Dec 13 22:28:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exynos_wdt.c,v 1.6 2015/12/10 21:56:04 marty Exp $     */
+/*     $NetBSD: exynos_wdt.c,v 1.7 2015/12/13 22:28:09 marty Exp $     */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "exynos_wdt.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_wdt.c,v 1.6 2015/12/10 21:56:04 marty Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_wdt.c,v 1.7 2015/12/13 22:28:09 marty Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -54,10 +54,10 @@
 static void exynos_wdt_attach(device_t, device_t, void *);
 
 struct exynos_wdt_softc {
-       struct sysmon_wdog sc_smw;
        device_t sc_dev;
        bus_space_tag_t sc_bst;
        bus_space_handle_t sc_wdog_bsh;
+       struct sysmon_wdog sc_smw;
        u_int sc_wdog_period;
        u_int sc_wdog_clock_select;
        u_int sc_wdog_prescaler;
@@ -68,7 +68,7 @@
 };
 
 #ifndef EXYNOS_WDT_PERIOD_DEFAULT
-#define        EXYNOS_WDT_PERIOD_DEFAULT       12
+#define        EXYNOS_WDT_PERIOD_DEFAULT       60
 #endif
 
 CFATTACH_DECL_NEW(exynos_wdt, sizeof(struct exynos_wdt_softc),
@@ -189,13 +189,12 @@
         * This runs at the Exynos Pclk.
         */
        prop_dictionary_get_uint32(dict, "frequency", &sc->sc_freq);
-
        sc->sc_wdog_wtcon = exynos_wdt_wdog_read(sc, EXYNOS_WDT_WTCON);
        sc->sc_wdog_armed = (sc->sc_wdog_wtcon & WTCON_ENABLE)
            && (sc->sc_wdog_wtcon & WTCON_RESET_ENABLE);
        if (sc->sc_wdog_armed) {
                sc->sc_wdog_prescaler =
-                   __SHIFTOUT(sc->sc_wdog_wtcon, WTCON_PRESCALER) + 1;
+                   __SHIFTOUT(sc->sc_wdog_wtcon, WTCON_PRESCALER);
                sc->sc_wdog_clock_select =
                    __SHIFTOUT(sc->sc_wdog_wtcon, WTCON_CLOCK_SELECT);
                sc->sc_freq /= sc->sc_wdog_prescaler;
@@ -203,7 +202,7 @@
                sc->sc_wdog_wtdat = exynos_wdt_wdog_read(sc, EXYNOS_WDT_WTDAT);
                sc->sc_wdog_period = (sc->sc_wdog_wtdat + 1) / sc->sc_freq;
        } else {
-               sc->sc_wdog_period = EXYNOS_WDT_DEFAULT_PERIOD;
+               sc->sc_wdog_period = EXYNOS_WDT_PERIOD_DEFAULT;
                sc->sc_wdog_prescaler = 1;
                /*
                 * Let's see what clock select we should use.
diff -r f194757db6f8 -r d06d4b656b34 sys/arch/evbarm/exynos/exynos_machdep.c
--- a/sys/arch/evbarm/exynos/exynos_machdep.c   Sun Dec 13 22:05:52 2015 +0000
+++ b/sys/arch/evbarm/exynos/exynos_machdep.c   Sun Dec 13 22:28:09 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exynos_machdep.c,v 1.2 2015/12/11 04:12:21 marty Exp $ */
+/*     $NetBSD: exynos_machdep.c,v 1.3 2015/12/13 22:28:09 marty Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_machdep.c,v 1.2 2015/12/11 04:12:21 marty Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_machdep.c,v 1.3 2015/12/13 22:28:09 marty Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_exynos.h"
@@ -515,6 +515,9 @@
        exynos_device_register(self, aux);
        if (device_is_a(self, "exyogpio")) {
                init_gpio_dictionary(gpio_pin_entries, dict);
+       } else if (device_is_a(self, "exyowdt")) {
+               prop_dictionary_set_uint32(dict, "frequency",
+                                          EXYNOS_F_IN_FREQ);
        }
 }
 



Home | Main Index | Thread Index | Old Index