diff options
author | Warner Losh <imp@FreeBSD.org> | 2014-02-09 20:56:39 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2014-02-09 20:56:39 +0000 |
commit | 210c0e4c87dd8afa41cb941741ef291b0f2b1263 (patch) | |
tree | 310167d73534156c11014d9a6835bd0ad3fa12b9 /sys | |
parent | bad391b21c4b73b90a766786caff711d6a6433a5 (diff) | |
download | src-210c0e4c87dd8afa41cb941741ef291b0f2b1263.tar.gz src-210c0e4c87dd8afa41cb941741ef291b0f2b1263.zip |
Add FDT attachment.
Notes
Notes:
svn path=/head/; revision=261682
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arm/at91/at91_pio.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/arm/at91/at91_pio.c b/sys/arm/at91/at91_pio.c index 2a50707e492e..b902294971ed 100644 --- a/sys/arm/at91/at91_pio.c +++ b/sys/arm/at91/at91_pio.c @@ -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 |