Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360007
| Path | csiph.com!news.freedyn.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Magnus Damm <magnus.damm@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 01/10] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE() |
| Date | Thu, 17 Mar 2016 17:30:04 +0100 |
| Message-ID | <rdIYc-1i1-41@gated-at.bofh.it> (permalink) |
| References | <rdIY9-1i1-5@gated-at.bofh.it> |
| X-Original-To | iommu@lists.linux-foundation.org |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:in-reply-to:references:subject; bh=dA3GQB6uflwdE+DJTeTMoSKTK2V5sjDzLISa9Ya8/og=; b=onRVUBMzQNX+mHZOI35l2av/RYzgtcxU5s0sEvH6DyoYy4NJldfdzJ3LwXGmxEW4hj rTem0uLPhUD+/m0ZSLlILN2dQkmGJQ1698IHcTmDWK0IokW+HmwNefi6c0CAFNiPojcg ZMcZ8PwQD5wiAaf94Y6qBXDnMmvgSuxhJBMk/otNqjUbJSx9DKr3S7q9/Hfioa9XkMfv W4sAyGSeBEAR8BgNTMqL6eX5Nk/Mu6XvaDCBJTsvewrrnxyNkjTOYsOwwXEMLZ18JsVV xYRnpx26CQ3HCoy+Uq/USpdlx02749QvKU00a641cpFo4tXSO5vDSInoNRrdcYLVtx7y oL1Q== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:subject; bh=dA3GQB6uflwdE+DJTeTMoSKTK2V5sjDzLISa9Ya8/og=; b=CuY+dDhLG8ZdWvqnTGjREqfTg7O8PEHZnXFUF++OBk01EFsdR1CNnFkNEJ7oT3rNTf xXxhlhelB6jGqQiqU7UWSyVAqspcISBbIxE8blIZvUFIpD/R/ySFkNZRpE/40W3Ifl6t DHge+tigCv+dTaLFSSkJLvNw1X8b8aUF7DrEMIzs2HW9m5v2D+BbkbK/8RZCXQgYJTLW /M3on4NMwVyJhmKdPAs2PLanPq1vhrLFkEIDrv6Te0RM+OCnT5pNSAV7JOmOGWRBjNZN WlViNWeArzCEUT9qnQuXuwGvfNMhNv9fZZA+Swn147AONK/o+MO5jFtjQeTVAwGGh32k jMyQ== |
| X-Gm-Message-State | AD7BkJIT/ghDiPBiVwQlPJ/38EIMCY1Vp2m6cXydQ86JPLHDuKs56nXjuGZauuEjR59gaA== |
| X-Received | by 10.66.140.70 with SMTP id re6mr16312276pab.100.1458231955642; Thu, 17 Mar 2016 09:25:55 -0700 (PDT) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 74 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | laurent.pinchart+renesas@ideasonboard.com, geert+renesas@glider.be, joro@8bytes.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, horms+renesas@verge.net.au, Magnus Damm <magnus.damm@gmail.com> |
| X-Original-Date | Fri, 18 Mar 2016 01:29:18 +0900 |
| X-Original-Message-ID | <20160317162918.24104.29242.sendpatchset@little-apple> |
| X-Original-References | <20160317162909.24104.31682.sendpatchset@little-apple> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1360007 |
Show key headers only | View raw
From: Magnus Damm <damm+renesas@opensource.se>
Hook up IOMMU_OF_DECLARE() support in case CONFIG_IOMMU_DMA
is enabled. The only current supported case for 32-bit ARM
is disabled, however for 64-bit ARM this is required.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---
drivers/iommu/ipmmu-vmsa.c | 31 +++++++++++++++++++++++++++----
1 file changed, 27 insertions(+), 4 deletions(-)
--- 0014/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c 2016-03-18 00:12:22.950513000 +0900
@@ -19,6 +19,7 @@
#include <linux/iommu.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_iommu.h>
#include <linux/platform_device.h>
#include <linux/sizes.h>
#include <linux/slab.h>
@@ -1016,18 +1017,22 @@ static struct platform_driver ipmmu_driv
static int __init ipmmu_init(void)
{
- const struct iommu_ops *ops;
+ static bool setup_done;
int ret;
+ if (setup_done)
+ return 0;
+
ret = platform_driver_register(&ipmmu_driver);
if (ret < 0)
return ret;
- ops = IS_ENABLED(CONFIG_IOMMU_DMA) ? &ipmmu_ops_dma : &ipmmu_ops;
-
+#if defined(CONFIG_ARM) && !defined(CONFIG_IOMMU_DMA)
if (!iommu_present(&platform_bus_type))
- bus_set_iommu(&platform_bus_type, ops);
+ bus_set_iommu(&platform_bus_type, &ipmmu_ops);
+#endif
+ setup_done = true;
return 0;
}
@@ -1039,6 +1044,24 @@ static void __exit ipmmu_exit(void)
subsys_initcall(ipmmu_init);
module_exit(ipmmu_exit);
+#ifdef CONFIG_IOMMU_DMA
+static int __init ipmmu_vmsa_iommu_of_setup(struct device_node *np)
+{
+ static const struct iommu_ops *ops = &ipmmu_ops_dma;
+
+ ipmmu_init();
+
+ of_iommu_set_ops(np, (struct iommu_ops *)ops);
+ if (!iommu_present(&platform_bus_type))
+ bus_set_iommu(&platform_bus_type, ops);
+
+ return 0;
+}
+
+IOMMU_OF_DECLARE(ipmmu_vmsa_iommu_of, "renesas,ipmmu-vmsa",
+ ipmmu_vmsa_iommu_of_setup);
+#endif
+
MODULE_DESCRIPTION("IOMMU API for Renesas VMSA-compatible IPMMU");
MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
MODULE_LICENSE("GPL v2");
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/10] iommu/ipmmu-vmsa: Initial r8a7795 support Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 09/10] iommu/ipmmu-vmsa: Allow two bit SL0 Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 06/10] iommu/ipmmu-vmsa: Add optional root device feature Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 05/10] iommu/ipmmu-vmsa: Introduce features, break out alias Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 10/10] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 07/10] iommu/ipmmu-vmsa: Write IMCTR twice Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 01/10] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE() Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 03/10] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
Re: [PATCH 03/10] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus Geert Uytterhoeven <geert@linux-m68k.org> - 2016-03-18 10:50 +0100
[PATCH 08/10] iommu/ipmmu-vmsa: Make IMBUSCTR setup optional Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 04/10] iommu/ipmmu-vmsa: IPMMU device is 64-bit bus master Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
[PATCH 02/10] iommu/ipmmu-vmsa: Enable multi context support Magnus Damm <magnus.damm@gmail.com> - 2016-03-17 17:30 +0100
csiph-web