diff options
author | Warner Losh <imp@FreeBSD.org> | 2014-02-09 21:01:53 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2014-02-09 21:01:53 +0000 |
commit | c6053263cca9110a94643bf0e9adf43ad8b41045 (patch) | |
tree | 1951d06060668441a19d064a5e8a4e63b8887d7a | |
parent | 3526a97bba9aac5d2dbee4df4d4d61f2bb6cba72 (diff) | |
download | src-c6053263cca9110a94643bf0e9adf43ad8b41045.tar.gz src-c6053263cca9110a94643bf0e9adf43ad8b41045.zip |
FDT attachment...
Notes
Notes:
svn path=/head/; revision=261688
-rw-r--r-- | sys/arm/at91/at91_wdt.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sys/arm/at91/at91_wdt.c b/sys/arm/at91/at91_wdt.c index 9ab51e15a8fe..95332025e2f7 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 |