From: patrick Date: Sun, 28 Feb 2021 21:10:22 +0000 (+0000) Subject: Issue call to IOMMU OFW API to collect an IOMMU-sprinkled DMA tag. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1d276ec2d0c11592a5e08931cad92c4cdd9d06d4;p=openbsd Issue call to IOMMU OFW API to collect an IOMMU-sprinkled DMA tag. ok kettenis@ --- diff --git a/sys/arch/arm64/dev/mainbus.c b/sys/arch/arm64/dev/mainbus.c index 2a257ac6300..b40c2169da8 100644 --- a/sys/arch/arm64/dev/mainbus.c +++ b/sys/arch/arm64/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.19 2020/08/26 03:29:05 visa Exp $ */ +/* $OpenBSD: mainbus.c,v 1.20 2021/02/28 21:10:22 patrick Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * Copyright (c) 2017 Mark Kettenis @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -267,6 +268,8 @@ mainbus_attach_node(struct device *self, int node, cfmatch_t submatch) fa.fa_dmat->_flags |= BUS_DMA_COHERENT; } + fa.fa_dmat = iommu_device_map(fa.fa_node, fa.fa_dmat); + if (submatch == NULL && sc->sc_early == 0) print = mainbus_print; if (submatch == NULL) diff --git a/sys/arch/arm64/dev/simplebus.c b/sys/arch/arm64/dev/simplebus.c index 1777fa7665f..5ff303dcd72 100644 --- a/sys/arch/arm64/dev/simplebus.c +++ b/sys/arch/arm64/dev/simplebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: simplebus.c,v 1.12 2020/11/19 17:42:59 kettenis Exp $ */ +/* $OpenBSD: simplebus.c,v 1.13 2021/02/28 21:10:22 patrick Exp $ */ /* * Copyright (c) 2016 Patrick Wildt * @@ -21,8 +21,10 @@ #include #include +#include #include #include +#include #include #include @@ -252,6 +254,8 @@ simplebus_attach_node(struct device *self, int node) fa.fa_dmat->_flags |= BUS_DMA_COHERENT; } + fa.fa_dmat = iommu_device_map(fa.fa_node, fa.fa_dmat); + child = config_found_sm(self, &fa, sc->sc_early ? NULL : simplebus_print, simplebus_submatch);