From patchwork Wed Dec 20 06:02:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 181468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2443319dyi; Tue, 19 Dec 2023 22:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHlpexLbxQdDi7ME4xOfLWdcntdo/dSwhyYURKijVSBRMhubKRzPS5VYhqzSASDw1C7tHpA X-Received: by 2002:a05:6e02:18cd:b0:35f:b148:c240 with SMTP id s13-20020a056e0218cd00b0035fb148c240mr6940853ilu.46.1703052330643; Tue, 19 Dec 2023 22:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703052330; cv=none; d=google.com; s=arc-20160816; b=fmd4ZD+HLYnJlxumCwp8gLrpkLf/voSi5QsMQt12+Q+gcMlXA2Fp8vYcSyhQkflOKo ikyL9IODxAYAOWhQxgoi4SRFLURPDOpozac2qfIgSDkW02MV+8JOJQqLXRDdT3OXO44J Nz38B5LrLsRLMEzRSnkA8sjEhDsAQA9XmxzmTHRaV+JYDb+msX0LdNwdPqh+3p45tOUZ MjxsSSu3dYND+aUN5clbZc/eK71YHHPEdtaKSx4iZxjHQTFWtestgzlr0Ws6fA0gKZJl X/6Csyv/6shHf3i/LV8dVCjfPIR5Qp1reXR/P0p/0q9ox6RDfM+Av7IhHv6xVUaD7NSA cwjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cF2AFQd/o4DUV3N3/91PlROqR7ALzxo9WQC1QyEvWAI=; fh=ajqwJHB27W/J8EhLqkTAR2+yy30uzELfRT2VzGpH0WI=; b=qP/TErsbhWNIlPbv7uBMMVKXvQ+F+lkov5nYh+GRy9bm+ZCc+dx8KedeXKA0zR8NUu hH4/tO/L+XTrUerDKGLeaI18B19GYcyMc0s2y60kybaJzDZ+gLGTFAFWdDQyg3c48KW6 3fD2AcugdLo7d3lg5TxxQP3Iidw6EMjDsl4XSLvSL/AI3ygj6cdaKlV94BlJxphcDIjD sp2Lsp1Tmy2niL1pwIYUBmikGkjnQwiGl+pTGgtaSt7fx0LH872nA2Ejwgyusb86T0FI 7vu4I9Ccqy8D2K4kzpjmFuXo/ThbleRTRM4KgbkU5N9+aCBWdVuR6HVM++gcl/Yk0cYT mcPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cFZW3QBZ; spf=pass (google.com: domain of linux-kernel+bounces-6403-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6403-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i68-20020a639d47000000b005cdc2bdc091si1554436pgd.436.2023.12.19.22.05.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 22:05:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6403-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=cFZW3QBZ; spf=pass (google.com: domain of linux-kernel+bounces-6403-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6403-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5F415281AAD for ; Wed, 20 Dec 2023 06:05:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 012301F947; Wed, 20 Dec 2023 06:03:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="cFZW3QBZ" X-Original-To: linux-kernel@vger.kernel.org Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2D5D13AC4; Wed, 20 Dec 2023 06:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 3BK452vR020735; Wed, 20 Dec 2023 06:02:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=qcppdkim1; bh=cF2AFQd/o4DUV3N3/91P lROqR7ALzxo9WQC1QyEvWAI=; b=cFZW3QBZ7AVrpWeJCEP66jNBdwrsib2onVdF iMtZwqhhYhSMefUA088AIdjJW+dq3rPYZ1hWlKvgaBwWLbRpfHPVd/VmeMnzY9ps 4QcmxKxHb3oTa70O6DBzxuI8psngsmWO1Gl8+o8kyY/+KHsL5QW2n+VRvEvCT8T6 uygrPOa4qIIO95o7dpXpE7pgUNBO7tzztCACTj2uh41flh/nJWGKc7OSkzMrrxSx Di7WJD+/3TiW4+6hETSzQDd18Sz1tuGyZMGhHevz8XvGsz+aDinPIRAamCM/cvpM ZovcNnHxHPPTWK51gqhw7jDzks4N+Ct3PTgkUgAJhiEjO+E4aA== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3v3fed9b24-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 06:02:47 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3BK62kFJ027879 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Dec 2023 06:02:46 GMT Received: from hu-c-gdjako-lv.qualcomm.com (10.49.16.6) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 19 Dec 2023 22:02:45 -0800 From: Georgi Djakov To: , , , , , CC: , , , , , , , , , , , Subject: [PATCH v3 1/9] dt-bindings: iommu: Add Translation Buffer Unit bindings Date: Tue, 19 Dec 2023 22:02:28 -0800 Message-ID: <20231220060236.18600-2-quic_c_gdjako@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231220060236.18600-1-quic_c_gdjako@quicinc.com> References: <20231220060236.18600-1-quic_c_gdjako@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: X3WyVrKETlAt236d3zOk-UEpn75QNLfH X-Proofpoint-ORIG-GUID: X3WyVrKETlAt236d3zOk-UEpn75QNLfH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 clxscore=1015 mlxscore=0 priorityscore=1501 bulkscore=0 phishscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2312200038 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785779800743984909 X-GMAIL-MSGID: 1785779800743984909 The "apps_smmu" on the Qualcomm sdm845 platform is an implementation of the SMMU-500, that consists of a single TCU (Translation Control Unit) and multiple TBUs (Translation Buffer Units). The TCU is already being described in the generic SMMU DT schema. Add bindings for the TBUs to describe their properties and resources that needs to be managed in order to operate them. In this DT schema, the TBUs are modelled as child devices of the TCU and each of them is described with it's register space, clocks, power domains, interconnects etc. Signed-off-by: Georgi Djakov --- .../devicetree/bindings/iommu/arm,smmu.yaml | 31 ++++++++ .../bindings/iommu/qcom,qsmmuv500-tbu.yaml | 77 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 Documentation/devicetree/bindings/iommu/qcom,qsmmuv500-tbu.yaml diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index a4042ae24770..a610af2c7e5e 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml @@ -235,6 +235,27 @@ properties: enabled for any given device. $ref: /schemas/types.yaml#/definitions/phandle + '#address-cells': + enum: [ 1, 2 ] + + '#size-cells': + enum: [ 1, 2 ] + + ranges: true + +patternProperties: + "^tbu@[0-9a-f]+": + description: The TBU child node(s) + type: object + + properties: + stream-id-range: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: Stream ID range (address and size) that is assigned by the TBU + items: + minItems: 2 + maxItems: 2 + required: - compatible - reg @@ -312,6 +333,16 @@ allOf: through the TCU's programming interface. - description: bus clock required for the smmu ptw + - if: + properties: + compatible: + contains: + const: qcom,sdm845-smmu-500 + then: + patternProperties: + "^tbu@[0-9a-f]+": + $ref: qcom,qsmmuv500-tbu.yaml + - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/iommu/qcom,qsmmuv500-tbu.yaml b/Documentation/devicetree/bindings/iommu/qcom,qsmmuv500-tbu.yaml new file mode 100644 index 000000000000..c4f148ae5f38 --- /dev/null +++ b/Documentation/devicetree/bindings/iommu/qcom,qsmmuv500-tbu.yaml @@ -0,0 +1,77 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iommu/qcom,qsmmuv500-tbu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm TBU (Translation Buffer Unit) + +maintainers: + - Georgi Djakov + +description: + The Qualcomm SMMU500 implementation consists of TCU and TBU. The TBU contains + a Translation Lookaside Buffer (TLB) that caches page tables. TBUs provides + debug features to trace and trigger debug transactions. There are multiple TBU + instances distributes with each client core. + +properties: + + compatible: + const: qcom,qsmmuv500-tbu + + reg: + items: + - description: Address and size of the TBU's register space. + + clocks: + maxItems: 1 + + interconnects: + maxItems: 1 + + power-domains: + maxItems: 1 + + stream-id-range: + $ref: "arm,smmu.yaml#/patternProperties/^tbu@[0-9a-f]+/properties/stream-id-range" + +required: + - compatible + - reg + - stream-id-range + +additionalProperties: false + +examples: + - | + #include + #include + #include + #include + #include + #include + + apps_smmu: iommu@15000000 { + compatible = "qcom,sdm845-smmu-500", "arm,mmu-500"; + reg = <0x15000000 0x80000>; + ranges = <0 0 0 0 0xffffffff>; + #iommu-cells = <2>; + #global-interrupts = <1>; + interrupts = , + ; + #address-cells = <2>; + #size-cells = <2>; + + anoc_1_pcie_tbu: tbu@150e1000 { + compatible = "qcom,qsmmuv500-tbu"; + reg = <0x0 0x150e1000 0x0 0x1000>; + clocks = <&gcc GCC_AGGRE_NOC_PCIE_TBU_CLK>; + interconnects = <&system_noc MASTER_GNOC_SNOC QCOM_ICC_TAG_ACTIVE_ONLY + &config_noc SLAVE_IMEM_CFG QCOM_ICC_TAG_ACTIVE_ONLY>; + power-domains = <&gcc HLOS1_VOTE_AGGRE_NOC_MMU_PCIE_TBU_GDSC>; + stream-id-range = <0x1c00 0x400>; + }; + }; + +...