From patchwork Fri Nov 14 18:56:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 40865 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f71.google.com (mail-ee0-f71.google.com [74.125.83.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7B82A240ED for ; Fri, 14 Nov 2014 19:05:57 +0000 (UTC) Received: by mail-ee0-f71.google.com with SMTP id e51sf11072075eek.10 for ; Fri, 14 Nov 2014 11:05:56 -0800 (PST) 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=Z7OvzEXK0NDDtYpf13Q14ZmzeXtFlzzOks4SCZIjqyQ=; b=bcJXxNW0qQtD0tDBV/0SGoyooScu3bAAeNK146ujXQXEA/tqxT7hjSXrtPn3JKseUb KwyI0Z+/ceyYKA/LE2si5WcjEwi1InJxePDay96rphZSTYcXoy0ryPNOdaqpN4t59gmQ Fo0zIMULMtFdkMcIhF7vovtavFjOxtPI1qJShlPPdx/1JH+2bOEZU07MtUHHb9qUigLP GQRjUCojabghJ2D2IoMyguLDU7RjlKfk1dA8AVLBuwsArCZ+hEzZvS8T+Hp9R/1gCmGy E/NIEIXT/1hM1uMcWm/HqVBpExV+zhiU/kR1Ym1MYmCUXUxWUxEJf48gHZS4lh/9cfcX MazQ== X-Gm-Message-State: ALoCoQmgY10zHcxuPTmFu1IDItdjz/nXGPHhRuJ/RNDu4GzhZGq6+sn/R1KTYSeXY+dFbywZk5Ui X-Received: by 10.194.239.200 with SMTP id vu8mr5128849wjc.3.1415991956644; Fri, 14 Nov 2014 11:05:56 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.225 with SMTP id bb1ls769185lab.47.gmail; Fri, 14 Nov 2014 11:05:56 -0800 (PST) X-Received: by 10.152.36.74 with SMTP id o10mr3189523laj.96.1415991956491; Fri, 14 Nov 2014 11:05:56 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id d3si42749741lbc.14.2014.11.14.11.05.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Nov 2014 11:05:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so13524027lbv.12 for ; Fri, 14 Nov 2014 11:05:56 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr9792090lad.44.1415991956387; Fri, 14 Nov 2014 11:05:56 -0800 (PST) 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.184.201 with SMTP id ew9csp819719lbc; Fri, 14 Nov 2014 11:05:55 -0800 (PST) X-Received: by 10.68.224.6 with SMTP id qy6mr12176832pbc.35.1415991954553; Fri, 14 Nov 2014 11:05:54 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id k5si18299138pdl.27.2014.11.14.11.05.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Nov 2014 11:05:54 -0800 (PST) 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 1XpM9O-00086n-GX; Fri, 14 Nov 2014 19:03:18 +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 1XpM3N-0002PV-14; Fri, 14 Nov 2014 18:57:05 +0000 Received: from edgewater-inn.cambridge.arm.com (edgewater-inn.cambridge.arm.com [10.1.203.36]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id sAEIuYwo008168; Fri, 14 Nov 2014 18:56:34 GMT Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 94E2A1AE0200; Fri, 14 Nov 2014 18:56:39 +0000 (GMT) From: Will Deacon To: linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Subject: [RFC PATCH v4 3/8] iommu: add new iommu_ops callback for adding an OF device Date: Fri, 14 Nov 2014 18:56:32 +0000 Message-Id: <1415991397-9618-4-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1415991397-9618-1-git-send-email-will.deacon@arm.com> References: <1415991397-9618-1-git-send-email-will.deacon@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141114_105705_399553_B35F6B2A X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.0 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] -0.0 T_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.217.181 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 7b83f9f8e11d..415c7613d02c 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -102,6 +103,7 @@ enum iommu_attr { * @remove_device: remove device from iommu grouping * @domain_get_attr: Query domain attributes * @domain_set_attr: Change domain attributes + * @of_xlate: add OF master IDs to iommu grouping * @pgsize_bitmap: bitmap of supported page sizes * @priv: per-instance data private to the iommu driver */ @@ -133,6 +135,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; void *priv; };