Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/cortex If the "frequency" property is not speci...



details:   https://anonhg.NetBSD.org/src/rev/52898448ea8b
branches:  trunk
changeset: 353905:52898448ea8b
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun May 28 00:29:55 2017 +0000

description:
If the "frequency" property is not specified, try to use the value in
CNTFRQ. Firmware should have already set this for us.

diffstat:

 sys/arch/arm/cortex/gtmr.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 69b3ea50579b -r 52898448ea8b sys/arch/arm/cortex/gtmr.c
--- a/sys/arch/arm/cortex/gtmr.c        Sun May 28 00:28:17 2017 +0000
+++ b/sys/arch/arm/cortex/gtmr.c        Sun May 28 00:29:55 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gtmr.c,v 1.16 2015/04/20 20:19:52 matt Exp $   */
+/*     $NetBSD: gtmr.c,v 1.17 2017/05/28 00:29:55 jmcneill Exp $       */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.16 2015/04/20 20:19:52 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.17 2017/05/28 00:29:55 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -103,7 +103,9 @@
        /*
         * This runs at a fixed frequency of 1 to 50MHz.
         */
-       prop_dictionary_get_uint32(dict, "frequency", &sc->sc_freq);
+       if (!prop_dictionary_get_uint32(dict, "frequency", &sc->sc_freq))
+               sc->sc_freq = armreg_cnt_frq_read();
+
        KASSERT(sc->sc_freq != 0);
 
        humanize_number(freqbuf, sizeof(freqbuf), sc->sc_freq, "Hz", 1000);



Home | Main Index | Thread Index | Old Index