xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Tyshchenko <olekstysh@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	julien.grall@arm.com, sstabellini@kernel.org,
	Volodymyr_Babchuk@epam.com, Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH V3 6/8] iommu: Add of_xlate callback
Date: Tue, 20 Aug 2019 21:09:45 +0300	[thread overview]
Message-ID: <1566324587-3442-7-git-send-email-olekstysh@gmail.com> (raw)
In-Reply-To: <1566324587-3442-1-git-send-email-olekstysh@gmail.com>

From: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>

According to the generic IOMMU DT bindings [1] the context of
required properties for IOMMU device/master node (#iommu-cells, iommus)
depends on many factors and is really driver depended thing.

We need some way to provide the driver with DT IOMMU specifier which
describes the IOMMU master interfaces of that device (device IDs, etc)
to let it decide how to interpret them. For that reason we can borrow
Linux's "of_xlate" callback.

All IOMMU drivers which support generic IOMMU DT bindings should use
this callback.

Subsequent patches will use of that support.

[1] https://www.kernel.org/doc/Documentation/devicetree/bindings/iommu/iommu.txt

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
CC: Julien Grall <julien.grall@arm.com>
CC: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/iommu.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 48f8748..79b86ac 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -240,6 +240,16 @@ struct iommu_ops {
     int __must_check (*iotlb_flush_all)(struct domain *d);
     int (*get_reserved_device_memory)(iommu_grdm_t *, void *);
     void (*dump_p2m_table)(struct domain *d);
+
+#ifdef CONFIG_HAS_DEVICE_TREE
+    /*
+     * All IOMMU drivers which support generic IOMMU DT bindings should use
+     * this callback. This is a way for the framework to provide the driver
+     * with DT IOMMU specifier which describes the IOMMU master interfaces of
+     * that device (device IDs, etc).
+     */
+    int (*of_xlate)(device_t *dev, struct dt_phandle_args *args);
+#endif
 };
 
 #include <asm/iommu.h>
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-08-20 18:10 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 18:09 [Xen-devel] [PATCH V3 0/8] iommu/arm: Add Renesas IPMMU-VMSA support + Linux's iommu_fwspec Oleksandr Tyshchenko
2019-08-20 18:09 ` [Xen-devel] [PATCH V3 1/8] iommu/arm: Add iommu_helpers.c file to keep common for IOMMUs stuff Oleksandr Tyshchenko
2019-09-09 11:45   ` Julien Grall
2019-09-09 14:12     ` Oleksandr
2019-08-20 18:09 ` [Xen-devel] [PATCH V3 2/8] iommu/arm: Add ability to handle deferred probing request Oleksandr Tyshchenko
2019-09-09 12:24   ` Julien Grall
2019-09-09 14:19     ` Oleksandr
2019-08-20 18:09 ` [Xen-devel] [PATCH V3 3/8] xen/common: Introduce _xrealloc function Oleksandr Tyshchenko
2019-08-21  8:09   ` Paul Durrant
2019-08-21 14:36     ` Oleksandr
2019-08-21 15:47       ` Paul Durrant
2019-08-21 17:04         ` Oleksandr
2019-08-20 18:09 ` [Xen-devel] [PATCH V3 4/8] xen/common: Introduce xrealloc_flex_struct() helper macros Oleksandr Tyshchenko
2019-08-27 13:28   ` Jan Beulich
2019-08-28 18:23     ` Oleksandr
2019-08-29  7:21       ` Jan Beulich
2019-08-29 19:04         ` Oleksandr
2019-08-20 18:09 ` [Xen-devel] [PATCH V3 5/8] iommu/arm: Add lightweight iommu_fwspec support Oleksandr Tyshchenko
2019-09-09 14:36   ` Julien Grall
2019-09-09 14:41     ` Oleksandr
2019-08-20 18:09 ` Oleksandr Tyshchenko [this message]
2019-08-27 13:30   ` [Xen-devel] [PATCH V3 6/8] iommu: Add of_xlate callback Jan Beulich
2019-08-27 14:59     ` Oleksandr
2019-08-27 15:11       ` Jan Beulich
2019-09-09 12:37         ` Julien Grall
2019-09-09 14:28           ` Oleksandr
2019-08-20 18:09 ` [Xen-devel] [PATCH V3 7/8] iommu/arm: Introduce iommu_add_dt_device API Oleksandr Tyshchenko
2019-09-09 15:04   ` Julien Grall
2019-09-09 15:48     ` Oleksandr
2019-09-10 13:34       ` Oleksandr
2019-09-10 14:30         ` Julien Grall
2019-08-20 18:09 ` [Xen-devel] [PATCH V3 8/8] iommu/arm: Add Renesas IPMMU-VMSA support Oleksandr Tyshchenko
2019-08-29  8:37   ` Yoshihiro Shimoda
2019-08-29 10:56     ` Oleksandr
2019-09-02  7:04       ` Yoshihiro Shimoda
2019-09-09 14:33         ` Oleksandr
2019-08-29 11:19   ` Oleksandr
2019-09-09 21:24   ` Julien Grall
2019-09-10 11:04     ` Oleksandr
2019-09-10 14:31       ` Julien Grall
2019-09-11 15:29         ` Oleksandr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1566324587-3442-7-git-send-email-olekstysh@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).