so that we can provide IOMMU-hooked bus DMA tags for each PCI device.
ok kettenis@
-/* $OpenBSD: pci_machdep.h,v 1.16 2020/07/14 15:42:19 patrick Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.17 2021/02/25 23:07:48 patrick Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
int (*pc_conf_size)(void *, pcitag_t);
pcireg_t (*pc_conf_read)(void *, pcitag_t, int);
void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
+ int (*pc_probe_device_hook)(void *, struct pci_attach_args *);
void *pc_intr_v;
int (*pc_intr_map)(struct pci_attach_args *,
(*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r))
#define pci_conf_write(c, t, r, v) \
(*(c)->pc_conf_write)((c)->pc_conf_v, (t), (r), (v))
+#define pci_probe_device_hook(c, a) \
+ (*(c)->pc_probe_device_hook)((c)->pc_conf_v, (a))
#define pci_intr_map(c, ihp) \
(*(c)->pa_pc->pc_intr_map)((c), (ihp))
#define pci_intr_map_msi(c, ihp) \
(nm))
#define pci_intr_disestablish(c, iv) \
(*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv))
-#define pci_probe_device_hook(c, a) (0)
#define pci_min_powerstate(c, t) (PCI_PMCSR_STATE_D3)
#define pci_set_powerstate_md(c, t, s, p)
-/* $OpenBSD: acpipci.c,v 1.24 2021/01/15 20:49:38 patrick Exp $ */
+/* $OpenBSD: acpipci.c,v 1.25 2021/02/25 23:07:48 patrick Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis
*
int acpipci_conf_size(void *, pcitag_t);
pcireg_t acpipci_conf_read(void *, pcitag_t, int);
void acpipci_conf_write(void *, pcitag_t, int, pcireg_t);
+int acpipci_probe_device_hook(void *, struct pci_attach_args *);
int acpipci_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *acpipci_intr_string(void *, pci_intr_handle_t);
sc->sc_pc = pci_lookup_segment(seg);
KASSERT(sc->sc_pc->pc_intr_v == NULL);
+ sc->sc_pc->pc_probe_device_hook = acpipci_probe_device_hook;
+
sc->sc_pc->pc_intr_v = sc;
sc->sc_pc->pc_intr_map = acpipci_intr_map;
sc->sc_pc->pc_intr_map_msi = _pci_intr_map_msi;
bus_space_write_4(am->am_iot, am->am_ioh, tag | reg, data);
}
+int
+acpipci_probe_device_hook(void *v, struct pci_attach_args *pa)
+{
+ return 0;
+}
+
int
acpipci_intr_swizzle(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
-/* $OpenBSD: pciecam.c,v 1.11 2020/11/19 17:42:19 kettenis Exp $ */
+/* $OpenBSD: pciecam.c,v 1.12 2021/02/25 23:07:48 patrick Exp $ */
/*
* Copyright (c) 2013,2017 Patrick Wildt <patrick@blueri.se>
*
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 *);
const char *pciecam_intr_string(void *, pci_intr_handle_t);
void *pciecam_intr_establish(void *, pci_intr_handle_t, int,
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;
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;
+}
+
int
pciecam_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
-/* $OpenBSD: pci_machdep.h,v 1.7 2020/07/14 15:42:19 patrick Exp $ */
+/* $OpenBSD: pci_machdep.h,v 1.8 2021/02/25 23:07:48 patrick Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
int (*pc_conf_size)(void *, pcitag_t);
pcireg_t (*pc_conf_read)(void *, pcitag_t, int);
void (*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
+ int (*pc_probe_device_hook)(void *, struct pci_attach_args *);
void *pc_intr_v;
int (*pc_intr_map)(struct pci_attach_args *,
(*(c)->pc_conf_read)((c)->pc_conf_v, (t), (r))
#define pci_conf_write(c, t, r, v) \
(*(c)->pc_conf_write)((c)->pc_conf_v, (t), (r), (v))
+#define pci_probe_device_hook(c, a) \
+ (*(c)->pc_probe_device_hook)((c)->pc_conf_v, (a))
#define pci_intr_map(c, ihp) \
(*(c)->pa_pc->pc_intr_map)((c), (ihp))
#define pci_intr_map_msi(c, ihp) \
(nm))
#define pci_intr_disestablish(c, iv) \
(*(c)->pc_intr_disestablish)((c)->pc_intr_v, (iv))
-#define pci_probe_device_hook(c, a) (0)
#define pci_min_powerstate(c, t) (PCI_PMCSR_STATE_D3)
#define pci_set_powerstate_md(c, t, s, p)
-/* $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>
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 *);
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;
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;
-/* $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>
*
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 *);
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;
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;
-/* $OpenBSD: bcm2711_pcie.c,v 1.4 2021/01/20 12:44:45 kettenis Exp $ */
+/* $OpenBSD: bcm2711_pcie.c,v 1.5 2021/02/25 23:07:49 patrick Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
int bcmpcie_conf_size(void *, pcitag_t);
pcireg_t bcmpcie_conf_read(void *, pcitag_t, int);
void bcmpcie_conf_write(void *, pcitag_t, int, pcireg_t);
+int bcmpcie_probe_device_hook(void *, struct pci_attach_args *);
int bcmpcie_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *bcmpcie_intr_string(void *, pci_intr_handle_t);
sc->sc_pc.pc_conf_size = bcmpcie_conf_size;
sc->sc_pc.pc_conf_read = bcmpcie_conf_read;
sc->sc_pc.pc_conf_write = bcmpcie_conf_write;
+ sc->sc_pc.pc_probe_device_hook = bcmpcie_probe_device_hook;
sc->sc_pc.pc_intr_v = sc;
sc->sc_pc.pc_intr_map = bcmpcie_intr_map;
HWRITE4(sc, PCIE_EXT_CFG_DATA + reg, data);
}
+int
+bcmpcie_probe_device_hook(void *v, struct pci_attach_args *pa)
+{
+ return 0;
+}
+
int
bcmpcie_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
-/* $OpenBSD: dwpcie.c,v 1.24 2020/12/28 12:24:31 kettenis Exp $ */
+/* $OpenBSD: dwpcie.c,v 1.25 2021/02/25 23:07:49 patrick Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
int dwpcie_conf_size(void *, pcitag_t);
pcireg_t dwpcie_conf_read(void *, pcitag_t, int);
void dwpcie_conf_write(void *, pcitag_t, int, pcireg_t);
+int dwpcie_probe_device_hook(void *, struct pci_attach_args *);
int dwpcie_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *dwpcie_intr_string(void *, pci_intr_handle_t);
sc->sc_pc.pc_conf_size = dwpcie_conf_size;
sc->sc_pc.pc_conf_read = dwpcie_conf_read;
sc->sc_pc.pc_conf_write = dwpcie_conf_write;
+ sc->sc_pc.pc_probe_device_hook = dwpcie_probe_device_hook;
sc->sc_pc.pc_intr_v = sc;
sc->sc_pc.pc_intr_map = dwpcie_intr_map;
sc->sc_io_bus_addr, sc->sc_io_size);
}
+int
+dwpcie_probe_device_hook(void *v, struct pci_attach_args *pa)
+{
+ return 0;
+}
+
int
dwpcie_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
-/* $OpenBSD: mvkpcie.c,v 1.8 2021/01/19 19:46:40 kettenis Exp $ */
+/* $OpenBSD: mvkpcie.c,v 1.9 2021/02/25 23:07:49 patrick Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2020 Patrick Wildt <patrick@blueri.se>
int mvkpcie_conf_size(void *, pcitag_t);
pcireg_t mvkpcie_conf_read(void *, pcitag_t, int);
void mvkpcie_conf_write(void *, pcitag_t, int, pcireg_t);
+int mvkpcie_probe_device_hook(void *, struct pci_attach_args *);
int mvkpcie_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *mvkpcie_intr_string(void *, pci_intr_handle_t);
sc->sc_pc.pc_conf_size = mvkpcie_conf_size;
sc->sc_pc.pc_conf_read = mvkpcie_conf_read;
sc->sc_pc.pc_conf_write = mvkpcie_conf_write;
+ sc->sc_pc.pc_probe_device_hook = mvkpcie_probe_device_hook;
sc->sc_pc.pc_intr_v = sc;
sc->sc_pc.pc_intr_map = mvkpcie_intr_map;
}
}
+int
+mvkpcie_probe_device_hook(void *v, struct pci_attach_args *pa)
+{
+ return 0;
+}
+
int
mvkpcie_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{
-/* $OpenBSD: rkpcie.c,v 1.11 2020/07/14 15:42:19 patrick Exp $ */
+/* $OpenBSD: rkpcie.c,v 1.12 2021/02/25 23:07:49 patrick Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
int rkpcie_conf_size(void *, pcitag_t);
pcireg_t rkpcie_conf_read(void *, pcitag_t, int);
void rkpcie_conf_write(void *, pcitag_t, int, pcireg_t);
+int rkpcie_probe_device_hook(void *, struct pci_attach_args *);
int rkpcie_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
const char *rkpcie_intr_string(void *, pci_intr_handle_t);
sc->sc_pc.pc_conf_size = rkpcie_conf_size;
sc->sc_pc.pc_conf_read = rkpcie_conf_read;
sc->sc_pc.pc_conf_write = rkpcie_conf_write;
+ sc->sc_pc.pc_probe_device_hook = rkpcie_probe_device_hook;
sc->sc_pc.pc_intr_v = sc;
sc->sc_pc.pc_intr_map = rkpcie_intr_map;
}
}
+int
+rkpcie_probe_device_hook(void *v, struct pci_attach_args *pa)
+{
+ return 0;
+}
+
int
rkpcie_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
{