diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-06-06 16:49:05 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-06-06 16:49:05 +0000 |
commit | 3c572239b00f312e3dbb686d3c88b48ea966186b (patch) | |
tree | c2ceaa072e0e324188ceef72f1bfcc113668934d /sys/arch/arm/cortex/agtimer.c | |
parent | 055b6a4c82a741165cee446a483c624db2818f2c (diff) |
Add some changes from Patrick Wildt in bitrig that are required to make
the qemu cortex a15 useable without trustzone.
Establish the interrupt for the non-secure physical timer (30), in
addition to the secure physical timer (29).
Stop masking the timer output signal in the interrupt handler.
Diffstat (limited to 'sys/arch/arm/cortex/agtimer.c')
-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; |