Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Dec 2012 00:15:36 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 219930 for review
Message-ID:  <201212310015.qBV0Fai9017669@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@219930?ac=10

Change 219930 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2012/12/31 00:15:14

	Add an Intel StrataFlash (isf) driver FDT attachment, and switch
	to using that attachment with the FDT version of the FreeBSD/BERI
	kernel.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#6 edit
.. //depot/projects/ctsrd/beribsd/src/sys/conf/files#11 edit
.. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_fdt.c#2 edit
.. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#4 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#6 (text+ko) ====

@@ -103,6 +103,7 @@
 			       0x70000000 0x177000
 			       0x70177000 0x2000>;
 		};
+*/
 
 		flash@0x74000000 {
 			compatible = "intel,strataflash";
@@ -113,6 +114,5 @@
 			compatible = "intel,strataflash";
 			reg = <0x76000000 0x2000000>;
 		};
-*/
 	};
 };

==== //depot/projects/ctsrd/beribsd/src/sys/conf/files#11 (text+ko) ====

@@ -1393,6 +1393,7 @@
 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

==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_fdt.c#2 (text+ko) ====

@@ -51,23 +51,29 @@
 
 #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 @@
 }
 
 static int
-isf_nexus_detach(device_t dev)
+isf_fdt_detach(device_t dev)
 {
 	struct isf_softc *sc;
 
@@ -102,19 +108,19 @@
 	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);

==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#4 (text+ko) ====

@@ -85,12 +85,12 @@
 #
 # General Intel StrataFlash driver
 #
-hint.isf.0.at="nexus0"
-hint.isf.0.maddr=0x74000000
-hint.isf.0.msize=0x2000000
-hint.isf.1.at="nexus0"
-hint.isf.1.maddr=0x76000000
-hint.isf.1.msize=0x2000000
+#hint.isf.0.at="nexus0"
+#hint.isf.0.maddr=0x74000000
+#hint.isf.0.msize=0x2000000
+#hint.isf.1.at="nexus0"
+#hint.isf.1.maddr=0x76000000
+#hint.isf.1.msize=0x2000000
 
 # Reserved configuration blocks.  Don't touch.
 hint.map.0.at="isf0"



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