summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-02-09 21:01:53 +0000
committerimp <imp@FreeBSD.org>2014-02-09 21:01:53 +0000
commitef1ac29eb38fcacfacce3712576dd3562465e050 (patch)
tree1951d06060668441a19d064a5e8a4e63b8887d7a
parentbdaa9ef2459fdc4e3a8cbe7bc5c0e8581df5c627 (diff)
downloadFreeBSD-src-ef1ac29eb38fcacfacce3712576dd3562465e050.zip
FreeBSD-src-ef1ac29eb38fcacfacce3712576dd3562465e050.tar.gz
FDT attachment...
-rw-r--r--sys/arm/at91/at91_wdt.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/sys/arm/at91/at91_wdt.c b/sys/arm/at91/at91_wdt.c
index 9ab51e1..9533202 100644
--- a/sys/arm/at91/at91_wdt.c
+++ b/sys/arm/at91/at91_wdt.c
@@ -29,6 +29,8 @@
* handler. The watchdog is halted in processor debug mode.
*/
+#include "opt_platform.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -45,6 +47,12 @@ __FBSDID("$FreeBSD$");
#include <arm/at91/at91var.h>
#include <arm/at91/at91_wdtreg.h>
+#ifdef FDT
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#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
OpenPOWER on IntegriCloud