Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 2016 14:28:05 +0000 (UTC)
From:      Zbigniew Bodek <zbb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r294437 - head/sys/arm/mv
Message-ID:  <201601201428.u0KES5VT079148@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zbb
Date: Wed Jan 20 14:28:05 2016
New Revision: 294437
URL: https://svnweb.freebsd.org/changeset/base/294437

Log:
  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

Modified:
  head/sys/arm/mv/timer.c

Modified: head/sys/arm/mv/timer.c
==============================================================================
--- head/sys/arm/mv/timer.c	Wed Jan 20 14:23:57 2016	(r294436)
+++ head/sys/arm/mv/timer.c	Wed Jan 20 14:28:05 2016	(r294437)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601201428.u0KES5VT079148>