From patchwork Fri Sep 12 16:34:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 37351 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7053C206A5 for ; Fri, 12 Sep 2014 16:37:07 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gi9sf651132lab.11 for ; Fri, 12 Sep 2014 09:37:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=BblYLfiszfgN+UomzXMe6tZQytUmmdE6/U3Q0sE/HUw=; b=E3PPXLZFpdL+mXH7Wwj163gyaqVzav3hOY5KU5BxatHxVqfAWZ6XuQ0VLNRzvZxe3h h8jmpPa0zl7FVi5wAIQr89A5k7vUU32AvhghGwx2mhS4iw4c1TeO3qzXrjzceEzwysU1 /lUk+M8ch8ObbvmFZGsQMiPNA8qyBT9UiKAFj8yjSkYZb97hhEIrGK2h9XDk+aH4FlXS cOzjZxXjkjbV6OHAyBdJOLAqz1gXJ3OD/UXTUom76/WY7estt+oFQJrZo1YGLWP/x2M2 VdJAySV93TbGFR1qzuVdWIZuIWVTTNrSnzBbHC/QVJA3M4KF0Sy3FgZsbtOhm0nGofEk StqA== X-Gm-Message-State: ALoCoQn/rUO09kvtQVUx4IRNiPEmIcNa+gy8xEc3ASrYAbXLgCJ2SEXr0vgaYWM2QREUgBmn2mj1 X-Received: by 10.112.137.230 with SMTP id ql6mr2595367lbb.13.1410539826180; Fri, 12 Sep 2014 09:37:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.193 with SMTP id x1ls206042lae.53.gmail; Fri, 12 Sep 2014 09:37:06 -0700 (PDT) X-Received: by 10.112.34.78 with SMTP id x14mr9861617lbi.38.1410539826012; Fri, 12 Sep 2014 09:37:06 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx.google.com with ESMTPS id ei11si7427294lad.2.2014.09.12.09.37.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Sep 2014 09:37:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id mc6so1313242lab.17 for ; Fri, 12 Sep 2014 09:37:05 -0700 (PDT) X-Received: by 10.112.62.200 with SMTP id a8mr9637358lbs.34.1410539825947; Fri, 12 Sep 2014 09:37:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.141.42 with SMTP id rl10csp769100lbb; Fri, 12 Sep 2014 09:37:05 -0700 (PDT) X-Received: by 10.66.65.230 with SMTP id a6mr13897826pat.18.1410539824188; Fri, 12 Sep 2014 09:37:04 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id td1si8852698pbc.140.2014.09.12.09.37.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Sep 2014 09:37:04 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XSTor-0002Ku-Bu; Fri, 12 Sep 2014 16:35:33 +0000 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XSTon-00020Q-42; Fri, 12 Sep 2014 16:35:30 +0000 Received: from edgewater-inn.cambridge.arm.com (edgewater-inn.cambridge.arm.com [10.1.203.204]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id s8CGYuwo029970; Fri, 12 Sep 2014 17:34:56 +0100 (BST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 82DBD1AE0C90; Fri, 12 Sep 2014 17:34:57 +0100 (BST) From: Will Deacon To: linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Subject: [RFC PATCH v3 3/7] iommu: add new iommu_ops callback for adding an OF device Date: Fri, 12 Sep 2014 17:34:51 +0100 Message-Id: <1410539695-29128-4-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410539695-29128-1-git-send-email-will.deacon@arm.com> References: <1410539695-29128-1-git-send-email-will.deacon@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140912_093529_533215_A7DB3595 X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.2 (-------) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-7.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.96.50 listed in list.dnswl.org] -2.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: jroedel@suse.de, arnd@arndb.de, Will Deacon , thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com, Varun.Sethi@freescale.com, m.szyprowski@samsung.com, dwmw2@infradead.org, hdoyu@nvidia.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: will.deacon@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch adds a new function to the iommu_ops structure to allow an OF device to be added to a specific IOMMU instance using the recently merged generic devicetree binding for IOMMUs. The callback (of_xlate) takes a struct device representing the master and an of_phandle_args representing the IOMMU and the correspondong IDs for the new master. Signed-off-by: Will Deacon --- include/linux/iommu.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 4256f3ce1673..821eb0bd9f6c 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -140,6 +141,10 @@ struct iommu_ops { /* Get the numer of window per domain */ u32 (*domain_get_windows)(struct iommu_domain *domain); +#ifdef CONFIG_OF_IOMMU + int (*of_xlate)(struct device *dev, struct of_phandle_args *args); +#endif + unsigned long pgsize_bitmap; };