From patchwork Wed Mar 7 06:32:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 10263461 Return-Path: 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 A983A60247 for ; Wed, 7 Mar 2018 06:33:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93CA328E29 for ; Wed, 7 Mar 2018 06:33:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87CE328F77; Wed, 7 Mar 2018 06:33:04 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable 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 0E7F228E29 for ; Wed, 7 Mar 2018 06:33:03 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=VRqBMEyzW9onNdqI3rmxwlNVNiTaYJKj2eDp9JCT7oc=; b=a4x yyT4li2ieuFG9Pbkj1ciC4NCPh0YZ5o+d5W8FU8Nfnewoo0vnwGrjSin5v1yNpeNEFkgWL4jXLgoX 2Mszee9dohMs8+j3/5AROdVmHrqb3oguyN3dY8M4gITuHnIxVWnUxDHuMTLtmVv4+6qsS/pvXIYRe pAKGYtr3OY/BN29x37KDDnLuDQkdfDds0fv5Slh31oZkMvUu82KjmL9eXyaVJu4MMWeyLd7DDeh4G u+HQkP1x8tz3pK3U3H8SckfLSG4QNgr+OvaWix+NU3emLTrvxcFX4tk7hORdS24/bhnGwoqo9Lm9U yzVvp8RUCgzVL8ENdMR5pcnEWjfhKNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etSdD-00077G-IB; Wed, 07 Mar 2018 06:32:55 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etSd9-000768-4W for linux-arm-kernel@lists.infradead.org; Wed, 07 Mar 2018 06:32:53 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 263026053B; Wed, 7 Mar 2018 06:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520404359; bh=TluDHSfEudAPzKLn5ibhlVzjPWMG6jkoc7MtgoM7J7Q=; h=From:To:Cc:Subject:Date:From; b=kIikuM5N1AoelGwBn1kumzlVmtdhKweOFcPONj55o7cQp9xmpaTKR/2MfzV/cvVf+ zaW9bikfELtOW3Hqr2z0vNEw1M2zTf+01afmlQkwdk5D179VkxbLcXNuKPjy8ZltYt pN8ormwbEvW4tTiN2VthWmtYSMu+8XiHArq437Qk= Received: from blr-ubuntu-41.ap.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: vivek.gautam@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 61D62602A0; Wed, 7 Mar 2018 06:32:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520404358; bh=TluDHSfEudAPzKLn5ibhlVzjPWMG6jkoc7MtgoM7J7Q=; h=From:To:Cc:Subject:Date:From; b=HrtU988YfxrRWOfQ8DdY7Khr9Wwbmkh25llKLhOiocRWrwJbDq+3lbRLKZRfdTXMr 2QhC1lDC0TqnquOjjMqDJymHOqvzIxxFZ21WTvXJDnCc5bXU25zHAx0xd8xrAMOm8p tB7tVeAi0ybIRaQMUyg2IDdpQVzMuRRH+6mQfFxY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 61D62602A0 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vivek.gautam@codeaurora.org From: Vivek Gautam To: iommu@lists.linux-foundation.org, joro@8bytes.org, robin.murphy@arm.com Subject: [PATCH 1/1] iommu/arm-smmu: Add support for qcom,smmu-500 variant Date: Wed, 7 Mar 2018 12:02:19 +0530 Message-Id: <20180307063219.14409-1-vivek.gautam@codeaurora.org> X-Mailer: git-send-email 2.16.1.72.g5be1f00a9a70 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180306_223251_328528_A2727130 X-CRM114-Status: GOOD ( 13.85 ) 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: Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Will Deacon , open list , tfiga@chromium.org, Rob Herring , Vivek Gautam , "moderated list:ARM SMMU DRIVERS" MIME-Version: 1.0 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 Qualcomm's arm-smmu 500 implementation supports runtime pm so enable the same. Signed-off-by: Vivek Gautam --- Based on iommu/arm-smmu pm runtime support series [1]: [PATCH v8 0/5] iommu/arm-smmu: Add runtime pm/sleep support Tested on sdm845 with necessary support to enable the smmu and with necessary user. [1] https://lkml.org/lkml/2018/3/2/325 Documentation/devicetree/bindings/iommu/arm,smmu.txt | 14 ++++++++++++++ drivers/iommu/arm-smmu.c | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.txt b/Documentation/devicetree/bindings/iommu/arm,smmu.txt index 6ea27bd4f785..0b5c6d2a9865 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu.txt +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.txt @@ -18,6 +18,7 @@ conditions. "arm,mmu-500" "cavium,smmu-v2" "qcom,-smmu-v2", "qcom,smmu-v2" + "qcom,-smmu-500", "qcom,smmu-500" depending on the particular implementation and/or the version of the architecture implemented. @@ -30,6 +31,10 @@ conditions. An example string would be - "qcom,msm8996-smmu-v2", "qcom,smmu-v2". + "qcom,smmu-500" is arm,mmu-500 implementation that supports + efficient power management by supporting smmu's state + retention. + - reg : Base address and size of the SMMU. - #global-interrupts : The number of global interrupts exposed by the @@ -179,3 +184,12 @@ conditions. <&mmcc SMMU_MDP_AHB_CLK>; clock-names = "bus", "iface"; }; + + smmu5: iommu { + compatible = "qcom,sdm845-smmu-500", "qcom,smmu-500"; + reg = <0x15000000 0x80000>; + #iommu-cells = <2>; + #global-interrupts = <1>; + + ... + }; diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 7a96c924ae22..7f52456c6b25 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -2008,6 +2008,12 @@ static const char * const qcom_smmuv2_clks[] = { "bus", "iface", }; +static const struct arm_smmu_match_data qcom_smmu500 = { + .version = ARM_SMMU_V2, + .model = ARM_MMU500, + .rpm_supported = true, +}; + static const struct arm_smmu_match_data qcom_smmuv2 = { .version = ARM_SMMU_V2, .model = QCOM_SMMUV2, @@ -2024,6 +2030,7 @@ static const struct of_device_id arm_smmu_of_match[] = { { .compatible = "arm,mmu-500", .data = &arm_mmu500 }, { .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 }, { .compatible = "qcom,smmu-v2", .data = &qcom_smmuv2 }, + { .compatible = "qcom,smmu-500", .data = &qcom_smmu500 }, { }, }; MODULE_DEVICE_TABLE(of, arm_smmu_of_match); @@ -2394,6 +2401,7 @@ IOMMU_OF_DECLARE(arm_mmu401, "arm,mmu-401"); IOMMU_OF_DECLARE(arm_mmu500, "arm,mmu-500"); IOMMU_OF_DECLARE(cavium_smmuv2, "cavium,smmu-v2"); IOMMU_OF_DECLARE(qcom_smmuv2, "qcom,smmu-v2"); +IOMMU_OF_DECLARE(qcom_smmu500, "qcom,smmu-500"); MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations"); MODULE_AUTHOR("Will Deacon ");