diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-11-27 06:29:42 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-11-27 06:29:42 +0000 |
commit | d0eb47a2f6a6ea75161637f9dfd8bd93ec5d2bad (patch) | |
tree | 057ec42536099b469ae182faae94853bddba9083 /sys | |
parent | 018038fa32e9f041ec1fede3aa3f3982bee91177 (diff) |
OMAP4 has two watchdog timers timer 2/MPU and timer 3/IVA.
Previously the device tree only described one but now it describes both.
Do not attempt to set the global variable that points to a softc or
register a watchdog if this has already been done.
Fixes rebooting on the OMAP4 based PandaBoard-ES with a device tree from
linux 4.15-rc1.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/armv7/omap/omdog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/armv7/omap/omdog.c b/sys/arch/armv7/omap/omdog.c index 376154bd9d7..575ec081ae9 100644 --- a/sys/arch/armv7/omap/omdog.c +++ b/sys/arch/armv7/omap/omdog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omdog.c,v 1.7 2016/07/27 11:45:02 patrick Exp $ */ +/* $OpenBSD: omdog.c,v 1.8 2017/11/27 06:29:41 jsg Exp $ */ /* * Copyright (c) 2013 Federico G. Schwindt <fgsch@openbsd.org> * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> @@ -106,10 +106,15 @@ omdog_attach(struct device *parent, struct device *self, void *aux) rev = bus_space_read_4(sc->sc_iot, sc->sc_ioh, WIDR); printf(" rev %d.%d\n", rev >> 4 & 0xf, rev & 0xf); - omdog_sc = sc; omdog_stop(sc); + /* only register one watchdog, OMAP4 has two */ + if (omdog_sc != NULL) + return; + + omdog_sc = sc; + #ifndef SMALL_KERNEL wdog_register(omdog_cb, sc); #endif |