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 __FBSDID("$FreeBSD$"); @@ -74,6 +76,12 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#include +#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);