From owner-svn-src-all@FreeBSD.ORG Sun Feb 9 21:01:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC21589B; Sun, 9 Feb 2014 21:01:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3DDB174E; Sun, 9 Feb 2014 21:01:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s19L1rMO024835; Sun, 9 Feb 2014 21:01:53 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s19L1rvr024834; Sun, 9 Feb 2014 21:01:53 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201402092101.s19L1rvr024834@svn.freebsd.org> From: Warner Losh Date: Sun, 9 Feb 2014 21:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261688 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Feb 2014 21:01:53 -0000 Author: imp Date: Sun Feb 9 21:01:53 2014 New Revision: 261688 URL: http://svnweb.freebsd.org/changeset/base/261688 Log: FDT attachment... Modified: head/sys/arm/at91/at91_wdt.c Modified: head/sys/arm/at91/at91_wdt.c ============================================================================== --- head/sys/arm/at91/at91_wdt.c Sun Feb 9 21:01:10 2014 (r261687) +++ head/sys/arm/at91/at91_wdt.c Sun Feb 9 21:01:53 2014 (r261688) @@ -29,6 +29,8 @@ * handler. The watchdog is halted in processor debug mode. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -45,6 +47,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#endif + struct wdt_softc { struct mtx sc_mtx; device_t sc_dev; @@ -131,12 +139,12 @@ wdt_tick(void *argp) static int wdt_probe(device_t dev) { - - if (at91_is_sam9() || at91_is_sam9xe()) { - device_set_desc(dev, "WDT"); - return (0); - } - return (ENXIO); +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91sam9260-wdt")) + return (ENXIO); +#endif + device_set_desc(dev, "WDT"); + return (0); } static int @@ -223,4 +231,8 @@ static driver_t wdt_driver = { static devclass_t wdt_devclass; +#ifdef FDT +DRIVER_MODULE(at91_wdt, simplebus, wdt_driver, wdt_devclass, NULL, NULL); +#else DRIVER_MODULE(at91_wdt, atmelarm, wdt_driver, wdt_devclass, NULL, NULL); +#endif