aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorRuslan Bukin <br@FreeBSD.org>2020-07-28 16:08:14 +0000
committerRuslan Bukin <br@FreeBSD.org>2020-07-28 16:08:14 +0000
commitea4c01156a9244a084a4044bc77147adfd9167ce (patch)
tree89d027a3e0c8faf873b2d61d7ed46e7553a18f1b /sys/dev
parentc7f893a42b9572f1152d163290202b855953a768 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/iommu/busdma_iommu.c8
-rw-r--r--sys/dev/iommu/iommu.h12
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw_intel.c2
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw_plx.c2
4 files changed, 17 insertions, 7 deletions
diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c
index a4fe8ee9d063..0fd54e8b641a 100644
--- a/sys/dev/iommu/busdma_iommu.c
+++ b/sys/dev/iommu/busdma_iommu.c
@@ -299,7 +299,7 @@ acpi_iommu_get_dma_tag(device_t dev, device_t child)
}
bool
-bus_dma_dmar_set_buswide(device_t dev)
+bus_dma_iommu_set_buswide(device_t dev)
{
struct iommu_unit *unit;
device_t parent;
@@ -317,12 +317,12 @@ bus_dma_dmar_set_buswide(device_t dev)
if (slot != 0 || func != 0) {
if (bootverbose) {
device_printf(dev,
- "dmar%d pci%d:%d:%d requested buswide busdma\n",
+ "iommu%d pci%d:%d:%d requested buswide busdma\n",
unit->unit, busno, slot, func);
}
return (false);
}
- dmar_set_buswide_ctx(unit, busno);
+ iommu_set_buswide_ctx(unit, busno);
return (true);
}
@@ -987,7 +987,7 @@ iommu_fini_busdma(struct iommu_unit *unit)
}
int
-bus_dma_dmar_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1,
+bus_dma_iommu_load_ident(bus_dma_tag_t dmat, bus_dmamap_t map1,
vm_paddr_t start, vm_size_t length, int flags)
{
struct bus_dma_tag_common *tc;
diff --git a/sys/dev/iommu/iommu.h b/sys/dev/iommu/iommu.h
index c3bc3d26b765..380f4cdfe5f6 100644
--- a/sys/dev/iommu/iommu.h
+++ b/sys/dev/iommu/iommu.h
@@ -34,11 +34,13 @@
#ifndef _SYS_IOMMU_H_
#define _SYS_IOMMU_H_
+#include <sys/types.h>
#include <sys/queue.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/tree.h>
-#include <sys/types.h>
+
+#include <dev/pci/pcireg.h>
/* Host or physical memory address, after translation. */
typedef uint64_t iommu_haddr_t;
@@ -96,6 +98,14 @@ struct iommu_unit {
struct task dmamap_load_task;
TAILQ_HEAD(, bus_dmamap_iommu) delayed_maps;
struct taskqueue *delayed_taskqueue;
+
+ /*
+ * Bitmap of buses for which context must ignore slot:func,
+ * duplicating the page table pointer into all context table
+ * entries. This is a client-controlled quirk to support some
+ * NTBs.
+ */
+ uint32_t buswide_ctxs[(PCI_BUSMAX + 1) / NBBY / sizeof(uint32_t)];
};
/*
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
index 9182461fe9a5..ba61fdc9ffcd 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c
@@ -811,7 +811,7 @@ intel_ntb_map_pci_bars(struct ntb_softc *ntb)
device_printf(ntb->device, "Unable to create BAR0 map\n");
return (ENOMEM);
}
- if (bus_dma_dmar_load_ident(ntb->bar0_dma_tag, ntb->bar0_dma_map,
+ if (bus_dma_iommu_load_ident(ntb->bar0_dma_tag, ntb->bar0_dma_map,
bar->pbase, bar->size, 0)) {
device_printf(ntb->device, "Unable to load BAR0 map\n");
return (ENOMEM);
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_plx.c b/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
index 97df9ce3a4cc..a9654e7f6725 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
@@ -343,7 +343,7 @@ ntb_plx_attach(device_t dev)
* The device occupies whole bus. In translated TLP slot field
* keeps LUT index (original bus/slot), function is passed through.
*/
- bus_dma_dmar_set_buswide(dev);
+ bus_dma_iommu_set_buswide(dev);
/* Identify chip port we are connected to. */
val = bus_read_4(sc->conf_res, 0x360);