summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2015-11-05 22:03:42 +0000
committercognet <cognet@FreeBSD.org>2015-11-05 22:03:42 +0000
commitc369925ae6daac7ea494e356603f170667c72775 (patch)
treea6ee835dd0a19a83f8057479ce54d1e9837e477e /sys/arm
parent89987c86704b6d7a11110b9fdc7c3c3724a956fd (diff)
downloadFreeBSD-src-c369925ae6daac7ea494e356603f170667c72775.zip
FreeBSD-src-c369925ae6daac7ea494e356603f170667c72775.tar.gz
Make if_macb work with FDT.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/at91/if_macb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sys/arm/at91/if_macb.c b/sys/arm/at91/if_macb.c
index a7acc31..6ad167c 100644
--- a/sys/arm/at91/if_macb.c
+++ b/sys/arm/at91/if_macb.c
@@ -24,6 +24,8 @@
* SUCH DAMAGE.
*/
+#include "opt_platform.h"
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -72,6 +74,12 @@ __FBSDID("$FreeBSD$");
#include <machine/bus.h>
#include <machine/intr.h>
+#ifdef FDT
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#endif
+
/* "device miibus" required. See GENERIC if you get errors here. */
#include "miibus_if.h"
@@ -1196,6 +1204,11 @@ macbioctl(struct ifnet * ifp, u_long cmd, caddr_t data)
static int
macb_probe(device_t dev)
{
+#ifdef FDT
+ if (!ofw_bus_is_compatible(dev, "cdns,at32ap7000-macb"))
+ return (ENXIO);
+#endif
+
device_set_desc(dev, "macb");
return (0);
}
@@ -1546,7 +1559,11 @@ static driver_t macb_driver = {
};
+#ifdef FDT
+DRIVER_MODULE(macb, simplebus, macb_driver, macb_devclass, NULL, NULL);
+#else
DRIVER_MODULE(macb, atmelarm, macb_driver, macb_devclass, 0, 0);
+#endif
DRIVER_MODULE(miibus, macb, miibus_driver, miibus_devclass, 0, 0);
MODULE_DEPEND(macb, miibus, 1, 1, 1);
MODULE_DEPEND(macb, ether, 1, 1, 1);
OpenPOWER on IntegriCloud