diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2021-02-28 21:06:59 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2021-02-28 21:06:59 +0000 |
commit | fceb4cda9a2f9509454710cf7d462693389fe077 (patch) | |
tree | d3596ac84c9d20891b7b35ecfa0d7005daeae60e /sys/arch/arm64 | |
parent | 2823f54c6ba21f65cf488aa682634c1f42cb3eac (diff) |
Issue call to IOMMU OFW API to collect an IOMMU-sprinkled DMA tag.
ok kettenis@
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r-- | sys/arch/arm64/dev/pciecam.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/pciecam.c b/sys/arch/arm64/dev/pciecam.c index 4acd26611c9..c5f03544cdd 100644 --- a/sys/arch/arm64/dev/pciecam.c +++ b/sys/arch/arm64/dev/pciecam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciecam.c,v 1.12 2021/02/25 23:07:48 patrick Exp $ */ +/* $OpenBSD: pciecam.c,v 1.13 2021/02/28 21:06:58 patrick Exp $ */ /* * Copyright (c) 2013,2017 Patrick Wildt <patrick@blueri.se> * @@ -35,6 +35,7 @@ #include <dev/ofw/openfirm.h> #include <dev/ofw/ofw_clock.h> #include <dev/ofw/ofw_pinctrl.h> +#include <dev/ofw/ofw_misc.h> /* Assembling ECAM Configuration Address */ #define PCIE_BUS_SHIFT 20 @@ -324,6 +325,12 @@ pciecam_conf_write(void *v, pcitag_t tag, int reg, pcireg_t data) int pciecam_probe_device_hook(void *v, struct pci_attach_args *pa) { + struct pciecam_softc *sc = (struct pciecam_softc *)v; + uint16_t rid; + + rid = pci_requester_id(pa->pa_pc, pa->pa_tag); + pa->pa_dmat = iommu_device_map_pci(sc->sc_node, rid, pa->pa_dmat); + return 0; } |