svn commit: r261689 - head/sys/arm/at91

Warner Losh imp at FreeBSD.org
Sun Feb 9 21:02:46 UTC 2014


Author: imp
Date: Sun Feb  9 21:02:46 2014
New Revision: 261689
URL: http://svnweb.freebsd.org/changeset/base/261689

Log:
  Add FDT attachment.

Modified:
  head/sys/arm/at91/if_ate.c

Modified: head/sys/arm/at91/if_ate.c
==============================================================================
--- head/sys/arm/at91/if_ate.c	Sun Feb  9 21:01:53 2014	(r261688)
+++ head/sys/arm/at91/if_ate.c	Sun Feb  9 21:02:46 2014	(r261689)
@@ -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 
 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);


More information about the svn-src-all mailing list