Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 2014 21:00:23 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r261686 - head/sys/arm/at91
Message-ID:  <201402092100.s19L0NIq022427@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sun Feb  9 21:00:22 2014
New Revision: 261686
URL: http://svnweb.freebsd.org/changeset/base/261686

Log:
  Add FDT attachment.

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

Modified: head/sys/arm/at91/at91_spi.c
==============================================================================
--- head/sys/arm/at91/at91_spi.c	Sun Feb  9 20:59:46 2014	(r261685)
+++ head/sys/arm/at91/at91_spi.c	Sun Feb  9 21:00:22 2014	(r261686)
@@ -25,6 +25,8 @@
  * SUCH DAMAGE.
  */
 
+#include "opt_platform.h"
+
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
@@ -49,6 +51,12 @@ __FBSDID("$FreeBSD$");
 #include <dev/spibus/spi.h>
 #include <dev/spibus/spibusvar.h>
 
+#ifdef FDT
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+#endif
+
 #include "spibus_if.h"
 
 struct at91_spi_softc
@@ -96,7 +104,10 @@ static void at91_spi_intr(void *arg);
 static int
 at91_spi_probe(device_t dev)
 {
-
+#ifdef FDT
+	if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-spi"))
+		return (ENXIO);
+#endif
 	device_set_desc(dev, "AT91 SPI");
 	return (0);
 }
@@ -428,5 +439,10 @@ static driver_t at91_spi_driver = {
 	sizeof(struct at91_spi_softc),
 };
 
+#ifdef FDT
+DRIVER_MODULE(at91_spi, simplebus, at91_spi_driver, at91_spi_devclass, NULL,
+    NULL);
+#else
 DRIVER_MODULE(at91_spi, atmelarm, at91_spi_driver, at91_spi_devclass, NULL,
     NULL);
+#endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402092100.s19L0NIq022427>