summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcem <cem@FreeBSD.org>2015-12-17 23:21:37 +0000
committercem <cem@FreeBSD.org>2015-12-17 23:21:37 +0000
commita12e9d2b9f45e8ba9e4392031bda53e5d047180d (patch)
tree7d5f7b77f3523b642b84f070e2d00a3bbf190c25
parentcdf1c8d7c1a6a32bb1374533b42a598de487eef7 (diff)
downloadFreeBSD-src-a12e9d2b9f45e8ba9e4392031bda53e5d047180d.zip
FreeBSD-src-a12e9d2b9f45e8ba9e4392031bda53e5d047180d.tar.gz
ioat(4): Add an API to get HW revision
Different revisions support different operations. Refer to Intel External Design Specifications to figure out what your hardware supports. Sponsored by: EMC / Isilon Storage Division
-rw-r--r--share/man/man4/ioat.44
-rw-r--r--sys/dev/ioat/ioat.c9
-rw-r--r--sys/dev/ioat/ioat.h11
-rw-r--r--sys/dev/ioat/ioat_hw.h3
4 files changed, 23 insertions, 4 deletions
diff --git a/share/man/man4/ioat.4 b/share/man/man4/ioat.4
index 7ba7768..dd467b2 100644
--- a/share/man/man4/ioat.4
+++ b/share/man/man4/ioat.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 14, 2015
+.Dd December 17, 2015
.Dt IOAT 4
.Os
.Sh NAME
@@ -64,6 +64,8 @@ In
.Ft void
.Fn ioat_put_dmaengine "bus_dmaengine_t dmaengine"
.Ft int
+.Fn ioat_get_hwversion "bus_dmaengine_t dmaengine"
+.Ft int
.Fn ioat_set_interrupt_coalesce "bus_dmaengine_t dmaengine" "uint16_t delay"
.Ft uint16_t
.Fn ioat_get_max_coalesce_period "bus_dmaengine_t dmaengine"
diff --git a/sys/dev/ioat/ioat.c b/sys/dev/ioat/ioat.c
index 12a6fe4..4b6d7df 100644
--- a/sys/dev/ioat/ioat.c
+++ b/sys/dev/ioat/ioat.c
@@ -736,6 +736,15 @@ ioat_put_dmaengine(bus_dmaengine_t dmaengine)
}
int
+ioat_get_hwversion(bus_dmaengine_t dmaengine)
+{
+ struct ioat_softc *ioat;
+
+ ioat = to_ioat_softc(dmaengine);
+ return (ioat->version);
+}
+
+int
ioat_set_interrupt_coalesce(bus_dmaengine_t dmaengine, uint16_t delay)
{
struct ioat_softc *ioat;
diff --git a/sys/dev/ioat/ioat.h b/sys/dev/ioat/ioat.h
index 5c64af1..e8f47ae 100644
--- a/sys/dev/ioat/ioat.h
+++ b/sys/dev/ioat/ioat.h
@@ -48,6 +48,14 @@ __FBSDID("$FreeBSD$");
#define DMA_NO_WAIT 0x2
#define DMA_ALL_FLAGS (DMA_INT_EN | DMA_NO_WAIT)
+/*
+ * Hardware revision number. Different hardware revisions support different
+ * features. For example, 3.2 cannot read from MMIO space, while 3.3 can.
+ */
+#define IOAT_VER_3_0 0x30
+#define IOAT_VER_3_2 0x32
+#define IOAT_VER_3_3 0x33
+
typedef void *bus_dmaengine_t;
struct bus_dmadesc;
typedef void (*bus_dmaengine_callback_t)(void *arg, int error);
@@ -60,6 +68,9 @@ bus_dmaengine_t ioat_get_dmaengine(uint32_t channel_index);
/* Release the DMA channel */
void ioat_put_dmaengine(bus_dmaengine_t dmaengine);
+/* Check the DMA engine's HW version */
+int ioat_get_hwversion(bus_dmaengine_t dmaengine);
+
/*
* Set interrupt coalescing on a DMA channel.
*
diff --git a/sys/dev/ioat/ioat_hw.h b/sys/dev/ioat/ioat_hw.h
index 1aeee2d..46ffaeb 100644
--- a/sys/dev/ioat/ioat_hw.h
+++ b/sys/dev/ioat/ioat_hw.h
@@ -46,9 +46,6 @@ __FBSDID("$FreeBSD$");
#define IOAT_CBVER_OFFSET 0x08
-#define IOAT_VER_3_0 0x30
-#define IOAT_VER_3_3 0x33
-
#define IOAT_INTRDELAY_OFFSET 0x0C
#define IOAT_INTRDELAY_SUPPORTED (1 << 15)
/* Reserved. (1 << 14) */
OpenPOWER on IntegriCloud