From: jsg Date: Sat, 6 Jun 2015 16:49:04 +0000 (+0000) Subject: Add some changes from Patrick Wildt in bitrig that are required to make X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bae369c3855da17aafd684d31eea8799b7626972;p=openbsd 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. --- 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 * Copyright (c) 2013 Patrick Wildt @@ -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;