Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp973429rdb; Fri, 17 Nov 2023 20:29:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdbW80nYY5ubZxBFWkrJvN/Bv0ldJ6+avvdViBdl+TW0i0T2X/pLqgBRQbMfiIEH7utAmk X-Received: by 2002:a17:902:d68b:b0:1ca:8abd:6b52 with SMTP id v11-20020a170902d68b00b001ca8abd6b52mr1578631ply.69.1700281776770; Fri, 17 Nov 2023 20:29:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700281776; cv=none; d=google.com; s=arc-20160816; b=eY/cqD2lhSGkAUq38SMOsacb+iKRMK876+EkHdD321xqceEAHyRyYJvEDrxbXm883r 7GQyPeXtIWcJBFlzWVqq3d8l5oFECKqbrogFAPOOdGF9LmkjEjz2coPYyzpvcczgnNqt UFerNvHqf3BtX3+g4agtXuRXMcAW5R4OY6Fr4myy5mP067jXvd9aftMvAPvfT060fL3s vM+6d3840k/6hQwa6RBB35cdOzbj5+LRmSNgYSAslVu3i7R26qgscmloIzwSAdNFQhLL ReGqdWzCAR1bH2RpnCyRlz89kSiog9WWPeGThOYi0qS3iwdDGQonWTIVrRL8Bg8aiWYC BMJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3tOGsdnCHhXR37Mn+CVjGB15eJXQEnFosnZ9luUtAKk=; fh=ajqwJHB27W/J8EhLqkTAR2+yy30uzELfRT2VzGpH0WI=; b=uVnnddEWjq6Z0oj1VYP2Ti1j3Hp6IKMOBP1a1ddpJIhPq79bb3tr7tMhgJ7+loq3Z0 ZQFQuPqhhL3lKCMa6vc2mlb3mEYlVr0nUrbsseix0q4Jd735XpNV0oqCwQ6DN2pHVOwj cgo0XPPA2/REIG+pgunPrMgyJZvCWSRcAizqcBLLfhdV0PrSIH/I3FrdwstiBbQ5leoR h0QU7PgAAo9dyWY6DMi30Q+LrJbsIUjtqDejv6giprpiXDRZnP9BXvVzBe9R4c0V/8n4 IDQrtnpR1YWVfkHhgDqyWbFPxanLps+oR+Y9lZKPs+nGMv5UDJi24P4nEw/NZuLN8LgS do5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BZAhX+eO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id jb19-20020a170903259300b001c73e886f68si3219483plb.316.2023.11.17.20.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 20:29:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BZAhX+eO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3ADE580615FF; Fri, 17 Nov 2023 20:28:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbjKRE2H (ORCPT + 99 others); Fri, 17 Nov 2023 23:28:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbjKRE2C (ORCPT ); Fri, 17 Nov 2023 23:28:02 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85D17D72; Fri, 17 Nov 2023 20:27:58 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AI4NvC3022202; Sat, 18 Nov 2023 04:27:43 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=3tOGsdnCHhXR37Mn+CVjGB15eJXQEnFosnZ9luUtAKk=; b=BZAhX+eOrlBs+Ck9ENxwQDbxGOgOGPWpK60NOaJubXKUNJ1wt0NW9PlgQgKr+NM0ZhU/ cOAZnKgedJkX3B6O1A16Ovcmd/1Jk2haa2i2UsTggp/lSuuAuazqFHny6mEfRMSv3JoO rTPZGoN1p6T4X/+pr+t2r2PyYTIBgFzyCnYhyDa/rH8CB//AZFqk34g7RuAHNfaxUHyy /Swkf67Lyxqx38utfRX+4QeVEmaMa+vx6uTi4OslWRUEBtt26KNZvl4GZDpLZOVDMXor OgHZ/Dpb7aSxGn2ds+PPeD2fek47moBv7rlWiQ3a+KOC5HpeSoW/T7c0QwDDVIfVsEl5 TA== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3udt8bua23-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Nov 2023 04:27:43 +0000 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 3AI4RgAa032721 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 18 Nov 2023 04:27:42 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; Fri, 17 Nov 2023 20:27:42 -0800 From: Georgi Djakov To: , , , , , CC: , , , , , , , , , , , Subject: [PATCH v2 1/6] dt-bindings: iommu: Add Translation Buffer Unit bindings Date: Fri, 17 Nov 2023 20:27:25 -0800 Message-ID: <20231118042730.2799-2-quic_c_gdjako@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231118042730.2799-1-quic_c_gdjako@quicinc.com> References: <20231118042730.2799-1-quic_c_gdjako@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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-ORIG-GUID: rpe9wBd5FE9bWcuLzGWdcjkgEQPBO4g2 X-Proofpoint-GUID: rpe9wBd5FE9bWcuLzGWdcjkgEQPBO4g2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-18_02,2023-11-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 priorityscore=1501 suspectscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 spamscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311180032 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 20:28:17 -0800 (PST) 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 also 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 | 25 ++++++ .../bindings/iommu/qcom,qsmmuv500-tbu.yaml | 89 +++++++++++++++++++ 2 files changed, 114 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 aa9e1c0895a5..f7f89be5f7a3 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml @@ -231,6 +231,18 @@ 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]*": + type: object + required: - compatible - reg @@ -453,6 +465,19 @@ allOf: - description: Voter clock required for HLOS SMMU access - description: Interface clock required for register access + - if: + properties: + compatible: + contains: + const: qcom,smmu-500 + then: + patternProperties: + "^tbu@[0-9a-f]*": + $ref: qcom,qsmmuv500-tbu.yaml + unevaluatedProperties: false + properties: + ranges: true + # Disallow clocks for all other platforms with specific compatibles - if: properties: 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..4dc9d0ca33c9 --- /dev/null +++ b/Documentation/devicetree/bindings/iommu/qcom,qsmmuv500-tbu.yaml @@ -0,0 +1,89 @@ +# 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: + $nodename: + pattern: "^tbu@[0-9a-f]+$" + + compatible: + const: qcom,qsmmuv500-tbu + + reg: + items: + - description: Address and size of the TBU's register space. + + reg-names: + items: + - const: base + + clocks: + maxItems: 1 + + interconnects: + maxItems: 1 + + power-domains: + maxItems: 1 + + qcom,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 + - interconnects + - qcom,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>; + reg-names = "base"; + 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>; + qcom,stream-id-range = <0x1c00 0x400>; + }; + }; + +...