diff options
author | Warner Losh <imp@FreeBSD.org> | 2014-02-09 21:02:46 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2014-02-09 21:02:46 +0000 |
commit | 1ef5f6a0065ec56cf4b65a63091bcaf1a385c00c (patch) | |
tree | f57595bc0f5fb6fda9313f870ad369eb9e0529aa /sys | |
parent | c6053263cca9110a94643bf0e9adf43ad8b41045 (diff) | |
download | src-1ef5f6a0065ec56cf4b65a63091bcaf1a385c00c.tar.gz src-1ef5f6a0065ec56cf4b65a63091bcaf1a385c00c.zip |
Add FDT attachment.
Notes
Notes:
svn path=/head/; revision=261689
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arm/at91/if_ate.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c index 91b573864bff..100b7be19c5b 100644 --- a/sys/arm/at91/if_ate.c +++ b/sys/arm/at91/if_ate.c @@ -30,6 +30,8 @@ * 2) GPIO initializtion in board setup code. */ +#include "opt_platform.h" + #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -74,6 +76,12 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91var.h> #include <arm/at91/if_atereg.h> +#ifdef FDT +#include <dev/fdt/fdt_common.h> +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> +#endif + #include "miibus_if.h" /* @@ -229,7 +237,10 @@ static int ate_miibus_writereg(device_t dev, int phy, int reg, int data); static int ate_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "cdns,at32ap7000-macb")) + return (ENXIO); +#endif device_set_desc(dev, "EMAC"); return (0); } @@ -1458,7 +1469,11 @@ static driver_t ate_driver = { sizeof(struct ate_softc), }; +#ifdef FDT +DRIVER_MODULE(ate, simplebus, ate_driver, ate_devclass, NULL, NULL); +#else DRIVER_MODULE(ate, atmelarm, ate_driver, ate_devclass, NULL, NULL); +#endif DRIVER_MODULE(miibus, ate, miibus_driver, miibus_devclass, NULL, NULL); MODULE_DEPEND(ate, miibus, 1, 1, 1); MODULE_DEPEND(ate, ether, 1, 1, 1); |