1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Disable the ARM generic timers before interrupts are enabled. Some

Raspberry Pi firmware images leave them enabled causing an interrupt storm.

Sponsored by:	ABT Systems Ltd
This commit is contained in:
Andrew Turner 2017-09-03 09:41:40 +00:00
parent d7d8ab0316
commit ff6ea3fbc5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323147

View File

@ -249,17 +249,23 @@ arm_tmr_start(struct eventtimer *et, sbintime_t first,
}
static void
arm_tmr_disable(bool physical)
{
int ctrl;
ctrl = get_ctrl(physical);
ctrl &= ~GT_CTRL_ENABLE;
set_ctrl(ctrl, physical);
}
static int
arm_tmr_stop(struct eventtimer *et)
{
struct arm_tmr_softc *sc;
int ctrl;
sc = (struct arm_tmr_softc *)et->et_priv;
ctrl = get_ctrl(sc->physical);
ctrl &= ~GT_CTRL_ENABLE;
set_ctrl(ctrl, sc->physical);
arm_tmr_disable(sc->physical);
return (0);
}
@ -412,6 +418,13 @@ arm_tmr_attach(device_t dev)
}
}
/* Disable the virtual timer until we are ready */
if (sc->res[2] != NULL)
arm_tmr_disable(false);
/* And the physical */
if (sc->physical)
arm_tmr_disable(true);
arm_tmr_timecount.tc_frequency = sc->clkfreq;
tc_init(&arm_tmr_timecount);