diff options
author | zbb <zbb@FreeBSD.org> | 2016-01-20 14:28:05 +0000 |
---|---|---|
committer | zbb <zbb@FreeBSD.org> | 2016-01-20 14:28:05 +0000 |
commit | 19dfb7d6097e39a85c81993232de4cb38127dd4f (patch) | |
tree | 971e9e3d678ca3db191cd6d0ff096fe5e3917a87 | |
parent | 57f3351a9a15f1bc184c5f032544a7a0007ec8b6 (diff) | |
download | FreeBSD-src-19dfb7d6097e39a85c81993232de4cb38127dd4f.zip FreeBSD-src-19dfb7d6097e39a85c81993232de4cb38127dd4f.tar.gz |
Support watchdog depending on "mrvl,has-wdt" property
With this commit, watchdog is supported only in case of having
"mrvl,has-wdt" property or dedicated for watchdog compatibility field
("marvell,armada-380-wdt"). There is no need to modify dts files,
as "has-wdt" property already exists.
Obtained from: Semihalf
Sponsored by: Stormshield
Submitted by: Bartosz Szczepanek <bsz@semihalf.com>
Differential revision: https://reviews.freebsd.org/D4424
-rw-r--r-- | sys/arm/mv/timer.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/arm/mv/timer.c b/sys/arm/mv/timer.c index a363ed4..c0a38ab 100644 --- a/sys/arm/mv/timer.c +++ b/sys/arm/mv/timer.c @@ -76,6 +76,7 @@ struct mv_timer_softc { bus_space_handle_t timer_bsh; struct mtx timer_mtx; struct eventtimer et; + boolean_t has_wdt; }; static struct resource_spec mv_timer_spec[] = { @@ -160,9 +161,15 @@ mv_timer_attach(device_t dev) sc->timer_bst = rman_get_bustag(sc->timer_res[0]); sc->timer_bsh = rman_get_bushandle(sc->timer_res[0]); + sc->has_wdt = ofw_bus_has_prop(dev, "mrvl,has-wdt") || + ofw_bus_is_compatible(dev, "marvell,armada-380-wdt"); + mtx_init(&timer_softc->timer_mtx, "watchdog", NULL, MTX_DEF); - mv_watchdog_disable(); - EVENTHANDLER_REGISTER(watchdog_list, mv_watchdog_event, sc, 0); + + if (sc->has_wdt) { + mv_watchdog_disable(); + EVENTHANDLER_REGISTER(watchdog_list, mv_watchdog_event, sc, 0); + } if (ofw_bus_search_compatible(dev, mv_timer_compat)->ocd_data == MV_WDT) { |