Received: by 10.223.185.116 with SMTP id b49csp2667972wrg; Mon, 5 Mar 2018 06:54:46 -0800 (PST) X-Google-Smtp-Source: AG47ELuVv78cnqdEICGGoUEXsmEnuBR4RY1BUFJ/Oo++Fvd3dIemPsS0NQ27Ct9ExQSQXhP/9GpP X-Received: by 10.98.89.156 with SMTP id k28mr15394987pfj.130.1520261686586; Mon, 05 Mar 2018 06:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520261686; cv=none; d=google.com; s=arc-20160816; b=ib6ZEcN70tJ4TwUssHjrdsgbNX1ySHEtuVg9uoYMIXHtSaQRK/GPcn91TVF/NWvVVk wtPdU1KDSEi5wDNTCWdki4Fte2X0P+XfHCYZpNEzcuTkxTHJadAbmHwdT877PKwCWGNG xFIJDpQZvrV2zDLcVJEIrMlXoFjzHLCkPzsanJw16byCUfa8dbkrCEdYQp1d+8hI4pJk qckdxmdEhQvOZf5xn417UMEVmlsiolxQeqZV1ls9zhaG1qsLas3LdquT8esLOIylrWG1 F4+BnlxKfHBS7VNGiaBxdVEUWuYwH2C+pkiWVr1A9Hi3cKUgdda3r2KyDkjN7gsqjT/R bbCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=JW3TUQhgTO6csdbZU8ieDnnq0UDT6i2CqeBlYxcbuT0=; b=EmDBQvGY3RBcGXsVxTum4CX7+ZvC0GVK/NPibVmY1WbmLhvw6Jh3IqtRhN04SQUW5T CZSwXarX+VqKICt2k4xsuVK5XtX05QMwzxGtaB3dYVLQ86vabaPd5pnPKqhkrCH2/oS8 eri4LP8zBi+Q2vmDMx23gsZcMTQ0uNIF7Zkhn6dQWdeDqpoCyc0WIFre0cG+oYLqWA/4 xl1KQ+fnDEjrSmA+cIRdk8/IbQQg3IbHyGHyXz8ixxCtrrk+fDrYK/NuxXt7R+ICbvmW mhrrpd7gRS+XYjP+dvqVpS9dHPJ2c4DFkoYnHzv7TULFG91s5eWAkEoSznHVaR3J7p7J Kgng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r19si10370702pfi.100.2018.03.05.06.54.31; Mon, 05 Mar 2018 06:54:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752462AbeCEOx3 (ORCPT + 99 others); Mon, 5 Mar 2018 09:53:29 -0500 Received: from foss.arm.com ([217.140.101.70]:51566 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751881AbeCEOx0 (ORCPT ); Mon, 5 Mar 2018 09:53:26 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B8021529; Mon, 5 Mar 2018 06:53:26 -0800 (PST) Received: from [10.1.210.88] (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 877283F25C; Mon, 5 Mar 2018 06:53:23 -0800 (PST) Subject: Re: [PATCH 1/6] Docs: dt: add fsl-mc iommu-parent device-tree binding To: Nipun Gupta , will.deacon@arm.com, mark.rutland@arm.com, catalin.marinas@arm.com Cc: iommu@lists.linux-foundation.org, robh+dt@kernel.org, hch@lst.de, m.szyprowski@samsung.com, gregkh@linuxfoundation.org, joro@8bytes.org, leoyang.li@nxp.com, shawnguo@kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, laurentiu.tudor@nxp.com References: <1520260166-29387-1-git-send-email-nipun.gupta@nxp.com> <1520260166-29387-2-git-send-email-nipun.gupta@nxp.com> From: Robin Murphy Message-ID: <5cdeded1-ca3c-339a-bf73-73401e7dd4ed@arm.com> Date: Mon, 5 Mar 2018 14:53:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1520260166-29387-2-git-send-email-nipun.gupta@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/03/18 14:29, Nipun Gupta wrote: > The existing IOMMU bindings cannot be used to specify the relationship > between fsl-mc devices and IOMMUs. This patch adds a binding for > mapping fsl-mc devices to IOMMUs, using a new iommu-parent property. Given that allowing "msi-parent" for #msi-cells > 1 is merely a backward-compatibility bodge full of hard-coded assumptions, why would we want to knowingly introduce a similarly unpleasant equivalent for IOMMUs? What's wrong with "iommu-map"? > Signed-off-by: Nipun Gupta > --- > .../devicetree/bindings/misc/fsl,qoriq-mc.txt | 31 ++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt b/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt > index 6611a7c..011c7d6 100644 > --- a/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt > +++ b/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt > @@ -9,6 +9,24 @@ blocks that can be used to create functional hardware objects/devices > such as network interfaces, crypto accelerator instances, L2 switches, > etc. > > +For an overview of the DPAA2 architecture and fsl-mc bus see: > +drivers/staging/fsl-mc/README.txt > + > +As described in the above overview, all DPAA2 objects in a DPRC share the > +same hardware "isolation context" and a 10-bit value called an ICID > +(isolation context id) is expressed by the hardware to identify > +the requester. IOW, precisely the case for which "{msi,iommu}-map" exist. Yes, I know they're currently documented under bindings/pci, but they're not really intended to be absolutely PCI-specific. Robin. > +The generic 'iommus' property is cannot be used to describe the relationship > +between fsl-mc and IOMMUs, so an iommu-parent property is used to define > +the same. > + > +For generic IOMMU bindings, see > +Documentation/devicetree/bindings/iommu/iommu.txt. > + > +For arm-smmu binding, see: > +Documentation/devicetree/bindings/iommu/arm,smmu.txt. > + > Required properties: > > - compatible > @@ -88,14 +106,27 @@ Sub-nodes: > Value type: > Definition: Specifies the phandle to the PHY device node associated > with the this dpmac. > +Optional properties: > + > +- iommu-parent: Maps the devices on fsl-mc bus to an IOMMU. > + The property specifies the IOMMU behind which the devices on > + fsl-mc bus are residing. > > Example: > > + smmu: iommu@5000000 { > + compatible = "arm,mmu-500"; > + #iommu-cells = <1>; > + stream-match-mask = <0x7C00>; > + ... > + }; > + > fsl_mc: fsl-mc@80c000000 { > compatible = "fsl,qoriq-mc"; > reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */ > <0x00000000 0x08340000 0 0x40000>; /* MC control reg */ > msi-parent = <&its>; > + iommu-parent = <&smmu>; > #address-cells = <3>; > #size-cells = <1>; > >