summaryrefslogtreecommitdiff
path: root/sys/arch/armv7
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2021-02-25 23:07:50 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2021-02-25 23:07:50 +0000
commitbfbe433b3bf38f3344b4b684e035f808e6138f13 (patch)
tree926a4a99d4c78b8c0d6f80ca1a94fe663bf4d676 /sys/arch/armv7
parent593235507b1ffac045beebefc1c33c542e6af805 (diff)
Add some infrastructure in the PCI chipset tag for pci_probe_device_hook()
so that we can provide IOMMU-hooked bus DMA tags for each PCI device. ok kettenis@
Diffstat (limited to 'sys/arch/armv7')
-rw-r--r--sys/arch/armv7/marvell/mvpcie.c10
-rw-r--r--sys/arch/armv7/vexpress/pciecam.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/arch/armv7/marvell/mvpcie.c b/sys/arch/armv7/marvell/mvpcie.c
index d0734973f76..1fc27d81e80 100644
--- a/sys/arch/armv7/marvell/mvpcie.c
+++ b/sys/arch/armv7/marvell/mvpcie.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mvpcie.c,v 1.2 2020/07/14 15:42:19 patrick Exp $ */
+/* $OpenBSD: mvpcie.c,v 1.3 2021/02/25 23:07:48 patrick Exp $ */
/*
* Copyright (c) 2018 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
@@ -194,6 +194,7 @@ void mvpcie_decompose_tag(void *, pcitag_t, int *, int *, int *);
int mvpcie_conf_size(void *, pcitag_t);
pcireg_t mvpcie_conf_read(void *, pcitag_t, int);
void mvpcie_conf_write(void *, pcitag_t, int, pcireg_t);
+int mvpcie_probe_device_hook(void *, struct pci_attach_args *);
int mvpcie_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
int mvpcie_intr_map_msi(struct pci_attach_args *, pci_intr_handle_t *);
@@ -421,6 +422,7 @@ mvpcie_port_attach(struct mvpcie_softc *sc, struct mvpcie_port *po, int node)
po->po_pc.pc_conf_size = mvpcie_conf_size;
po->po_pc.pc_conf_read = mvpcie_conf_read;
po->po_pc.pc_conf_write = mvpcie_conf_write;
+ po->po_pc.pc_probe_device_hook = mvpcie_probe_device_hook;
po->po_pc.pc_intr_v = po;
po->po_pc.pc_intr_map = mvpcie_intr_map;
@@ -775,6 +777,12 @@ mvpcie_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data)
HWRITE4(po, PCIE_CONF_DATA, data);
}
+int
+mvpcie_probe_device_hook(void *v, struct pci_attach_args *pa)
+{
+ return 0;
+}
+
struct mvpcie_intr_handle {
pci_chipset_tag_t ih_pc;
pcitag_t ih_tag;
diff --git a/sys/arch/armv7/vexpress/pciecam.c b/sys/arch/armv7/vexpress/pciecam.c
index 8ab86f6f14c..92bdcbcde03 100644
--- a/sys/arch/armv7/vexpress/pciecam.c
+++ b/sys/arch/armv7/vexpress/pciecam.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciecam.c,v 1.2 2020/07/14 15:42:19 patrick Exp $ */
+/* $OpenBSD: pciecam.c,v 1.3 2021/02/25 23:07:48 patrick Exp $ */
/*
* Copyright (c) 2013,2017 Patrick Wildt <patrick@blueri.se>
*
@@ -98,6 +98,7 @@ void pciecam_decompose_tag(void *, pcitag_t, int *, int *, int *);
int pciecam_conf_size(void *, pcitag_t);
pcireg_t pciecam_conf_read(void *, pcitag_t, int);
void pciecam_conf_write(void *, pcitag_t, int, pcireg_t);
+int pciecam_probe_device_hook(void *, struct pci_attach_args *);
int pciecam_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
int pciecam_intr_map_msi(struct pci_attach_args *, pci_intr_handle_t *);
int pciecam_intr_map_msix(struct pci_attach_args *, int, pci_intr_handle_t *);
@@ -222,6 +223,7 @@ pciecam_attach(struct device *parent, struct device *self, void *aux)
sc->sc_pc.pc_conf_size = pciecam_conf_size;
sc->sc_pc.pc_conf_read = pciecam_conf_read;
sc->sc_pc.pc_conf_write = pciecam_conf_write;
+ sc->sc_pc.pc_probe_device_hook = pciecam_probe_device_hook;
sc->sc_pc.pc_intr_v = sc;
sc->sc_pc.pc_intr_map = pciecam_intr_map;
@@ -306,6 +308,12 @@ pciecam_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data)
HWRITE4(sc, PCIE_ADDR_OFFSET(bus, dev, fn, reg & ~0x3), data);
}
+int
+pciecam_probe_device_hook(void *v, struct pci_attach_args *pa)
+{
+ return 0;
+}
+
struct pciecam_intr_handle {
pci_chipset_tag_t ih_pc;
pcitag_t ih_tag;