Message ID | 1525069641-8523-4-git-send-email-nipun.gupta@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show
Return-Path: <linux-pci-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 72C3A6053E for <patchwork-linux-pci@patchwork.kernel.org>; Mon, 30 Apr 2018 06:29:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64770287B5 for <patchwork-linux-pci@patchwork.kernel.org>; Mon, 30 Apr 2018 06:29:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5921B287C8; Mon, 30 Apr 2018 06:29:48 +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 09BBC287B5 for <patchwork-linux-pci@patchwork.kernel.org>; Mon, 30 Apr 2018 06:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752269AbeD3G3i (ORCPT <rfc822;patchwork-linux-pci@patchwork.kernel.org>); Mon, 30 Apr 2018 02:29:38 -0400 Received: from mail-he1eur01on0062.outbound.protection.outlook.com ([104.47.0.62]:46976 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751841AbeD3G2h (ORCPT <rfc822;linux-pci@vger.kernel.org>); Mon, 30 Apr 2018 02:28:37 -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; bh=GT71q3ErxsD1K0lUb/wZp5bm9eIFTYzYsNSawVBmaME=; b=NwVeAB5TLw7ieN0U7YGFTd6yBmejrx0NB/wFvDaj7XQKtMKiAlybTXVXEC9AVcM6UajZNn7Qtb9qKdVUY/gmNV/8oX8MU/8sdsWKqdu4ywDNtJrz16jDVZfntUkQzlJU9DXF1KJPwrjn/yCGYNlQ8GrYyf1mumucSXN9iMHxGf0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.142.187.166) by AM4PR0401MB2418.eurprd04.prod.outlook.com (2603:10a6:200:51::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.715.18; Mon, 30 Apr 2018 06:28:29 +0000 From: Nipun Gupta <nipun.gupta@nxp.com> To: 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 Cc: hch@lst.de, joro@8bytes.org, m.szyprowski@samsung.com, shawnguo@kernel.org, frowand.list@gmail.com, bhelgaas@google.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, laurentiu.tudor@nxp.com, leoyang.li@nxp.com, Nipun Gupta <nipun.gupta@nxp.com> Subject: [PATCH v4 3/6] iommu: support iommu configuration for fsl-mc devices Date: Mon, 30 Apr 2018 11:57:18 +0530 Message-Id: <1525069641-8523-4-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525069641-8523-1-git-send-email-nipun.gupta@nxp.com> References: <1524824826-29473-1-git-send-email-nipun.gupta@nxp.com> <1525069641-8523-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0006.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::16) To AM4PR0401MB2418.eurprd04.prod.outlook.com (2603:10a6:200:51::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM4PR0401MB2418; X-Microsoft-Exchange-Diagnostics: 1; AM4PR0401MB2418; 3:16XVRAHihTRqTWNBTUwP/v9SgIRjA7EghAoNbAsBEznFJxiR9DQgkfjME5dSTVWLyTUS+2DZD3DPVGe+KpkYrqpQ7W0boEMyXctXvpacu3AkmL+hYEQNWeG8rkS6pAYUI64d9/RxU+Kouf1qVuQGzFu67i0nAbbMmcY7AmcAnKKGrteL+iBj+6eK3Ak9L8qatw2vMIYTsmjWoGcmpACHLcrSb5SvU+ApdawFwDsystA7nIUBNz/bP+8WKJhF119k; 25:cHRd/kVgG6fipriTxr31dOYKCWz4BF9YGSChpKR+0NVgCnPeHJlucvWxkNPakJZqqmyGj3EqsB2wPyzFVijGIr/aTaoXUEv44CRNNtl0o/u0OWeP4ibUiewhrGXm9XOv2NFkQ1HDZxxGJTpjMABGTLDsoTZlTnvYcMz2N1J2DW3C83Lx5cRpbO9mdoAUpnTxWB5IevB4FQwn3xuV2h3NNt+6uItxCkKLfWT1FdZDl3cv16u7Uk5JPOIj79e6ShcFA6/DJcM4tNVaHON5JnBW5Z+f28u/yRdV/DKk8W0bPu4Fs9FWPZ/2wcjUFpdayjUr3lgSMCIkGwOS42L3aEYDQA==; 31:N2OMhjAconfgoZ1Q//25zzxIcX+Y/VNwa8l/Da6h6YPL+ZrrsmBz02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wqd X-Microsoft-Antispam-PRVS: <AM4PR0401MB2418E734FF5D00A8FCC3E1D7E6820@AM4PR0401MB2418.eurprd04.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM4PR0401MB2418; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0401MB2418; X-Forefront-PRVS: 0658BAF71F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(39380400002)(376002)(366004)(346002)(189003)(199004)(36756003)(7736002)(52116002)(5660300001)(105586002)(106356001)(486006)(48376002)(50466002)(316002)(2616005)(55236004)(956004)(11346002)(446003)(476003)(51416003)(16526019)(186003)(6486002)(76176011)(44832011)(47776003)(26005)(97736004)(5009440100003)(66066001)(86362001)(68736007)(81156014)(81166006)(53936002)(16586007)(50226002)(2906002)(7416002)(25786009)(6506007)(8676002)(8936002)(478600001)(39060400002)(6666003)(386003)(6116002)(6512007)(3846002)(305945005)(4326008)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0401MB2418; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR0401MB2418; 23:4QlPQmBWdACHXIcNAZlW1Ex7unW5pEXOApDd5mw?= =?us-ascii?Q?xBcs5EnByKlJqQ13Jo5ow0ryoBbzYhGZlfTwvszOXULJfo7qf81uJz+wIjF+?= =?us-ascii?Q?OjHE2C2azFPHb7+gTgpGSVceenbX5bnvle8Hmw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vIz4u9q5kd+lE3Hx1zz9wr8ZiGxRfNF+A3niGfFAIu55gpLDJSS+w==; 5:bphumfdJIE80Ghre44kSHceR/dPHGb55F4SsTL6RFAyaXf2QwEzjG6yBV7HwWgYYM55XoL7hGwEsRWyG1QSf2/mGLsvqxiRudFkJdYmHfT9oNM6e9uR14tlw7zGRrC/jVoC7mfqhD/jnV2Mw0uKluxZNIX1WS8vvHJMDsCO4N0o=; 24:YZeCz4SNdeY7EJrsXarlvoYAnZaTpeSFzPCmXb324prou26X9AbN6pAPb8qk5CP90ltTohiVsMJ4QB7az8JVlPWZqxGNpl1zDs1n8U6ZP0I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM4PR0401MB2418; 7:yR3XtDFLU+BnvI7ECPS0I2w87KNndsp6Hf4q2qNT6fEaNNXhDn/5eiqm3CIdgyCfj+VpGV7ONLiTcCM/QRe2qQUTcaKoNs6zkebSMFk4GEtUEVSzsQ/Lq1bsaZ0Da6b3GVKuE6u1moD2dMTXHJwdStb2V5zyClMkargN9VOKwS5dMoycA+v/kiicz8o3Q5wSjnD9DOrP0i1fGockO0FZNwI610p1jWEpGIU7B8pmKXshUI3l5M5YNUFOwamz0sKI X-MS-Office365-Filtering-Correlation-Id: 3aea9fa4-f3f2-41e3-5193-08d5ae63992f X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2018 06:28:29.6339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3aea9fa4-f3f2-41e3-5193-08d5ae63992f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0401MB2418 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: <linux-pci.vger.kernel.org> X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
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 <linux/of_iommu.h> #include <linux/of_pci.h> #include <linux/slab.h> +#include <linux/fsl/mc.h> #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;
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> --- drivers/iommu/of_iommu.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)