From patchwork Tue Dec 4 01:36:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krishna Reddy X-Patchwork-Id: 10711005 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 B642E16B1 for ; Tue, 4 Dec 2018 01:37:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AACC228820 for ; Tue, 4 Dec 2018 01:37:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E9132AEE0; Tue, 4 Dec 2018 01:37:20 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1E1C028820 for ; Tue, 4 Dec 2018 01:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=LmufG8YYgVrQerpm3riSbzeumCYvgVZRgi8LU/S9tCs=; b=Ft+FP9LATYLIHv j6KV+R2Isol/dd2v2axz3KCJekBxgV4VLL1gcicIiaSFJGFIRtNqXcoV0QL2EkqUsP5gdedXlww9n dsQULAXC3HLr/i/wIR9N9sw7EMfH7LX4CJV7vq0ST4LrtrozMfb3q582aInwIxjMU5R8oIhhhNQ2G 93yQpYbi5rv5LpgYsdlHXrqyeeNEdh3SK7AzahixHCZPhctxJrzVtM5G1qZhyGeGq+3ik8VH5xpDX fgVS65/NW2UiZK9lR6inJJxvCzddEKOY8TPNmj3SSWwYquYMd7ijvMhzNDV2hiMdV7LyB4cKLyhkl cKVEnIIzEnfc8J5OKVKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTzeI-00042X-3R; Tue, 04 Dec 2018 01:37:18 +0000 Received: from hqemgate15.nvidia.com ([216.228.121.64]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTze5-0003ld-JM for linux-arm-kernel@lists.infradead.org; Tue, 04 Dec 2018 01:37:12 +0000 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 03 Dec 2018 17:35:54 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 03 Dec 2018 17:36:54 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 03 Dec 2018 17:36:54 -0800 Received: from HQMAIL102.nvidia.com (172.18.146.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 4 Dec 2018 01:36:54 +0000 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL102.nvidia.com (172.18.146.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 4 Dec 2018 01:36:53 +0000 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 4 Dec 2018 01:36:53 +0000 Received: from vdumpa-ubuntu.nvidia.com (Not Verified[172.17.173.140]) by hqnvemgw02.nvidia.com with Trustwave SEG (v7, 5, 8, 10121) id ; Mon, 03 Dec 2018 17:36:53 -0800 From: Krishna Reddy To: , , Subject: [PATCH v3 0/5] Add Tegra194 Dual ARM SMMU driver Date: Mon, 3 Dec 2018 17:36:48 -0800 Message-ID: <1543887414-18209-1-git-send-email-vdumpa@nvidia.com> X-Mailer: git-send-email 2.1.4 X-NVConfidentiality: public MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1543887354; bh=GFFSVMThQMDSxoe7Z5jLRH73/5ZQ0+ad0JneajN89sY=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: X-NVConfidentiality:MIME-Version:Content-Type; b=gymUdo/yMdiRK5n1CAZNnDR/kUBgTFsPFxuHZz1n1hsWlcoqZA4dKc4gCtdXR8xgD 8uLKNRZwtqTHSWpL8QJn27XMm25vkp5+QcvmuWlL7NIPT/f06lxnSq41jDcQ8mJNQM ISbEoaXL9GoWE0248b9MJgJ30D8k4qABykwJrjUPDNa42/LwV1Mdg2dYOYbrAHxKkE bDBcpMNFI8YgREU0fFyUg0ES+cmmSLvWpx9YtzuRl7iUF/EXOvxpBoZSIQZxOC6hD6 V79brsd/wmU+75p9ex7W5foUPXkTx/g1GemUHNoSyQAlzgxQ8yU9SIw2CTOZ7jgOTA VDmFoiUIQdMOQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181203_173706_129419_1DAB0A89 X-CRM114-Status: GOOD ( 11.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: snikam@nvidia.com, thomasz@nvidia.com, jtukkinen@nvidia.com, mperttunen@nvidia.com, praithatha@nvidia.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, talho@nvidia.com, olof@lixom.net, yhsu@nvidia.com, linux-tegra@vger.kernel.org, treding@nvidia.com, avanbrunt@nvidia.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP NVIDIA's Xavier (Tegra194) SOC has two ARM SMMU(MMU-500) instances, which are used as one SMMU device in HW. The IOVA accesses from HW devices are interleaved across these two SMMU instances and need to be programmed identical. The existing ARM SMMU driver can't be used in its current form for programming the two SMMU instances identically. But, Most of the code can be shared between ARM SMMU driver and Tegra194 SMMU driver. To allow sharing the code, Created a libray based on the current ARM SMMU driver and added suppport to program multiple ARM SMMU Instances identically. Upated Current ARM SMMU driver and Tegra194 SMMU driver to use the library functions. Please review the patches and provide feedback. Changes in v2: * Added CONFIG_ARM_SMMU_TEGRA to protect Tegra194 SMMU driver compilation * Enabled CONFIG_ARM_SMMU_TEGRA in defconfig * Added SMMU nodes in Tegra194 device tree Changes in v3: * Created library for ARM SMMU based on arm-smmu.c * Added support to program multiple ARM SMMU instances identically * Updated arm-smmu.c/tegra194-smmu.c to use ARM SMMU library functions Krishna Reddy (6): iommu/arm-smmu: create library for ARM SMMU iommu/arm-smmu: Add support to program multiple ARM SMMU's identically iommu/arm-smmu: update arm-smmu.c to use ARM SMMU library iommu/tegra194_smmu: Add Tegra194 SMMU driver arm64: defconfig: Enable ARM_SMMU_TEGRA arm64: tegra: Add SMMU nodes to Tegra194 device tree arch/arm64/boot/dts/nvidia/tegra194.dtsi | 148 +++ arch/arm64/configs/defconfig | 1 + drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile | 2 + drivers/iommu/arm-smmu.c | 1709 +---------------------------- drivers/iommu/lib-arm-smmu.c | 1768 ++++++++++++++++++++++++++++++ drivers/iommu/lib-arm-smmu.h | 161 +++ drivers/iommu/tegra194-smmu.c | 394 +++++++ 8 files changed, 2496 insertions(+), 1698 deletions(-) create mode 100644 drivers/iommu/lib-arm-smmu.c create mode 100644 drivers/iommu/lib-arm-smmu.h create mode 100644 drivers/iommu/tegra194-smmu.c