Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jan 2013 16:20:40 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245371 - in head/sys: conf dev/isf
Message-ID:  <201301131620.r0DGKe9X010402@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rwatson
Date: Sun Jan 13 16:20:40 2013
New Revision: 245371
URL: http://svnweb.freebsd.org/changeset/base/245371

Log:
  Partially merge Perforce changeset 219930 to head:
  
    Add an Intel StrataFlash (isf) driver FDT attachment.
  
  Portions of the original changeset hooking up FDT use for BERI will be
  merged separately.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/sys/conf/files
  head/sys/dev/isf/isf_fdt.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sun Jan 13 15:16:18 2013	(r245370)
+++ head/sys/conf/files	Sun Jan 13 16:20:40 2013	(r245371)
@@ -1416,6 +1416,7 @@ dev/iscsi/initiator/isc_soc.c	optional i
 dev/iscsi/initiator/isc_sm.c	optional iscsi_initiator scbus
 dev/iscsi/initiator/isc_subr.c	optional iscsi_initiator scbus
 dev/isf/isf.c			optional isf
+dev/isf/isf_fdt.c		optional isf fdt
 dev/isf/isf_nexus.c		optional isf
 dev/isp/isp.c			optional isp
 dev/isp/isp_freebsd.c		optional isp

Modified: head/sys/dev/isf/isf_fdt.c
==============================================================================
--- head/sys/dev/isf/isf_fdt.c	Sun Jan 13 15:16:18 2013	(r245370)
+++ head/sys/dev/isf/isf_fdt.c	Sun Jan 13 16:20:40 2013	(r245371)
@@ -51,23 +51,29 @@ __FBSDID("$FreeBSD$");
 
 #include <geom/geom_disk.h>
 
+#include <dev/fdt/fdt_common.h>
+#include <dev/ofw/openfirm.h>
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_bus_subr.h>
+
 #include <dev/isf/isf.h>
 
 /*
- * Nexus bus attachment for the Intel Strata Flash devices.  Appropriate for
- * most Altera FPGA SoC-style configurations in which the part will be exposed
- * to the processor via a memory-mapped Avalon bus.
+ * FDT bus attachment for the Intel Strata Flash devices.
  */
 static int
-isf_nexus_probe(device_t dev)
+isf_fdt_probe(device_t dev)
 {
 
-	device_set_desc(dev, "Intel StrataFlash NOR flash device");
-	return (BUS_PROBE_DEFAULT);
+	if (ofw_bus_is_compatible(dev, "intel,strataflash")) {
+		device_set_desc(dev, "Intel StrataFlash NOR flash device");
+		return (BUS_PROBE_DEFAULT);
+	}
+	return (ENXIO);
 }
 
 static int
-isf_nexus_attach(device_t dev)
+isf_fdt_attach(device_t dev)
 {
 	int			 error;
 	struct isf_softc	*sc;
@@ -90,7 +96,7 @@ isf_nexus_attach(device_t dev)
 }
 
 static int
-isf_nexus_detach(device_t dev)
+isf_fdt_detach(device_t dev)
 {
 	struct isf_softc *sc;
 
@@ -102,19 +108,19 @@ isf_nexus_detach(device_t dev)
 	return (0);
 }
 
-static device_method_t isf_nexus_methods[] = {
-	DEVMETHOD(device_probe,		isf_nexus_probe),
-	DEVMETHOD(device_attach,	isf_nexus_attach),
-	DEVMETHOD(device_detach,	isf_nexus_detach),
+static device_method_t isf_fdt_methods[] = {
+	DEVMETHOD(device_probe,		isf_fdt_probe),
+	DEVMETHOD(device_attach,	isf_fdt_attach),
+	DEVMETHOD(device_detach,	isf_fdt_detach),
 	{ 0, 0 }
 };
 
-static driver_t isf_nexus_driver = {
+static driver_t isf_fdt_driver = {
 	"isf",
-	isf_nexus_methods,
+	isf_fdt_methods,
 	sizeof(struct isf_softc),
 };
 
 static devclass_t isf_devclass;
 
-DRIVER_MODULE(isf, nexus, isf_nexus_driver, isf_devclass, 0, 0);
+DRIVER_MODULE(isf, simplebus, isf_fdt_driver, isf_devclass, 0, 0);



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