Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp543208imm; Wed, 22 Aug 2018 08:29:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwf/D0+lZk6220/aeDUbnHHUbqO0Z7LWZwVXV3BCcmA6p19cfBjqtp/0wWvLXSzDutuQfKI X-Received: by 2002:a63:ed4f:: with SMTP id m15-v6mr51927398pgk.147.1534951782972; Wed, 22 Aug 2018 08:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534951782; cv=none; d=google.com; s=arc-20160816; b=uwvrZYI1U6nselfjh1SKSgHkide4RBWI0Irxm3srsPnsyCf/WeY0/xz+3wfHMcNFSP tGM8SLDLemPPrJqeT4+0dsvIlqk6kEz35VggswUC7AyUktKPaHmoVkw7/lWCVYp8PD2d FZ9roh21z+ZjU1StIu3txZE4LMWklPvfGeo36JaxCha+mf1wlwekEPFuHiwWEmVR+S2k PDlKPQZJFxLOlfoOLd554+ve/qRvdSZM99xa6vek3Emb/VOI1WSlyPITpnuwaWreU+n4 2z6BYYWW3No/Uwx/3NzoT+wNGc7Pv5ZeJhlmIOVBV2SemnbLlgGkyvO5CRR5LZQ35/tp bKUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=3cchYpvURY74vQXPbuOJykGqkurKpVVOF3LcNJHE4tw=; b=w9iSdnaws4r/CXjbSambGG2vtY0l7jsyxy37shMEEJhZmXPB/Z19sLC2KvolJfNC2d /iNbC9jeO+lnMWXFbmPYtPhJuVlm8tLGsYhPBSKsAzvrxYj/Y4ZKAyErGDV2psddBSBz G5NlI/kuXz4ip2q9SQbkyfWp9sRT7CAzDe3Gi2WZYbmKCjQBxn9WKK2V77FhBq9NyyQE J/dU0zwYeuia3O/qFjCH94yz/AVgsnu9F17b8gOLctrx8fu383pG6j0g5BJsGdXuDXo2 FIlO4TGoM0dIBGtY9Q7cuhPAvr/s+vbRcpSzgd2Funxx3gJGJkfebu2gvB5VhhzWgaGW Igiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v132-v6si2005155pgb.333.2018.08.22.08.29.27; Wed, 22 Aug 2018 08:29:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729259AbeHVSw3 (ORCPT + 99 others); Wed, 22 Aug 2018 14:52:29 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34578 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbeHVSw3 (ORCPT ); Wed, 22 Aug 2018 14:52:29 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 03779ED1; Wed, 22 Aug 2018 08:27:09 -0700 (PDT) Received: from [10.4.12.131] (e110467-lin.Emea.Arm.com [10.4.12.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB7C93F2EA; Wed, 22 Aug 2018 08:27:05 -0700 (PDT) Subject: Re: [PATCH v14 4/4] iommu/arm-smmu: Add support for qcom,smmu-v2 variant To: Vivek Gautam , joro@8bytes.org, robh+dt@kernel.org, rjw@rjwysocki.net, will.deacon@arm.com, iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, freedreno@lists.freedesktop.org Cc: alex.williamson@redhat.com, mark.rutland@arm.com, robdclark@gmail.com, linux-pm@vger.kernel.org, sboyd@kernel.org, tfiga@chromium.org, jcrouse@codeaurora.org, sricharan@codeaurora.org, m.szyprowski@samsung.com, architt@codeaurora.org, linux-arm-msm@vger.kernel.org References: <20180727070224.23966-1-vivek.gautam@codeaurora.org> <20180727070224.23966-5-vivek.gautam@codeaurora.org> From: Robin Murphy Message-ID: <44c79159-bf14-cdf0-70ab-421b1dc3c83e@arm.com> Date: Wed, 22 Aug 2018 16:27:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180727070224.23966-5-vivek.gautam@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/07/18 08:02, Vivek Gautam wrote: > qcom,smmu-v2 is an arm,smmu-v2 implementation with specific > clock and power requirements. This smmu core is used with > multiple masters on msm8996, viz. mdss, video, etc. > Add bindings for the same. > > Signed-off-by: Vivek Gautam > Reviewed-by: Rob Herring > Reviewed-by: Tomasz Figa > --- > > Change since v13: > - No change. > > .../devicetree/bindings/iommu/arm,smmu.txt | 42 ++++++++++++++++++++++ > drivers/iommu/arm-smmu.c | 13 +++++++ > 2 files changed, 55 insertions(+) > > diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.txt b/Documentation/devicetree/bindings/iommu/arm,smmu.txt > index 8a6ffce12af5..7c71a6ed465a 100644 > --- a/Documentation/devicetree/bindings/iommu/arm,smmu.txt > +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.txt > @@ -17,10 +17,19 @@ conditions. > "arm,mmu-401" > "arm,mmu-500" > "cavium,smmu-v2" > + "qcom,-smmu-v2", "qcom,smmu-v2" > > depending on the particular implementation and/or the > version of the architecture implemented. > > + A number of Qcom SoCs use qcom,smmu-v2 version of the IP. > + "qcom,-smmu-v2" represents a soc specific compatible > + string that should be present along with the "qcom,smmu-v2" > + to facilitate SoC specific clocks/power connections and to > + address specific bug fixes. As demonstrated in the GPU thread, this proves a bit too vague for a useful binding. Provided Qcom folks can reach a consensus on what a given SoC is actually called, I'd rather just unambiguously list whatever sets of fully-defined strings we need. Robin. > + An example string would be - > + "qcom,msm8996-smmu-v2", "qcom,smmu-v2". > + > - reg : Base address and size of the SMMU. > > - #global-interrupts : The number of global interrupts exposed by the > @@ -71,6 +80,22 @@ conditions. > or using stream matching with #iommu-cells = <2>, and > may be ignored if present in such cases. > > +- clock-names: List of the names of clocks input to the device. The > + required list depends on particular implementation and > + is as follows: > + - for "qcom,smmu-v2": > + - "bus": clock required for downstream bus access and > + for the smmu ptw, > + - "iface": clock required to access smmu's registers > + through the TCU's programming interface. > + - unspecified for other implementations. > + > +- clocks: Specifiers for all clocks listed in the clock-names property, > + as per generic clock bindings. > + > +- power-domains: Specifiers for power domains required to be powered on for > + the SMMU to operate, as per generic power domain bindings. > + > ** Deprecated properties: > > - mmu-masters (deprecated in favour of the generic "iommus" binding) : > @@ -137,3 +162,20 @@ conditions. > iommu-map = <0 &smmu3 0 0x400>; > ... > }; > + > + /* Qcom's arm,smmu-v2 implementation */ > + smmu4: iommu { > + compatible = "qcom,msm8996-smmu-v2", "qcom,smmu-v2"; > + reg = <0xd00000 0x10000>; > + > + #global-interrupts = <1>; > + interrupts = , > + , > + ; > + #iommu-cells = <1>; > + power-domains = <&mmcc MDSS_GDSC>; > + > + clocks = <&mmcc SMMU_MDP_AXI_CLK>, > + <&mmcc SMMU_MDP_AHB_CLK>; > + clock-names = "bus", "iface"; > + }; > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > index e558abf1ecfc..2b4edba188a5 100644 > --- a/drivers/iommu/arm-smmu.c > +++ b/drivers/iommu/arm-smmu.c > @@ -119,6 +119,7 @@ enum arm_smmu_implementation { > GENERIC_SMMU, > ARM_MMU500, > CAVIUM_SMMUV2, > + QCOM_SMMUV2, > }; > > struct arm_smmu_s2cr { > @@ -1971,6 +1972,17 @@ ARM_SMMU_MATCH_DATA(arm_mmu401, ARM_SMMU_V1_64K, GENERIC_SMMU); > ARM_SMMU_MATCH_DATA(arm_mmu500, ARM_SMMU_V2, ARM_MMU500); > ARM_SMMU_MATCH_DATA(cavium_smmuv2, ARM_SMMU_V2, CAVIUM_SMMUV2); > > +static const char * const qcom_smmuv2_clks[] = { > + "bus", "iface", > +}; > + > +static const struct arm_smmu_match_data qcom_smmuv2 = { > + .version = ARM_SMMU_V2, > + .model = QCOM_SMMUV2, > + .clks = qcom_smmuv2_clks, > + .num_clks = ARRAY_SIZE(qcom_smmuv2_clks), > +}; > + > static const struct of_device_id arm_smmu_of_match[] = { > { .compatible = "arm,smmu-v1", .data = &smmu_generic_v1 }, > { .compatible = "arm,smmu-v2", .data = &smmu_generic_v2 }, > @@ -1978,6 +1990,7 @@ static const struct of_device_id arm_smmu_of_match[] = { > { .compatible = "arm,mmu-401", .data = &arm_mmu401 }, > { .compatible = "arm,mmu-500", .data = &arm_mmu500 }, > { .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 }, > + { .compatible = "qcom,smmu-v2", .data = &qcom_smmuv2 }, > { }, > }; > MODULE_DEVICE_TABLE(of, arm_smmu_of_match); >