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 Enable the global timer at attach time, ...



details:   https://anonhg.NetBSD.org/src/rev/8cb3b31968d5
branches:  trunk
changeset: 836642:8cb3b31968d5
user:      aymeric <aymeric%NetBSD.org@localhost>
date:      Sun Oct 28 21:08:13 2018 +0000

description:
Enable the global timer at attach time, it ensures that delay() works.

diffstat:

 sys/arch/arm/cortex/a9tmr.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 92e449de69fc -r 8cb3b31968d5 sys/arch/arm/cortex/a9tmr.c
--- a/sys/arch/arm/cortex/a9tmr.c       Sun Oct 28 18:26:52 2018 +0000
+++ b/sys/arch/arm/cortex/a9tmr.c       Sun Oct 28 21:08:13 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: a9tmr.c,v 1.17 2018/10/14 19:01:00 aymeric Exp $       */
+/*     $NetBSD: a9tmr.c,v 1.18 2018/10/28 21:08:13 aymeric Exp $       */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.17 2018/10/14 19:01:00 aymeric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9tmr.c,v 1.18 2018/10/28 21:08:13 aymeric Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -150,6 +150,9 @@
        bus_space_subregion(sc->sc_memt, sc->sc_memh,
            mpcaa->mpcaa_off1, TMR_GLOBAL_SIZE, &sc->sc_global_memh);
 
+       /* Enable the timer early for delay(), disable all other features */
+       a9tmr_global_write(sc, TMR_GBL_CTL, TMR_CTL_ENABLE);
+
        if (mpcaa->mpcaa_irq != -1) {
                sc->sc_global_ih = intr_establish(mpcaa->mpcaa_irq, IPL_CLOCK,
                    IST_EDGE | IST_MPSAFE, a9tmr_intr, NULL);



Home | Main Index | Thread Index | Old Index