diff options
-rw-r--r-- | sys/arch/arm/cortex/agtimer.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/arch/arm/cortex/agtimer.c b/sys/arch/arm/cortex/agtimer.c index 8aa6da3a8f4..17d1d18a2be 100644 --- a/sys/arch/arm/cortex/agtimer.c +++ b/sys/arch/arm/cortex/agtimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agtimer.c,v 1.3 2015/05/29 05:48:07 jsg Exp $ */ +/* $OpenBSD: agtimer.c,v 1.4 2015/06/06 16:49:04 jsg Exp $ */ /* * Copyright (c) 2011 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2013 Patrick Wildt <patrick@blueri.se> @@ -203,7 +203,7 @@ agtimer_intr(void *frame) struct agtimer_pcpu_softc *pc = &sc->sc_pstat[CPU_INFO_UNIT(curcpu())]; uint64_t now; uint64_t nextevent; - uint32_t r, reg; + uint32_t r; #if defined(USE_GTIMER_CMP) int skip = 1; #else @@ -261,12 +261,6 @@ agtimer_intr(void *frame) agtimer_set_tval(delay); - reg = agtimer_get_ctrl(); - if (reg & GTIMER_CNTP_CTL_ISTATUS) { - reg |= GTIMER_CNTP_CTL_IMASK; - agtimer_set_ctrl(reg); - } - return (rc); } @@ -309,8 +303,13 @@ agtimer_cpu_initclocks() /* establish interrupts */ /* XXX - irq */ + + /* secure physical timer */ ampintc_intr_establish(29, IPL_CLOCK, agtimer_intr, NULL, "tick"); + /* non-secure physical timer */ + ampintc_intr_establish(30, IPL_CLOCK, agtimer_intr, + NULL, "tick"); next = agtimer_readcnt64(sc) + sc->sc_ticks_per_intr; pc->pc_nexttickevent = pc->pc_nextstatevent = next; |