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 Interrupts are enabled before the timer ...



details:   https://anonhg.NetBSD.org/src/rev/b25d2c6dac1d
branches:  trunk
changeset: 354480:b25d2c6dac1d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jun 17 22:49:37 2017 +0000

description:
Interrupts are enabled before the timer is configured. Ensure that the
timer is disabled when attaching so it doesn't go crazy between the time
interrupts are enabled and clocks are initialized. My RPI3 makes it
multi-user now.

diffstat:

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

diffs (29 lines):

diff -r 3921da65d93d -r b25d2c6dac1d sys/arch/arm/cortex/gtmr.c
--- a/sys/arch/arm/cortex/gtmr.c        Sat Jun 17 22:35:50 2017 +0000
+++ b/sys/arch/arm/cortex/gtmr.c        Sat Jun 17 22:49:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gtmr.c,v 1.17 2017/05/28 00:29:55 jmcneill Exp $       */
+/*     $NetBSD: gtmr.c,v 1.18 2017/06/17 22:49:37 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.17 2017/05/28 00:29:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.18 2017/06/17 22:49:37 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -149,6 +149,10 @@
        gtmr_timecounter.tc_frequency = sc->sc_freq;
 
        tc_init(&gtmr_timecounter);
+
+       /* Disable the timer until we are ready */
+       armreg_cntv_ctl_write(0);
+       armreg_cntp_ctl_write(0);
 }
 
 void



Home | Main Index | Thread Index | Old Index