From patchwork Mon Sep 10 13:49:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 10594185 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E356C14BD for ; Mon, 10 Sep 2018 13:51:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D12BC28F9A for ; Mon, 10 Sep 2018 13:51:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C36F0290E0; Mon, 10 Sep 2018 13:51:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E37328F9A for ; Mon, 10 Sep 2018 13:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728882AbeIJSov (ORCPT ); Mon, 10 Sep 2018 14:44:51 -0400 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:34336 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728174AbeIJSou (ORCPT ); Mon, 10 Sep 2018 14:44:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QdRUE4YU5k4GAd9F5Z4WTw0gnOdOkOqibyLlcGGJp1A=; b=dW1IhKTg6Q1DGK0PIzBrkL6uY0TRDsuOL79s+lmIpjNlJ9ATHPrGlSYXM5KupB6HdTBbnKqMArI3uKAiR0srwqrTKAYJn0NfCCCQEbk8TcZQApsccIlV9PcmJqWUEt9XfUOMgGaKJoNtHXXNsio141fayBJbtokEpJsNKDnSjUs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 13:50:07 +0000 From: Nipun Gupta To: joro@8bytes.org, robin.murphy@arm.com, will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com, hch@lst.de Cc: m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com, Nipun Gupta Subject: [PATCH 1/7 v7] Documentation: fsl-mc: add iommu-map device-tree binding for fsl-mc bus Date: Mon, 10 Sep 2018 19:19:15 +0530 Message-Id: <1536587361-11047-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> References: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: PN1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::11) To DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 12e08c51-b0a8-4679-7cfa-08d6172453eb X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4476; X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;3:1pxJAvNnFjVTdIz9azs5X0u1Sn/uxZVwW29nifFimK/o48y5JaGN63sqGsrAtLW4hnp2HbMNPu5b4FshtVkF3Sd/N5lu82Uzw86BOlAKNULaeTTlwwI2AVOY0R+a13QQ3hDxcuBFvu49kKba5ARcKttsCNuqfKBssvBKWNg7DRs2GaVT+pirreuSdHaxn4h05cvCRL7SglfBUTOrSjWgPomq6HonP9WZyJ0YYnrgSkubRc6Fn6BSooCtoUZh75M6;25:95cUOj+G6DlAgXk917mj5lfuPwcQ4TiDRiskEISmvMoHzVw8HavJl+Bp6eKffS0jImZoZfa4QyGtvbTrXZtqUYhMYhRJFRP1OeQthomgJt4XOuD0Pt6Dsgw/dQCvw9sC9jcm+X/CiGnEuAnG4P/mY40c4cAxAdP9I4QJbSI96G1SH4vSFsbviNOG4AvxdsZR2GW3bjg7S5vFoiXxBhLYHwHj/NlnOPyTqHaNAJLTmoP306eRbUyOUz5iNq/beZ5KWu1eyK9f+y7AJ0bddShXehUmvmFGkZU2WWw27LgD0zlvzEof5Ny/CU7C1FcxM2Z3oCgHlmvYxN2KKJoQdUcp3g==;31:tfTVXZtEKQdoAbKF6dOdN1ZHW2FyHFA4/7DOEfn8f8NgpTnVMN5kyHpVkTSkk4jQ1AQsKAG8/nkphdHFYUzete2G5qgEeFvLte+T+3diw4lXXGYZiiJshogYjNgtDm0LJy7+E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Jy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DB7PR04MB4476;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4476; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(39860400002)(346002)(376002)(199004)(189003)(48376002)(81166006)(8936002)(81156014)(105586002)(106356001)(44832011)(53936002)(47776003)(50466002)(7416002)(316002)(956004)(16586007)(6512007)(2616005)(575784001)(476003)(26005)(186003)(66066001)(486006)(11346002)(25786009)(6506007)(386003)(50226002)(446003)(2906002)(16526019)(86362001)(55236004)(6116002)(3846002)(97736004)(4326008)(68736007)(7736002)(5009440100003)(305945005)(6486002)(8676002)(478600001)(52116002)(51416003)(5660300001)(76176011)(39060400002)(6666003)(36756003)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4476;H:b27504-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;23:DsrrW42ZDKgvRIwUkHZzvoliJFOYhYdv4HpemP4YwdrRUYndOO2VcXiYhjdS16r5hEC4cnQ2z8JCAGmBNoVSIqdob8AdxThhvakXkjdDCMwadU0QplF/bf8V4B7GhF3fgQoGwfSlI3pgLdru6f/Bjibi/C6WlzRT/maYMgR9v8smkAH0L32Elgy4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Atp/35fGbzScWhF+3ud9AI2d0QjJkjiH6W+xL3ZN56vSgBlG3vUc7/OCEjzZ1uIqGkAogHngrvoHcBRzF+ca5jn9L/qLAsp0lQ=;7:7LddvOXsAVXhrdoRRg0zmMIpQYUDTgtFBA+7iiGZQFbuVDR5Ph1Egde23e5JWFsOsKVlTJuAUtNlNa8SmkEjElFT0n18Dqyk2YsvUAU7IHIyCVDhylXLJnTAQJxibTOM/m86+Sx4XH1zhjgPKRmNU9EcgSOrxXMABVMK66IFcQNjDyg/rbKaGP54g5rgBDE/7ks85+x9ucVg+fZA4Q4myfTVd+yP1zPIl4p05O3QO74ZkWyhvoSP+Zvw2aLrYJ3A SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:50:07.1777 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12e08c51-b0a8-4679-7cfa-08d6172453eb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4476 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The existing IOMMU bindings cannot be used to specify the relationship between fsl-mc devices and IOMMUs. This patch adds a generic binding for mapping fsl-mc devices to IOMMUs, using iommu-map property. Signed-off-by: Nipun Gupta Reviewed-by: Rob Herring Acked-by: Robin Murphy --- .../devicetree/bindings/misc/fsl,qoriq-mc.txt | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt b/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt index 6611a7c..01fdc33 100644 --- a/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt +++ b/Documentation/devicetree/bindings/misc/fsl,qoriq-mc.txt @@ -9,6 +9,25 @@ 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: +Documentation/networking/dpaa2/overview.rst + +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. + +The generic 'iommus' property is insufficient to describe the relationship +between ICIDs and IOMMUs, so an iommu-map property is used to define +the set of possible ICIDs under a root DPRC and how they map to +an IOMMU. + +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 +107,34 @@ Sub-nodes: Value type: Definition: Specifies the phandle to the PHY device node associated with the this dpmac. +Optional properties: + +- iommu-map: Maps an ICID to an IOMMU and associated iommu-specifier + data. + + The property is an arbitrary number of tuples of + (icid-base,iommu,iommu-base,length). + + Any ICID i in the interval [icid-base, icid-base + length) is + associated with the listed IOMMU, with the iommu-specifier + (i - icid-base + iommu-base). 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>; + /* define map for ICIDs 23-64 */ + iommu-map = <23 &smmu 23 41>; #address-cells = <3>; #size-cells = <1>; From patchwork Mon Sep 10 13:49:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 10594169 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF07C14BD for ; Mon, 10 Sep 2018 13:50:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD3C4290DD for ; Mon, 10 Sep 2018 13:50:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD23D290E1; Mon, 10 Sep 2018 13:50:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB37A290DD for ; Mon, 10 Sep 2018 13:50:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728910AbeIJSoy (ORCPT ); Mon, 10 Sep 2018 14:44:54 -0400 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:34336 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728635AbeIJSoy (ORCPT ); Mon, 10 Sep 2018 14:44:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ngj95YNmm4wbigjDBUZoc9Z6XrAr3QNi+1Mnz6jA708=; b=nAbbWWxmTilhgveT3YFX+r0ERfmY14tbTZktWV2+brgaq60yq4elP3EuK8XsqXwEB8+NXDATyc0SPA7ikWE9baTVR0OZ3O++/8B0vnL5KrQSOPHrwyz1UmdeykEtss1+lkWVsaICErqCI4rkiYmz/CvuRcFvPyNP/gp8J5DWhOQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 13:50:12 +0000 From: Nipun Gupta To: joro@8bytes.org, robin.murphy@arm.com, will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com, hch@lst.de Cc: m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com, Nipun Gupta Subject: [PATCH 2/7 v7] iommu/of: make of_pci_map_rid() available for other devices too Date: Mon, 10 Sep 2018 19:19:16 +0530 Message-Id: <1536587361-11047-3-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> References: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: PN1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::11) To DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d61353d-29b4-4128-e031-08d61724573b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4476; X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;3:rBkXZqq/0H+7qY8ZN0PWadbGnB7AL7dokQr1wH2LpHrBT4/D/K7z4iubvNg2t4QLJmPcmKatxtzdOo+nbQUgzBuxcRCAhFUXNlw3quxSFAx+Jx3C6vxiupc+BoEwnYAXRQM/KY8hc1Bv50vy72h3WiOwjpmQo6aA19iE6+pVBDvk4jFqi9XD4XDFTmXlwNCdORpor62Kz9G1nCRjX96hYrK5DBCjZosMuZlr18b4l4/Jf/kk7YchF+C/yDIK8ccr;25:/wReoJDKkis2i5hdXZZOm72z9G/pMxd4ab04W/7u0Lif2P9vLkO2P4NfwzuEqF5dQgbz7a//29wVgvzAiPfXVgG2w1BLlEYDyNn29hW5WhsJAskOylf0T5llfkrDlkZ2Wy97x+oeP06EOEvjLcJ5sBq5ANgwVvmsI+Qfq/au/lQrL8u1pMy80JlqP59Kk+TI+RV5eab2DNibS75j6jbiiANcOe8YDjg8JuetIrp+Fy0NQDyRc3qJo7HJnO0YX/rW3HQ0IwNJX8XRsSGKJq8ff3IfaX+fkxAZq1BymKx/3ecu/QWFcdhKJotavL512r9D4ePvB4qIY7DG6NaUADwBRQ==;31:LGG1+tbeUzqY3sjZyCJ7fe1v6af4NL8L7xzsU6c8vfDBfZsY5xdT9YxOnNTWmjl/NdJ1vokCNpdYuGNLQV7zIhr0ZgW9bsD1exIUnTXRjhDVmTSAtIkszcS5uSs0gfhSJxsnngKtHL7YPOhPR2nENEa6yIeDLdmh6grzjr/6HUpoqSoRVHY9AyY6BoB+/vT3ISZ4Rq668TqIkyWH4Sar59tawCg2XmlzCTQqxU7GVeg= X-MS-TrafficTypeDiagnostic: DB7PR04MB4476: X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;20:xFIga6Amhq6O0KkQYRDOFe/OYJVo9vXWwe7U0DNT+1CFGCZBIvdzskKP4QWwZyqDWkNfKkIluXe7fgylPWmlRraTJMrkUkfA2oW1Ai0oY7A+RekGRRjSPbFabJyPix+YgR1gRB/sNmGVqBoCgsLeuOXhaPQBNLZX5oYMW9QFmjK81RypyYl/wHurKzgSiD2gEkeH0AIv+NvXcvJRX7kAC9sdLbpW0CdzdZoFdrEGvXFgbTRJy3n8e3N7RJb+ud1R+qvh7qXMgwtQSIgG31NholDxdOOo7txHKS6y3iaVUG6PL1iA1/+DlU7HRjKHFFwDJtQUYy+FXKKor9z6W4HvhwBT1/1sRKMJZAgBbZdmgpNEddwPpqMhwQBdX9/00ABqpARryqP4uIecwxPTIZ/w5qqkA79lrCVSqHBLuzJb0ktv57jKvDqizzeiKjm+Fn94PUlAOTuX2FNtR2Q9Ucsx/CzbqiSGGTkIRzwF993VND2KjJjiuT0vwVmNNwWlPIWX;4:ErekKLs1OTSW5B5upZ7Gl9NbQqBptbo5DVVGRg4JuOI223xQ6/e1aZ5QuYIKSyBPQgFko58lE8VQINmoTTqUdpYf41Opg/cBkCJJE2xRX+hxtop2fFhHIAjEFJJHW1THuq/VtCaYlMoSlA9eHxGmwCXYmrVqlgzERMwjRgr5NgZ3SQoZ3aEjW6q6JWrkYPfnehxB2FPhDch3d331PzxdazaNDHfxTDkB5pK61/0X6uu3HPsQcvoFyX2NItYSbrwtKk3vY0sV+duA2QsboFeF7aMEdMG8gZVZYDVDxUWm2wgTl4Gn25bH1NEULFjmNm0dPFv97+8hu7Qjus3FjEd8d+kRPAhOqSzK7jglSn9Rl7YlDMIc1RhhTWVL18//zZHKksikIfng3fi/iFyt8nW+pdP4+OiOZOj19/HT/9 utDWo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197)(211936372134217)(153496737603132); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DB7PR04MB4476;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4476; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(39860400002)(346002)(376002)(199004)(189003)(14444005)(48376002)(81166006)(8936002)(81156014)(105586002)(106356001)(44832011)(53936002)(47776003)(50466002)(7416002)(316002)(956004)(16586007)(6512007)(2616005)(476003)(26005)(186003)(66066001)(486006)(11346002)(25786009)(6506007)(386003)(50226002)(446003)(2906002)(16526019)(86362001)(55236004)(6116002)(3846002)(97736004)(4326008)(68736007)(7736002)(5009440100003)(305945005)(6486002)(8676002)(478600001)(52116002)(51416003)(5660300001)(76176011)(39060400002)(36756003)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4476;H:b27504-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;23:0OM0VeJUXVS3Ym9ImvjEX1RbOpAQUYi32SI4wVL0yAl/GNhhLXtiSwG5ugytsnyTQGq79kGa5m5oZARhxLDUVymSEEzYipp+KsFd4H93D03ciXL1YtQDLAIIWkYGlVHQDY0pbnTIb2qyE0kUvPRmPo502f4m9tpE2lv1RsU+26yhsg5dpYKkfm7H3P20BLS7is/A46/10XaWlDOZrG+Tc3qCtKEuY2jZneOXnI+ZO8L6+SVMxiXDJ707TF6IfFvf2ypK8HfGzYg/j60xnw9bn44WxTu+h396u6jyvP+ea/o1KQx5W8v3Y5O61i9VSSaWUeF28DqvT4hADl8Yg9233aaficNbS+JPOPsBBAYT+FyFRs+RHjR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O64tl6EqnD8YwhhvvSwwrpgpZ17ZEVRJrC+QRmxRcbr5civK7n4qEr76MCk6mcGrBast4pX10CswKH3oeX8VET/QknfZGthuDHxYSIBrX9BI4FM3667KANU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:50:12.6936 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d61353d-29b4-4128-e031-08d61724573b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4476 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP iommu-map property is also used by devices with fsl-mc. This patch moves the of_pci_map_rid to generic location, so that it can be used by other busses too. 'of_pci_map_rid' is renamed here to 'of_map_rid' and there is no functional change done in the API. Signed-off-by: Nipun Gupta Reviewed-by: Rob Herring Reviewed-by: Robin Murphy Acked-by: Bjorn Helgaas --- drivers/iommu/of_iommu.c | 5 +-- drivers/of/base.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/of/irq.c | 5 +-- drivers/pci/of.c | 101 ---------------------------------------------- include/linux/of.h | 11 +++++ include/linux/of_pci.h | 10 ----- 6 files changed, 117 insertions(+), 117 deletions(-) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 5c36a8b..811e160 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -149,9 +149,8 @@ static int of_pci_iommu_init(struct pci_dev *pdev, u16 alias, void *data) struct of_phandle_args iommu_spec = { .args_count = 1 }; int err; - err = of_pci_map_rid(info->np, alias, "iommu-map", - "iommu-map-mask", &iommu_spec.np, - iommu_spec.args); + err = of_map_rid(info->np, alias, "iommu-map", "iommu-map-mask", + &iommu_spec.np, iommu_spec.args); if (err) return err == -ENODEV ? NO_IOMMU : err; diff --git a/drivers/of/base.c b/drivers/of/base.c index 848f549..c7aac81 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1995,3 +1995,105 @@ int of_find_last_cache_level(unsigned int cpu) return cache_level; } + +/** + * of_map_rid - Translate a requester ID through a downstream mapping. + * @np: root complex device node. + * @rid: device requester ID to map. + * @map_name: property name of the map to use. + * @map_mask_name: optional property name of the mask to use. + * @target: optional pointer to a target device node. + * @id_out: optional pointer to receive the translated ID. + * + * Given a device requester ID, look up the appropriate implementation-defined + * platform ID and/or the target device which receives transactions on that + * ID, as per the "iommu-map" and "msi-map" bindings. Either of @target or + * @id_out may be NULL if only the other is required. If @target points to + * a non-NULL device node pointer, only entries targeting that node will be + * matched; if it points to a NULL value, it will receive the device node of + * the first matching target phandle, with a reference held. + * + * Return: 0 on success or a standard error code on failure. + */ +int of_map_rid(struct device_node *np, u32 rid, + const char *map_name, const char *map_mask_name, + struct device_node **target, u32 *id_out) +{ + u32 map_mask, masked_rid; + int map_len; + const __be32 *map = NULL; + + if (!np || !map_name || (!target && !id_out)) + return -EINVAL; + + map = of_get_property(np, map_name, &map_len); + if (!map) { + if (target) + return -ENODEV; + /* Otherwise, no map implies no translation */ + *id_out = rid; + return 0; + } + + if (!map_len || map_len % (4 * sizeof(*map))) { + pr_err("%pOF: Error: Bad %s length: %d\n", np, + map_name, map_len); + return -EINVAL; + } + + /* The default is to select all bits. */ + map_mask = 0xffffffff; + + /* + * Can be overridden by "{iommu,msi}-map-mask" property. + * If of_property_read_u32() fails, the default is used. + */ + if (map_mask_name) + of_property_read_u32(np, map_mask_name, &map_mask); + + masked_rid = map_mask & rid; + for ( ; map_len > 0; map_len -= 4 * sizeof(*map), map += 4) { + struct device_node *phandle_node; + u32 rid_base = be32_to_cpup(map + 0); + u32 phandle = be32_to_cpup(map + 1); + u32 out_base = be32_to_cpup(map + 2); + u32 rid_len = be32_to_cpup(map + 3); + + if (rid_base & ~map_mask) { + pr_err("%pOF: Invalid %s translation - %s-mask (0x%x) ignores rid-base (0x%x)\n", + np, map_name, map_name, + map_mask, rid_base); + return -EFAULT; + } + + if (masked_rid < rid_base || masked_rid >= rid_base + rid_len) + continue; + + phandle_node = of_find_node_by_phandle(phandle); + if (!phandle_node) + return -ENODEV; + + if (target) { + if (*target) + of_node_put(phandle_node); + else + *target = phandle_node; + + if (*target != phandle_node) + continue; + } + + if (id_out) + *id_out = masked_rid - rid_base + out_base; + + pr_debug("%pOF: %s, using mask %08x, rid-base: %08x, out-base: %08x, length: %08x, rid: %08x -> %08x\n", + np, map_name, map_mask, rid_base, out_base, + rid_len, rid, masked_rid - rid_base + out_base); + return 0; + } + + pr_err("%pOF: Invalid %s translation - no match for rid 0x%x on %pOF\n", + np, map_name, rid, target && *target ? *target : NULL); + return -EFAULT; +} +EXPORT_SYMBOL_GPL(of_map_rid); diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 02ad93a..e1f6f39 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -588,8 +587,8 @@ static u32 __of_msi_map_rid(struct device *dev, struct device_node **np, * "msi-map" property. */ for (parent_dev = dev; parent_dev; parent_dev = parent_dev->parent) - if (!of_pci_map_rid(parent_dev->of_node, rid_in, "msi-map", - "msi-map-mask", np, &rid_out)) + if (!of_map_rid(parent_dev->of_node, rid_in, "msi-map", + "msi-map-mask", np, &rid_out)) break; return rid_out; } diff --git a/drivers/pci/of.c b/drivers/pci/of.c index d088c91..91600e0 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -357,107 +357,6 @@ int devm_of_pci_get_host_bridge_resources(struct device *dev, EXPORT_SYMBOL_GPL(devm_of_pci_get_host_bridge_resources); #endif /* CONFIG_OF_ADDRESS */ -/** - * of_pci_map_rid - Translate a requester ID through a downstream mapping. - * @np: root complex device node. - * @rid: PCI requester ID to map. - * @map_name: property name of the map to use. - * @map_mask_name: optional property name of the mask to use. - * @target: optional pointer to a target device node. - * @id_out: optional pointer to receive the translated ID. - * - * Given a PCI requester ID, look up the appropriate implementation-defined - * platform ID and/or the target device which receives transactions on that - * ID, as per the "iommu-map" and "msi-map" bindings. Either of @target or - * @id_out may be NULL if only the other is required. If @target points to - * a non-NULL device node pointer, only entries targeting that node will be - * matched; if it points to a NULL value, it will receive the device node of - * the first matching target phandle, with a reference held. - * - * Return: 0 on success or a standard error code on failure. - */ -int of_pci_map_rid(struct device_node *np, u32 rid, - const char *map_name, const char *map_mask_name, - struct device_node **target, u32 *id_out) -{ - u32 map_mask, masked_rid; - int map_len; - const __be32 *map = NULL; - - if (!np || !map_name || (!target && !id_out)) - return -EINVAL; - - map = of_get_property(np, map_name, &map_len); - if (!map) { - if (target) - return -ENODEV; - /* Otherwise, no map implies no translation */ - *id_out = rid; - return 0; - } - - if (!map_len || map_len % (4 * sizeof(*map))) { - pr_err("%pOF: Error: Bad %s length: %d\n", np, - map_name, map_len); - return -EINVAL; - } - - /* The default is to select all bits. */ - map_mask = 0xffffffff; - - /* - * Can be overridden by "{iommu,msi}-map-mask" property. - * If of_property_read_u32() fails, the default is used. - */ - if (map_mask_name) - of_property_read_u32(np, map_mask_name, &map_mask); - - masked_rid = map_mask & rid; - for ( ; map_len > 0; map_len -= 4 * sizeof(*map), map += 4) { - struct device_node *phandle_node; - u32 rid_base = be32_to_cpup(map + 0); - u32 phandle = be32_to_cpup(map + 1); - u32 out_base = be32_to_cpup(map + 2); - u32 rid_len = be32_to_cpup(map + 3); - - if (rid_base & ~map_mask) { - pr_err("%pOF: Invalid %s translation - %s-mask (0x%x) ignores rid-base (0x%x)\n", - np, map_name, map_name, - map_mask, rid_base); - return -EFAULT; - } - - if (masked_rid < rid_base || masked_rid >= rid_base + rid_len) - continue; - - phandle_node = of_find_node_by_phandle(phandle); - if (!phandle_node) - return -ENODEV; - - if (target) { - if (*target) - of_node_put(phandle_node); - else - *target = phandle_node; - - if (*target != phandle_node) - continue; - } - - if (id_out) - *id_out = masked_rid - rid_base + out_base; - - pr_debug("%pOF: %s, using mask %08x, rid-base: %08x, out-base: %08x, length: %08x, rid: %08x -> %08x\n", - np, map_name, map_mask, rid_base, out_base, - rid_len, rid, masked_rid - rid_base + out_base); - return 0; - } - - pr_err("%pOF: Invalid %s translation - no match for rid 0x%x on %pOF\n", - np, map_name, rid, target && *target ? *target : NULL); - return -EFAULT; -} - #if IS_ENABLED(CONFIG_OF_IRQ) /** * of_irq_parse_pci - Resolve the interrupt for a PCI device diff --git a/include/linux/of.h b/include/linux/of.h index 4d25e4f..f4251c3 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -545,6 +545,10 @@ const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur, extern int of_cpu_node_to_id(struct device_node *np); +int of_map_rid(struct device_node *np, u32 rid, + const char *map_name, const char *map_mask_name, + struct device_node **target, u32 *id_out); + #else /* CONFIG_OF */ static inline void of_core_init(void) @@ -931,6 +935,13 @@ static inline int of_cpu_node_to_id(struct device_node *np) return -ENODEV; } +static inline int of_map_rid(struct device_node *np, u32 rid, + const char *map_name, const char *map_mask_name, + struct device_node **target, u32 *id_out) +{ + return -EINVAL; +} + #define of_match_ptr(_ptr) NULL #define of_match_node(_matches, _node) NULL #endif /* CONFIG_OF */ diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h index e83d87f..21a89c4 100644 --- a/include/linux/of_pci.h +++ b/include/linux/of_pci.h @@ -14,9 +14,6 @@ struct device_node *of_pci_find_child_device(struct device_node *parent, unsigned int devfn); int of_pci_get_devfn(struct device_node *np); void of_pci_check_probe_only(void); -int of_pci_map_rid(struct device_node *np, u32 rid, - const char *map_name, const char *map_mask_name, - struct device_node **target, u32 *id_out); #else static inline struct device_node *of_pci_find_child_device(struct device_node *parent, unsigned int devfn) @@ -29,13 +26,6 @@ static inline int of_pci_get_devfn(struct device_node *np) return -EINVAL; } -static inline int of_pci_map_rid(struct device_node *np, u32 rid, - const char *map_name, const char *map_mask_name, - struct device_node **target, u32 *id_out) -{ - return -EINVAL; -} - static inline void of_pci_check_probe_only(void) { } #endif From patchwork Mon Sep 10 13:49:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 10594183 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6C9C14BD for ; Mon, 10 Sep 2018 13:51:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6AC128F9A for ; Mon, 10 Sep 2018 13:51:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B88A7290E4; Mon, 10 Sep 2018 13:51:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E82A28F9A for ; Mon, 10 Sep 2018 13:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728930AbeIJSo7 (ORCPT ); Mon, 10 Sep 2018 14:44:59 -0400 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:34336 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728174AbeIJSo6 (ORCPT ); Mon, 10 Sep 2018 14:44:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=82G95c9pC1Xl03/ubgEUrmP+7qVW0vR6KbsmJmk3Fdw=; b=aokmMgIl4Vx/718t1bZEd1Ilu7KHJxCWPZMgjHL6rOTnEYGakv4H8GKxA1tqk8rmefpfYCBLh4ZDSZMj7XbmYDTcwSax0AzKH0xJrAmSxzvWnPzFxzhqYzOAH6Nhk7vgeM1cTMtJxxR1Z4Zkf5VR3xGRarcSI3iCf93KqZLajH0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 13:50:18 +0000 From: Nipun Gupta To: joro@8bytes.org, robin.murphy@arm.com, will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com, hch@lst.de Cc: m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com, Nipun Gupta Subject: [PATCH 3/7 v7] iommu/of: support iommu configuration for fsl-mc devices Date: Mon, 10 Sep 2018 19:19:17 +0530 Message-Id: <1536587361-11047-4-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> References: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: PN1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::11) To DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4bc69f5-31a7-4007-2d0f-08d617245a79 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4476; X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;3:iqocZGx9q0AoV4RADre/IodDuyd750gKIZhkg/JZZvd89K1BkxxAYlKnbtS0w32pzJwFfsSZUt2HOn2sTTosmQ894M5eB/0/Mex7P/VSpRE6t2WMQksG9nRME/3PZF2JwRSI8B0s1OZuz5LY+wveOQzRM5qQWynN+AoyMm02Xh+OE87yd1xVVGXD+IDtGNuo76SNRqTI+qnalqxoTtm1rWJ/CWW8khNupylFbnZv9O4RDKbIblSmLMpH1kwRZqSh;25:U924Fw9BMxs0fSIlpPPE8h5Ziw5XTOTTdKKPPBb/SlpzLPAEhBJmwEfhwKzZWNeJAhR8YtLezfkSPILi/NzRO/DZtC+x1lew8F/Q8EMKWpSB4y9LiDuhDlzqyEcIt1TAD2sI8UVyd5z39v3JAmsBXlZ0WT++0Pk4JnpnwTjf8aEzEQ1fWjEq32uYUJw57x4FlaSIT23P1wEjnQvo4/1eLMqYoM7zryedsQXDmEb1S9FSMQO3jwbqOjuLZ+tov1uvLylYdJMMuvFs6XIF4Z4Hopymr5DCHqAf8u2KHIj8fDfrlMt2o/A8dDnGd3ZY2sjDSuvZFwDqCz+zCYPmKr2HFQ==;31:/M97ihTJoHHmUak8BAQtbxRyJtVn8uXIlbiLxZoQs2DazujfejdC788eRpSwQbXEp/nIL5n96GW22NghXESzxPLEeN7/1BBnzb5fvC96s8sLF7+ZHgTxS9DkwclI4/RrtVgV97JvlhNWZl2umGJKc4eBiAns1+m/WGwkdaur4m0ShfhnTdFu6at22RRq6B1tImNwDJXxXK+LfwAla2ZoGae5HPrP/ECnY6GC+XDEAzU= X-MS-TrafficTypeDiagnostic: DB7PR04MB4476: X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;20:vMN0AaFf3yoGpJlxJe32bq/A1YEsJ/fU+efNjdX1bRbuGH0+uUIeDeiq4jkusD0vB3quNysi2lU3mWwqoPxxPTPN0u4CUzznErmrFHZ9n+JLT6jK8NWCqxsYQXRiO4cQfLPgMjjd/h9jB1onfaaFN2wW4HjKdb3AR/8dbStfMkvg32GX0+tvJEMPwcIjPoOcnJBZoASfv8IgQa1XUeXhAG5BeKfP2g2nT5+nFXXLINYd1Fr46dj+YyjVDCJREZAib+jGISiM5GuorKCDhyaJPDKdXWhIiR1yYxUCNNhMll8YjooA9DVjPsBOjE6esZhzgIJrq7FuKZLCGCDOVv/NO9FnOvW5ivzIjrDB6Rb5vwYkUcE8gXciejGI7B8H618BaFOkKR3n6s7CHpRQaT8j/qqvMdFX6P4KCmi+UVNEh2JPwR3A34Zg326pIQZH8Nc4WogJJFONusJhtcJAjXiH846lE/HAHvlL4smWOjNqTD+NJ095mCHm38VKgTV9Kjyd;4:oCTfWetZwHtf0hyZxzP6oNXsbeenD7+jPz/zcuqn6ML0JhwQuthmRgW0wX8H4psOWBEcHse6gcAL0FTqYFNpb+aPkIO5yXAdJXP0xq8CB9yLbiu127FMw6eRFym94Q5thg67pKZwq7b3tBkgVeM3NkxsOjo9psPIQl6v7R/6SkiyVs185NWENSJOq6TglLFJISTUcb0Sga5oM9QROtYWHDB4FdXv08Bd7FbByvRvok4tn+XqblrBzUY7eqMmekFW3Vke++lGsXF02nfGcf6SPanBPadQFupe716DIH0PHikzwBmP0I2y+yAkxi9e7hn7EvTOlPnRZyiNaxyySEr0S63vaPZDWQXr9Vm3tnADmhY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DB7PR04MB4476;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4476; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(39860400002)(346002)(376002)(199004)(189003)(48376002)(81166006)(8936002)(81156014)(105586002)(106356001)(44832011)(53936002)(47776003)(50466002)(7416002)(316002)(956004)(16586007)(6512007)(2616005)(476003)(26005)(186003)(66066001)(486006)(11346002)(25786009)(6506007)(386003)(50226002)(446003)(2906002)(16526019)(86362001)(55236004)(6116002)(3846002)(97736004)(4326008)(68736007)(7736002)(5009440100003)(305945005)(6486002)(8676002)(478600001)(52116002)(51416003)(5660300001)(76176011)(39060400002)(36756003)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4476;H:b27504-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;23:yKIC1p+8Uy7GU9Ac7/Yuq8LrIfvpeEvj9fnFGjTyGbi37TKVFupsTlw0vg8OAIMEDu1TlyeQrseYTjR8dtpyH9b+vUQAeovkckeFEnl1w2O6AJd/FXXHPm5feliztaFZQjQj6CY+hLsaDoyqru6lk41YXYES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VErxjbMUauItifB3aIFrjUcnquiayJRoevUg2TmxYdQKRiFz4JI9vNO3XThbWvIeS7/QIcy46T7YIEOWH0A=;7:uui2ykKlOvBJEULwXZwolJeRwWR0oxtdS4298eCs5Zy9Hz/tQgLJjOcp27xP3nqgrzrVvlouZZKuvbMgmNP0jhonUFtWcnyVCcZWT04Gm+wsEGDOHXL3kN+2edeqHlrN3BRFKMq6cHEgrXJiJi91pR+NK9CBU4FvUCiw9zsmIcChd4dF9rr4bVNhBp/2u/HriCukV5dv74u8aznkR+2jBZ2U45oAfZGCYPe7cgnnrzhyMt1zLWX2eqpiMUR1OPua SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:50:18.1826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4bc69f5-31a7-4007-2d0f-08d617245a79 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4476 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With of_pci_map_rid available for all the busses, use the function for configuration of devices on fsl-mc bus Signed-off-by: Nipun Gupta Reviewed-by: Robin Murphy --- drivers/iommu/of_iommu.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 811e160..284474d 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -24,6 +24,7 @@ #include #include #include +#include #define NO_IOMMU 1 @@ -159,6 +160,23 @@ static int of_pci_iommu_init(struct pci_dev *pdev, u16 alias, void *data) return err; } +static int of_fsl_mc_iommu_init(struct fsl_mc_device *mc_dev, + struct device_node *master_np) +{ + struct of_phandle_args iommu_spec = { .args_count = 1 }; + int err; + + err = of_map_rid(master_np, mc_dev->icid, "iommu-map", + "iommu-map-mask", &iommu_spec.np, + iommu_spec.args); + if (err) + return err == -ENODEV ? NO_IOMMU : err; + + err = of_iommu_xlate(&mc_dev->dev, &iommu_spec); + of_node_put(iommu_spec.np); + return err; +} + const struct iommu_ops *of_iommu_configure(struct device *dev, struct device_node *master_np) { @@ -190,6 +208,8 @@ const struct iommu_ops *of_iommu_configure(struct device *dev, err = pci_for_each_dma_alias(to_pci_dev(dev), of_pci_iommu_init, &info); + } else if (dev_is_fsl_mc(dev)) { + err = of_fsl_mc_iommu_init(to_fsl_mc_device(dev), master_np); } else { struct of_phandle_args iommu_spec; int idx = 0; From patchwork Mon Sep 10 13:49:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 10594181 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1986A109C for ; Mon, 10 Sep 2018 13:51:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B9B5290E0 for ; Mon, 10 Sep 2018 13:51:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F33F4290E4; Mon, 10 Sep 2018 13:51:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60788290E0 for ; Mon, 10 Sep 2018 13:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728522AbeIJSpC (ORCPT ); Mon, 10 Sep 2018 14:45:02 -0400 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:34336 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728635AbeIJSpB (ORCPT ); Mon, 10 Sep 2018 14:45:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uEgAqhZqTeLuJSDtixR/HVfgPxOwCcqmERq0rRRqhu8=; b=T59KSJNcqQrFfEszndMqvRVs1uRSR6QOrEmdHqpha+SQzXnl0u6xvz2v5he4GLYayLMiISz2CV0BfA3yCS0Ah5jSiIMbviXLvbi7l1acFuTlbVH7C+wk1S6COaC8XnybyH+qf4r5AsElmmlD1mQG5tSgpw7PfGt5btu25GwN/co= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 13:50:23 +0000 From: Nipun Gupta To: joro@8bytes.org, robin.murphy@arm.com, will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com, hch@lst.de Cc: m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com, Nipun Gupta Subject: [PATCH 4/7 v7] iommu/arm-smmu: Add support for the fsl-mc bus Date: Mon, 10 Sep 2018 19:19:18 +0530 Message-Id: <1536587361-11047-5-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> References: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: PN1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::11) To DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5fdcd16d-b1a7-40eb-8559-08d617245db0 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4476; X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;3:r2jhMMH6YsAdjG3ye7MrlqyunHLA7DVbQ8ZkRTMrmlkMZHG58vOuMdD20EmBBLJmRIOElcpFOirgnQOtzOYKCVoPvKcem0mtuR+Yiv6c+6i0oX7xj4Zpev21Qy6afchlX6tCjLb2fJqsLuUmem65XSQXgbx1BVq7Xq2eve0VtTCNR4F5DTmcV5HV2KHVf7baY+XMpR+Ws3fsOvpRcJC1XV+FrIe+g2u/S9qpNhaWxEE23/7ZtHnZJu/JrQNmS3aL;25:wa5NR8zuuCTQPIiLvYBGIvZjVOD0RF2JqqkyBKfz6ZKPBlVK7psRBex+7oS4olEBZK2EXY73nNh6Cscr5AgxIY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Sy41UK0trMN4ydKvP1Yi8TIRFCEBm0AGHxb3ixNDMQSLqZJ0Oc35gOxZxd87Ih/7DedZB+uYfRwalCVXsKCY1txf/CTgUJEuCmi0/rrqbm5I3ifs7eQ9jwKSK0gSyIZDGBF1NZFYy+Py85PO/BFEz5XI5mXX2f4q58Ili8ZRL9ZCHkqFi9KMaInBv+EXgvZouWGd/GhzgyF7wdOwQQtpo0c4u9/Baf2nKmNhEN+ARGiOINylyyn5SfclHtiTY4zGwVKbcf5QPV9MjDsl+AvuF5kHBHDi9OLfD3GKhYM7Q0zabx/bET4474NcuHQZkBnAokMflaS8ZddMmbSU7M+mkVN+kdEXmAvKA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DB7PR04MB4476;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4476; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(39860400002)(346002)(376002)(199004)(189003)(48376002)(81166006)(8936002)(81156014)(105586002)(106356001)(44832011)(53936002)(47776003)(50466002)(7416002)(316002)(956004)(16586007)(6512007)(2616005)(575784001)(476003)(26005)(186003)(66066001)(486006)(11346002)(25786009)(6506007)(386003)(50226002)(446003)(2906002)(16526019)(86362001)(55236004)(6116002)(3846002)(97736004)(4326008)(68736007)(7736002)(5009440100003)(305945005)(6486002)(8676002)(478600001)(52116002)(51416003)(5660300001)(76176011)(39060400002)(6666003)(36756003)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4476;H:b27504-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;23:UqXiShuUzrMRGLGGA9gonXGoImkrqoVrywmTbMcEZmM20EMIzkMp2zPSUGtPShBZcHadcVFh4p4+5YLWEzKxGsVzKkpFtlNxAqehbn+da6QhZJ5iIyVehqH/xPOFCgPO+qwomkqIHbGVuhWBoaarCCp3vvZuhcnq/Ctk+SJsMwC6Bu2C4X7/jfG54rvXWXLzmTEpnHcvzUTqIfme5wS/pD67m95QQ5x/oTog/kfGlb/gnYGqrkDq0c0aDAnwgNPAN1daEfycZ+KLRbD7yT8qWdF2ee6glj2ttpTSLvvu5CuMVY5TrBzagcMrdiwQPjTu3ZQp4RIZUo/v0dAb0EGal/DMnq2Nn643JlDHoTnwjefXX3j15lu7XkHvS2Xww8PbpwtTZlyMn/XM/net3IRMd4qUeVaNyYAJHaSRFMfruw4sjj8zI0zYheN9k1toYRApQ3pJ6FC9sMUfIUe+uiPXnutFRxu2+yubG0ho6XngluYZBJvUqlgHkdZ98w0PpSO0gj4TI7gPYfg0NaOv88y/4Ln0fUdN5Sip2SpigkVphuaYz3JcUs+/2aIaHklQHAYuKkW2uFtwodZ0KLWtht1E7JZpn//yJ/2AQLKdm/WJgSqw8KZlKmYsh3J2vWeczjvdsJnBR9k3PqfwfsHssBHpbsVdfL3N4lrwDdPJg4BMm/c6CmyqxqA9lxsTC9zFtzUuPeAP4CoTvh8Shc3PAR1hFrSPUQQZr05jFhtRUUKgZKLiFl7jZ5imMQef9yxDJUbU8Vmux+84b6z0lRjPVLbbD1YEY0smAgr9SojysM8KrNpnuFnXFs2Ip6E85DpUv4VYNASBcLN5sPiGuhvdQt8LOc/efxxYGoObt7PAkI9yNvxW3ujFXtJY6K7aXsENW9iFdivod944wzsSFx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xGEGwoWHAF4uSI0hksau5JHVRChLmY/p9HtjEufxbno/PIjBSk0YCLrE2wLsRpez2bwYTs9ONfIxPQ0WmXLMUFMqvhTTks9CAb631OSHsrS1v3CvRReQCfm/tUbc6doFrFNc4ZrHoQfROk7iPzEcL4/fP/2frI7PN7vhEWRP9lMa2Ihy7VOfjWUKapOJGN+Dnkv1eZV/I1+byPkae6K50nUWKWJSV2wLf657foTXBr0qCtH4naGE8n1z8dop4/y2Zt2/K+p55/v4DTxAl4w==;5:fGS5fc4LlLcMc7Erk0Wu1RPF2AB0KjtKdGiFDKyJ/GLN6l+Xkf70kqzL5ad59rWIO8c2gRBeNiGVuBbQpG+rSWQFhtPgJm3UsrMkNFlAbLtPUiA3UgE+OQIncVYGqDlfN8IJvxfegO2wNSd36KqW8Kk2Hu0/v25zara2IHQ06k0=;7:q6Vpz2C6L92j0r95E+Esm8UxWR0FWkq6tvo6IjXHwGs86/AQHvuH3k/uXpbkmsMQ/w9vFrj9WNmNXPfPP47OEGOwQXqHkDDSmorG2o27bYSmOV10KT8MyODxzQWEWR7CakmmQ+NBs4vUlcQi18Zt2cyzxC1KMOptyVxKGtojle2Fvld5/GAYnwfG3sMPnNfU2PWgdeAq0yeiEhLCNiUqSW085v3KGhoSWiGqO2JH9zW3dkT2x9hArNXkNA4HMTtd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:50:23.5624 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fdcd16d-b1a7-40eb-8559-08d617245db0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4476 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Implement bus specific support for the fsl-mc bus including registering arm_smmu_ops and bus specific device add operations. Signed-off-by: Nipun Gupta Reviewed-by: Robin Murphy --- drivers/iommu/arm-smmu.c | 7 +++++++ drivers/iommu/iommu.c | 13 +++++++++++++ include/linux/fsl/mc.h | 8 ++++++++ include/linux/iommu.h | 2 ++ 4 files changed, 30 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index f7a96bc..a011bb6 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -52,6 +52,7 @@ #include #include +#include #include "io-pgtable.h" #include "arm-smmu-regs.h" @@ -1459,6 +1460,8 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev) if (dev_is_pci(dev)) group = pci_device_group(dev); + else if (dev_is_fsl_mc(dev)) + group = fsl_mc_device_group(dev); else group = generic_device_group(dev); @@ -2037,6 +2040,10 @@ static void arm_smmu_bus_init(void) bus_set_iommu(&pci_bus_type, &arm_smmu_ops); } #endif +#ifdef CONFIG_FSL_MC_BUS + if (!iommu_present(&fsl_mc_bus_type)) + bus_set_iommu(&fsl_mc_bus_type, &arm_smmu_ops); +#endif } static int arm_smmu_device_probe(struct platform_device *pdev) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index d227b86..df2f49e 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -32,6 +32,7 @@ #include #include #include +#include #include static struct kset *iommu_group_kset; @@ -988,6 +989,18 @@ struct iommu_group *pci_device_group(struct device *dev) return iommu_group_alloc(); } +/* Get the IOMMU group for device on fsl-mc bus */ +struct iommu_group *fsl_mc_device_group(struct device *dev) +{ + struct device *cont_dev = fsl_mc_cont_dev(dev); + struct iommu_group *group; + + group = iommu_group_get(cont_dev); + if (!group) + group = iommu_group_alloc(); + return group; +} + /** * iommu_group_get_for_dev - Find or create the IOMMU group for a device * @dev: target device diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h index f27cb14..dddaca1 100644 --- a/include/linux/fsl/mc.h +++ b/include/linux/fsl/mc.h @@ -351,6 +351,14 @@ struct fsl_mc_io { #define dev_is_fsl_mc(_dev) (0) #endif +/* Macro to check if a device is a container device */ +#define fsl_mc_is_cont_dev(_dev) (to_fsl_mc_device(_dev)->flags & \ + FSL_MC_IS_DPRC) + +/* Macro to get the container device of a MC device */ +#define fsl_mc_cont_dev(_dev) (fsl_mc_is_cont_dev(_dev) ? \ + (_dev) : (_dev)->parent) + /* * module_fsl_mc_driver() - Helper macro for drivers that don't do * anything special in module init/exit. This eliminates a lot of diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 7447b0b..209891d 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -389,6 +389,8 @@ static inline size_t iommu_map_sg(struct iommu_domain *domain, extern struct iommu_group *pci_device_group(struct device *dev); /* Generic device grouping function */ extern struct iommu_group *generic_device_group(struct device *dev); +/* FSL-MC device grouping function */ +struct iommu_group *fsl_mc_device_group(struct device *dev); /** * struct iommu_fwspec - per-device IOMMU instance data From patchwork Mon Sep 10 13:49:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 10594179 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC09D109C for ; Mon, 10 Sep 2018 13:51:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCA9428F68 for ; Mon, 10 Sep 2018 13:51:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFF7D290E0; Mon, 10 Sep 2018 13:51:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 41BA328F68 for ; Mon, 10 Sep 2018 13:51:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728957AbeIJSpE (ORCPT ); Mon, 10 Sep 2018 14:45:04 -0400 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:34336 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728174AbeIJSpD (ORCPT ); Mon, 10 Sep 2018 14:45:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=raZc3+yJvpdhlPARR9k2QZGxd73wTqQLphSnoHPT7Yc=; b=VX7nKoatjTQuQx/2lmA9wcvhiF8L/OsRn0Tg8YQwJuRfP7vxNw2YA8AIKozPm5wk1A5d2VO/j8/w3pNwN/cRvqDtAxtxX9Lz8N2bu8RmtM8O6XX/kCEnP0BURR40Me9X2IMJe4DWUk4jcJ5XHxHCGDhFEDuBKIAa3Ae/VA/itHo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 13:50:29 +0000 From: Nipun Gupta To: joro@8bytes.org, robin.murphy@arm.com, will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com, hch@lst.de Cc: m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com, Nipun Gupta Subject: [PATCH 5/7 v7] bus/fsl-mc: support dma configure for devices on fsl-mc bus Date: Mon, 10 Sep 2018 19:19:19 +0530 Message-Id: <1536587361-11047-6-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> References: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: PN1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::11) To DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3602b0da-019d-40ff-1b1f-08d6172460fb X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4476; X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;3:G8dGOlh43ZBxSBpLNx35z4DNZhmihC0aDZXrYzDK11KKNvnUUelySlNu3y5HDeSyNnsGQe3oP9dnqMiJ2ybfM5RuZ+8feyhUDlwYZyhZ7Bua6yP1sG+0fKDLTRrNLNW7RCzACn4pTEYzmdK5I7jH9R42hLmDLms10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BfuX5iV76pIrQ8PVJaLuIkb1jIR8L+5anvLkQnuaGf42/YqlSruvU97Ofu67eSBXmS85ZuBkQQCnwB3wsWJAe0C2WJhyouJ1lV87h2MB5YPN7gRnpf6TvP7NY1C+abd0JPvCkbYbC2rGJ7Vijj3thPaR09o+GVTtHdB+pAJU66w5qxsC5;4:ZJus+ZPhpCOHp8YHfskifRRIhEIASPS0qXmgS5Vx2zzifRkeem6DzHyk3I1vTpF5bc4hdtDqTKVlrfK7hnkedyCkaDMICNRMjkkHY6tsZFx8US+ulgV/xV1rUIVf89nuc6ul+dCvq5nmoHWzk9it6lAbpR1MESms4CYe7YTQvgK5Wa8YQDrm3oZUcGa9u55sRpoOeGou3nbG3nkVEHbh65qeq6RT3POvSYy32efu3D5x4UoaXm+yL8IZu6XFRWsfi01+zVT4dlotQUWj9zkPnFslu4UFEIJ1stt07Mgvec71vGM7oDP3HSgKvDViEzB+v+UE5Wxhp/iNoomGo8xqk0IGOmY3sCVOISpNC2cWMrQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DB7PR04MB4476;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4476; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(39860400002)(346002)(376002)(199004)(189003)(48376002)(81166006)(8936002)(81156014)(105586002)(106356001)(44832011)(53936002)(47776003)(50466002)(7416002)(316002)(956004)(16586007)(6512007)(2616005)(476003)(26005)(186003)(66066001)(486006)(11346002)(25786009)(6506007)(386003)(50226002)(446003)(2906002)(16526019)(86362001)(55236004)(6116002)(3846002)(97736004)(4326008)(68736007)(7736002)(5009440100003)(305945005)(6486002)(8676002)(478600001)(52116002)(51416003)(5660300001)(76176011)(39060400002)(6666003)(36756003)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4476;H:b27504-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;23:1l84GhW9X0esR+Fsykb/vVwhR78V1/Z6zAFIL6miu4lRN5FehJd6SaK0v9mJiryk2XBW3agoOYvixWIosx2Dcgk23/BLKVzrGU9HK7tC9baTPUasAjtY6BeW1dmOvEgrlzCyGEKhFPFGhgWjZRgEtgadhpCK67SuE4mm7iBkB4a7UrRnXcXTOAkfNHMj0TVawpOs+eU0BHw+oulgHeXkqv5zMGlyLS2y5Qsj3JL8MzkEUD1VNpcXEkNdzZVqh7YqKRnfy9317O6wCEG+vFDXp5PT4qMuXEKOW+J4uSB4Oy9OkZIBijtIPU2/rf5LTZnXjB//1S15empJbx9szFROpGKMovQ5Lnqb5Y5N1F4ax1oArllkL43YvBLtSjUXj9FrgqT4KoTWITZrpyyWKOW2oVgWylpaOP9mzxpegqBcG4rpweWDsVVbbPljZ0ua3xPPpZPwtIMnvmM5/PLzvxHki8RnZrGLs4C/2emylpX5ZpAuGCH6lVnYiFYR/FxVup0MJogfClx7DXB1T/MkBgWSf65IEJUv9ptAmM7+nI7FUC0CIPBeqZ+DpoFpOrOajdr/NucgB1TQuV++Uz9ypEWA6m2G4LgV5aOT33aYTai8aRgrlyJIns3ZC4ONNk4uqOtYQkCQAA/rQpuvjTi7I/DhTsIDCMVNzYKtGyUKKNW80xfaI5beuvZyHbZ+zID8isUGaBGIWP2WIsaBeHaMQRS8jlU1wTcbk3kaZep0d6aNhmPNt6oOF1zq4lkM8DUnferOnkJZnA+RHxypkMcIA4hpyO1ypH/mFaEsNL+blruzbLtirEIlWz8wiGKhUQfLEnadQs3becVe4rCIaIJj8TqnEvLRPNGcxNQ2P1wmOUVrBGQKClR1gAQdbbqiJioN4cQxM5TEloNPyjT6ryCfVXmbHd71Ujhx/6sHO99NLrejQHL3FgsYCY+ydnaxaQogyo9sAlh5BRE1lXlquTOWBofYfRz/PdROnHrFf6m+u+2BOpKib+io+H4Z+XQJ1K0AdPlh8lmIP/LujIFraCCudEZyk5IhR5pxWOmr/QBZQBdtf8Ivb8crreZELZYNvfaS3j0tWyd/GOH3pJAfwcwhafTm/+3bRip10VyAbo2M/XNk7rUNkdEYfgFecd2nsRFY7SxqzE3POQVNvU9Q0X60SqyfjijwIyV9+b54hFtZXAii2GlGeftkrLBhJgbXhEx2wfqTwrETGKvRnejlroFJIBRKWI2ZWjAhSRHr/W4rvhPrZPApLyGtRLoga4pe/a3daIf6yhzVyBacWge7xKF9utPomTUpg7df0IIQJIo8MqAw1bpkj/phNSK4QZAcEIPylYRo X-Microsoft-Antispam-Message-Info: +NnCThQswcuODoY/+RbjqBvPAZqvxtJ0SObWmIXaccRpmT2uVKIncV3sF9vcJzyt1qgUO0poYIb4JwsO7/y14DJkhlkd3+6JQGif08t+OOjD7S1vVrOfMQmWFwKyn+gsjjBZPbqIvwS17Akp7EajjCPjT+cxdGyeUeX2f4QoIwI9KZAYAkMEgzkFDRsf89yPvTfLxLdYAyH68Ex5xx3vE2GgAO6NZO/o+6mgx6o11NOl3HdIOL5jaRzAuBYh/uLwesu328IRULvx0c1dTzKGaEdIvIBta+m2HvruSubf/+LVzn+nupdVpGTcwwqZYFFXj8fHl8+gEvSjtbyO/Dka8ZV93hvh0RDNjqr1oSRKV64= X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;6:oOaxRJZg/BVBDE5JFKvlFi633ffUDSDwEgX/kgTWrvETdk9V7bQBkuL5GtbTXQR9Djuwk3XgmZJfg9Gwz4Nh8X7MYvavtt1SGiVWWmU5+SrLeDQy2AJAqLOrLZMtbYboo733XoI/woDXTVTq9LuKpNJtdwu1HxdiF4ePxmOxStcgfDjyJX0WYDpYoUI9yaLaKTEfuPgl0s4/hOpSzO5DbWhlJ2l0kXeE2Q/ooyVX0tvMtcBtOeeuQA23X+h8m9DGWZHHeSgTXINYs27HLFOxM6zxzVigAPma5V1wnnZoMA13b35LoPXm2I7sCgZiiA7VLnHwJTHoFB3lwux2s1Ak/v6gQ8keuELY1CZ14q4zDmPT8UVVVcgWc+s7wK2pWaExiXENHsKoS947iBqm2yYQ1OhkPmOSHhbt0cXDfLMcaltr59F+kkWki8NMt5EYfXxInfrqxX6fInaDc2mwOFOHPA==;5:wI85OA/oPDWbu5UZG95vTIcwgpWUehwvLvKOxLpmTrxe0bJ2R6WUucJQZii32H21ztbofUfU0hD94SjHn40d7TBipYh26JoPh1pWJB5TJrpy11R9gF+B8O2WpcmvyblIvCKrr0a3PpKvpbYmQyLlasA03HsSSghTYJL01O4ZeDs=;7:U6XLGxRv763uAZpRZVs50pdf7HwdJk+poaiTSUUXUgGWVy6fTeg6kUgunIy4BPIXFlNdTHIdXk6XGJ2RBjfmVX3TzBuhuM45kiWMJXGzu1/ytLjwOfoE9HPYw2jnEphH3i9QtrRs3HCZKE56T2erwyJNgfWIGUw2wMIRic3fYctPcdshRNN5O+2Vk+XXKZ1S1rtG2+yzjVO9s1wVapfo1K8xBCR1/WinkFY7NsOIZUBpyoyUw7V+TG3yoj1oXJLS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:50:29.0944 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3602b0da-019d-40ff-1b1f-08d6172460fb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4476 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support of dma configuration for devices on fsl-mc bus using 'dma_configure' callback for busses. Also, directly calling arch_setup_dma_ops is removed from the fsl-mc bus. Signed-off-by: Nipun Gupta Reviewed-by: Laurentiu Tudor Reviewed-by: Robin Murphy --- drivers/bus/fsl-mc/fsl-mc-bus.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 5d8266c..fa43c7d 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -127,6 +127,16 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) return 0; } +static int fsl_mc_dma_configure(struct device *dev) +{ + struct device *dma_dev = dev; + + while (dev_is_fsl_mc(dma_dev)) + dma_dev = dma_dev->parent; + + return of_dma_configure(dev, dma_dev->of_node, 0); +} + static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -148,6 +158,7 @@ struct bus_type fsl_mc_bus_type = { .name = "fsl-mc", .match = fsl_mc_bus_match, .uevent = fsl_mc_bus_uevent, + .dma_configure = fsl_mc_dma_configure, .dev_groups = fsl_mc_dev_groups, }; EXPORT_SYMBOL_GPL(fsl_mc_bus_type); @@ -633,10 +644,6 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, goto error_cleanup_dev; } - /* Objects are coherent, unless 'no shareability' flag set. */ - if (!(obj_desc->flags & FSL_MC_OBJ_FLAG_NO_MEM_SHAREABILITY)) - arch_setup_dma_ops(&mc_dev->dev, 0, 0, NULL, true); - /* * The device-specific probe callback will get invoked by device_add() */ From patchwork Mon Sep 10 13:49:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 10594175 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E960F14BD for ; Mon, 10 Sep 2018 13:51:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9146290E1 for ; Mon, 10 Sep 2018 13:51:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA673290E4; Mon, 10 Sep 2018 13:51:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66631290DE for ; Mon, 10 Sep 2018 13:51:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728973AbeIJSpG (ORCPT ); Mon, 10 Sep 2018 14:45:06 -0400 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:34336 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728635AbeIJSpG (ORCPT ); Mon, 10 Sep 2018 14:45:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h3LUbKn+NfpULplUoriITqfUZ0k7NzbW9xgQogrfMms=; b=GOmpYLrfs4nKBREeceoYt7nf1FiWiioRSe6CXLrLOiSOtGOY1qbFaBN3EtN+bIzl8Z+mslMFoBkIDHTzlYEqmDcLneE6yMU8FBK8NH/GdOvA8IYaqdRDiw+3fw0ufKL2tNiY4k1KCD1mkxnT42LE+/8AJUPmXnpUUWCDSveqodU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 13:50:34 +0000 From: Nipun Gupta To: joro@8bytes.org, robin.murphy@arm.com, will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com, hch@lst.de Cc: m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com, Nipun Gupta Subject: [PATCH 6/7 v7] bus/fsl-mc: set coherent dma mask for devices on fsl-mc bus Date: Mon, 10 Sep 2018 19:19:20 +0530 Message-Id: <1536587361-11047-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> References: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: PN1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::11) To DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fcf6cb7-351b-4311-5ba4-08d61724642a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4476; X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;3:d81IZH4A7x9ZZRAgyBBjvBH+a9cdkMx37SzZNM/9xIqHMtONpTiABrLr2/uWnIKo2VO432VeRLXToZDPhKwS4AdvptCeFYk57giIWsEJ3qUWVctlJTqXFjpdVHcYufkKOTiovD9tgwnmId4hFJhvmHxpbb4e7VeV0rq7GSoiFIekoAZLTYll3e3S3DUNccIrCBLdKQmRYoyvF98kEAPkU9WTvmH6Ajco/CNwF4G+X9+o11G2J4U2bjP0EMLhm8xd;25:pfAm23bWDocHRKKoe3RzIkQi1XAhWeQ9G2n3T1UBaIlNJPgcr069oIFUTp2/wqG4Fp4tv3h/8Ku+MxXQxFBx6vEUZmZmZsTdN2gmZFzm6dt+2h18Zp+qif4nRSX6C2KWgZPsy00ZpJXIo6zUtOqSji/rQmpMnKMn/yMgpzH++WAjbEbnD2MHeILChmaN6BLPiMugSsBB+n0r2qUEphKvvmkZtdAIxDdsR+DeA93sooq8oHfiE2+IGps/bm3OgjKsoYRg4C8VkJtJNcJU+OmYpbL4MreO/c0MygWmFlw3+Bs+1r4hxLhc6Aa7c1HypjvhK/nm5Uwbo+9T/jrWcvXW4Q==;31:kQZZiSNazTt6hsrac/lhAtf3BM9m+achI2//Y4dHuR6FgKRMqHDmgOBxzc9jFIzyeYwtKnGfmNIQ5l/Rwu7Mhhneax6UikGWlGhUJJdG9K7nUgUrZIWoJfKfYh4ZJEW8/SmwpX9mdlfnBkGBop/8mcyXYLOwzMoi7UO6/rEgReJA/nr10BfGlbQBk5DC5gpIHLYvlw2JQdYXC8CmmsvXVqBxYDVatfhasCq8BV9vPXM= X-MS-TrafficTypeDiagnostic: DB7PR04MB4476: X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;20:AXaoYUEDppxwxy1PJt3JUKySQrRq8RLH/ViMOm7MBGa0moIskVEmeiHdFML+Ns/ewmnQQPTywJpaqoYiiPZqP2UGmTv2qLjGaLE/u17fdyuTns0JnbRWCekmWyCx+K4XXKSgLIc+JrBavkHDnUJyvACJVTv0h0p8c89tSeDxsS/dN373F7lniEAaPs4GCfG255iF3HzgZB5ns6y+aj8X1b1auB1E8xzVRXWOSVlyyIDSJbNAeGyp/lsnBAgQG+4mBcX81nqC/gXeQNHyNP1oC4PGoPxs1OhlzeBmWUEi/aMnCYzRwHKUBlbuR7TP6PjogIWow5dnHaGzwWkIUq2+RQ1DIJc6RdAHRs/j3XyCCgOmNH8EbE1q/bQ1lL0z/nfZMo2misF7wqvzHiYHHYJhiSRE4wiuQIdg8YxkEAqoEQ4pI58vLUXjrOIG2uNQTWn5oKxdsSmaiCIFn/qZgQ0TlmcM5nQ23PFqTtj7Ck9IJB1GuZnl3+rshl6IGSmoNErh;4:je73s0lI+9K/1V1YvApYhaoT8ozdwh4oqARpA3CEQ3iE0icO0g5gAvbMw0Atr6a5jwOAr2h7Pxm0gkImpRGK26NnL0T/dMesJwHiXMiWywvMbnqIBOUbPcjMeYGTcaqna56EMSyIZKm0/bQ7D83jV+wmYD9PsPTzR5ZlF04z7+iUMOu5LDd6USIoNnL2oOfhdF1FCjG0HUl+XI495iqrg2ujjKXCdRvMWkAGSWORVSdJSd+dZZE2W8NX+R6uAdNQUEQfVveuDuiSYd8UtWcYtbGpswV8nzg3yTeWz8EuIvQnbY5aD7BZFw/vOz8CbNcntGEuqqY3PYrh9OLVTmvAkf8U8zFDrcT6gIzjUO/Min4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DB7PR04MB4476;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4476; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(39860400002)(346002)(376002)(199004)(189003)(48376002)(81166006)(8936002)(81156014)(105586002)(106356001)(44832011)(53936002)(47776003)(50466002)(7416002)(316002)(956004)(16586007)(6512007)(2616005)(476003)(26005)(186003)(66066001)(486006)(11346002)(25786009)(6506007)(386003)(50226002)(446003)(2906002)(16526019)(86362001)(55236004)(6116002)(3846002)(97736004)(4326008)(68736007)(7736002)(5009440100003)(305945005)(6486002)(8676002)(478600001)(52116002)(51416003)(5660300001)(76176011)(39060400002)(6666003)(36756003)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4476;H:b27504-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;23:S4+7EpQcb/WmrS+ejibPdeZQ5bfXi6OKqulM+QrN0gynfoCvEHpDbn7cMtlnWbScU1nqsCy7HCzht8BmVw7i4lwD/h5qw54PTmjaCjqvNFmCw1uxZ2HXO7Xbu6JYMvmuEbBWdzRhhH9n/z0vEKRIBF14VMNPVv/vMgIuRHn1ZPGctD5vSb6bCeWuEiCJJP+pAbC7ZUnvYuukttWB8LS0iIOQVZUqASzhy6j98sHfV4brZhSuX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/lhSvdRBEHvL3R9ZcOOI4Owo=;7:gWw2d276lOVMOeJ63IZKFUUgZZChsGTpbPr8nqLlGv4q9zfdYbpitMxIOQLrs2wThv3kCELbsdXe0yvIYQklqlliRyCiFBC8lw1aekowKQrBWIzdmz83/F/hpl28zqw9uLFDPEl3nypXGJVDQRBRKpy652K1LJiNdl409sPBP8SY0OXVlPsr3C7R01X0nsA8aSRbrRctNN+dUgUOc3fTqrav497q4WTE9ljvaN0YyjE0efScykZzwbQXqlpTUT0u SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:50:34.4382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fcf6cb7-351b-4311-5ba4-08d61724642a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4476 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP of_dma_configure() API expects coherent_dma_mask to be correctly set in the devices. This patch does the needful. Signed-off-by: Nipun Gupta Reviewed-by: Robin Murphy --- drivers/bus/fsl-mc/fsl-mc-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index fa43c7d..624828b 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -627,6 +627,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, mc_dev->icid = parent_mc_dev->icid; mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK; mc_dev->dev.dma_mask = &mc_dev->dma_mask; + mc_dev->dev.coherent_dma_mask = mc_dev->dma_mask; dev_set_msi_domain(&mc_dev->dev, dev_get_msi_domain(&parent_mc_dev->dev)); } From patchwork Mon Sep 10 13:49:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nipun Gupta X-Patchwork-Id: 10594171 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D57E714BD for ; Mon, 10 Sep 2018 13:51:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5F6228F68 for ; Mon, 10 Sep 2018 13:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B82B0290E1; Mon, 10 Sep 2018 13:51:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CF6C28F68 for ; Mon, 10 Sep 2018 13:51:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728635AbeIJSpL (ORCPT ); Mon, 10 Sep 2018 14:45:11 -0400 Received: from mail-db5eur01on0061.outbound.protection.outlook.com ([104.47.2.61]:34336 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728174AbeIJSpI (ORCPT ); Mon, 10 Sep 2018 14:45:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mSF6WsMiQFz9osmzQtZq5/GO4k6ZQuqdRQNL+BJQVlw=; b=sDcZtl70nflqmyFNRD2DJyT8HWxXTz+Vnm/tFBb2iNNAjvujMueoqCXD+L5ephwvi/0DPGnz2ERhyIw3qPZF6TU4wOOtefxRdDLNPaG074dJqQ+tx9gLiDX8vM5zUy2OKi5VtcYtjGaZ4i6Y2w5ncY1cC5/aff8LGBtF3JSDW5o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.143.30.134) by DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Mon, 10 Sep 2018 13:50:39 +0000 From: Nipun Gupta To: joro@8bytes.org, robin.murphy@arm.com, will.deacon@arm.com, robh+dt@kernel.org, robh@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, gregkh@linuxfoundation.org, laurentiu.tudor@nxp.com, bhelgaas@google.com, hch@lst.de Cc: m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, stuyoder@gmail.com, leoyang.li@nxp.com, Nipun Gupta Subject: [PATCH 7/7 v7] arm64: dts: ls208xa: comply with the iommu map binding for fsl_mc Date: Mon, 10 Sep 2018 19:19:21 +0530 Message-Id: <1536587361-11047-8-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> References: <1536587361-11047-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.143.30.134] X-ClientProxiedBy: PN1PR0101CA0049.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::11) To DB7PR04MB4476.eurprd04.prod.outlook.com (2603:10a6:5:35::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0114417e-8365-41e2-d5c1-08d61724676e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB7PR04MB4476; X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;3:pH9A2RWzRGbRyjU3ErcRKKcgjHfoZBn5qVnCN9bFtd0eSNN5qcqF5GOpfp1UnR6RPMMNf9fXFuH5lSYj2eMqZD63uGDEXXgWyPFA/yv0X4cdMTqXMquRgELhqlpZ3Qpt1Eg6+SK/cv+IzfP+Ok0G6bnVSwvYRazrpexb4VDyA7mZxgkiwODqu+6/XauVvc4jBsQHE+jy4AmYmZLhNcQ/B1oE/9NzXP/cjz6Kgf3Al2itWjncAG0ZlHHrN0CPnldR;25:hArr+09ayBXV2JVxbRkZlos2IqN7+E+il26NbwJBuemPecGDAFM/WpnM5gdYg6GF1bvhJpvQ4LFC+VrL12ehAWDl2FE8QAgHhIttY9eadhdA75sc4pywWu4PmJi1vARXbJdaag8jD0oK8HWIEr66cXXu65qSu1kkY/Gpy5O4/kaJDrQ0tnIsqeLEW/85anCELsIGmgNGV38/RY66V5UM0SKfTUYv2pGQw7Q5HWusgtbfMTSzaLr2U1oZZGQn3t8NgHWvhj8PDWHk1VwIGhp8U0IBHRT3rzJihs9qECQkMLG5czyoYADfb4bADXFLb+RLPfMhVEZ00wRShV8H/EDiJA==;31:gUhg/qY+E+ElQDSoN9wLTIFQG2rxn95kwZ5cE2VX2JFZdBEB04oJ1J5HBjrIqCYIlM/ub8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g6Exkpg3IV3WA+AoxW8/WCH+xN5FEkK5k= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699050);SRVR:DB7PR04MB4476;BCL:0;PCL:0;RULEID:;SRVR:DB7PR04MB4476; X-Forefront-PRVS: 07915F544A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(366004)(396003)(136003)(39860400002)(346002)(376002)(199004)(189003)(14444005)(48376002)(81166006)(8936002)(81156014)(105586002)(106356001)(44832011)(53936002)(47776003)(50466002)(7416002)(316002)(956004)(16586007)(6512007)(2616005)(575784001)(476003)(26005)(186003)(66066001)(486006)(11346002)(25786009)(6506007)(386003)(50226002)(446003)(2906002)(16526019)(86362001)(55236004)(6116002)(3846002)(97736004)(4326008)(68736007)(7736002)(5009440100003)(305945005)(6486002)(8676002)(478600001)(52116002)(51416003)(5660300001)(76176011)(39060400002)(6666003)(36756003)(110426005)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB7PR04MB4476;H:b27504-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;DB7PR04MB4476;23:l2bQ7CJzjIVHYL69EaTULXNajGnpMSmhHSA7mRemCBVxs7Hg6/cAaa3ajlazUowcVJi6qmnQDdoLb0in9fjHXQsYiUO3MzK4itKZ2OUBfnKOwx0T2F8VsZiWqaEJx+mS63Mi2Omqh4B846QPlyHJK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Kr9xxAUTaRWloeORr+Q542Y5IdeR8PByIxc1+5NoEJ7SNff2Y8Q5rliX6I55xTbZUB0Oj2e8wORu9sui4KGSicHYdKng0RDH2HOuJ405p47aDlFDxApQkO9vat+XF0c+1X+1IaXXU1LFeze0lGI=;7:fV6piyY5wIk5Ewp00jruef/DHBrNxjO4F3/RlFmn7Z/LDoE56gh3InHZAFNYp2y4fYMLfZANBSCJYTO/6B9p6vZlBocvtoT8nJVhvy22wIr6MG7mpPlbYK9UyT9G0nnwLRLOBB18BKnBvsQmbNTmahyn6D3+EEGr6T/bCLRWLajrHsV2XKBkW6MUULMYxirnQmi+V0OhE3C1NWWn3zM0p+15xSYzYhHQPK443XOT+/5I5HbmnX/5UO9PWXobeAjv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2018 13:50:39.9252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0114417e-8365-41e2-d5c1-08d61724676e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4476 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fsl-mc bus support the new iommu-map property. Comply to this binding for fsl_mc bus. Signed-off-by: Nipun Gupta Reviewed-by: Laurentiu Tudor --- arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi index 137ef4d..3d5e049 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi @@ -184,6 +184,7 @@ #address-cells = <2>; #size-cells = <2>; ranges; + dma-ranges = <0x0 0x0 0x0 0x0 0x10000 0x00000000>; clockgen: clocking@1300000 { compatible = "fsl,ls2080a-clockgen"; @@ -357,6 +358,8 @@ reg = <0x00000008 0x0c000000 0 0x40>, /* MC portal base */ <0x00000000 0x08340000 0 0x40000>; /* MC control reg */ msi-parent = <&its>; + iommu-map = <0 &smmu 0 0>; /* This is fixed-up by u-boot */ + dma-coherent; #address-cells = <3>; #size-cells = <1>; @@ -460,6 +463,9 @@ compatible = "arm,mmu-500"; reg = <0 0x5000000 0 0x800000>; #global-interrupts = <12>; + #iommu-cells = <1>; + stream-match-mask = <0x7C00>; + dma-coherent; interrupts = <0 13 4>, /* global secure fault */ <0 14 4>, /* combined secure interrupt */ <0 15 4>, /* global non-secure fault */ @@ -502,7 +508,6 @@ <0 204 4>, <0 205 4>, <0 206 4>, <0 207 4>, <0 208 4>, <0 209 4>; - mmu-masters = <&fsl_mc 0x300 0>; }; dspi: dspi@2100000 {