Date: Sun, 9 Feb 2014 20:56:40 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261682 - head/sys/arm/at91 Message-ID: <201402092056.s19Kue16020817@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sun Feb 9 20:56:39 2014 New Revision: 261682 URL: http://svnweb.freebsd.org/changeset/base/261682 Log: Add FDT attachment. Modified: head/sys/arm/at91/at91_pio.c Modified: head/sys/arm/at91/at91_pio.c ============================================================================== --- head/sys/arm/at91/at91_pio.c Sun Feb 9 20:55:49 2014 (r261681) +++ head/sys/arm/at91/at91_pio.c Sun Feb 9 20:56:39 2014 (r261682) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -48,6 +50,12 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91_pioreg.h> #include <arm/at91/at91_piovar.h> +#ifdef FDT +#include <dev/fdt/fdt_common.h> +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> +#endif + #define MAX_CHANGE 64 struct at91_pio_softc @@ -122,7 +130,10 @@ static int at91_pio_probe(device_t dev) { const char *name; - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-gpio")) + return (ENXIO); +#endif switch (device_get_unit(dev)) { case 0: name = "PIOA"; @@ -136,6 +147,12 @@ at91_pio_probe(device_t dev) case 3: name = "PIOD"; break; + case 4: + name = "PIOE"; + break; + case 5: + name = "PIOF"; + break; default: name = "PIO"; break; @@ -609,5 +626,10 @@ static driver_t at91_pio_driver = { sizeof(struct at91_pio_softc), }; +#ifdef FDT +DRIVER_MODULE(at91_pio, simplebus, at91_pio_driver, at91_pio_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_pio, atmelarm, at91_pio_driver, at91_pio_devclass, NULL, NULL); +#endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402092056.s19Kue16020817>