From patchwork Thu Apr 6 11:58:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 80221 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp969043vqo; Thu, 6 Apr 2023 05:05:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZZSJ6bPVWnYPKTpSEgMk+ORHcQSgaXImQG3wmIc5FMzipqp4TiGmAFMVn1DftGaguxa0bQ X-Received: by 2002:a17:906:ccdd:b0:93f:82cb:fe42 with SMTP id ot29-20020a170906ccdd00b0093f82cbfe42mr6707934ejb.58.1680782726158; Thu, 06 Apr 2023 05:05:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680782726; cv=none; d=google.com; s=arc-20160816; b=d5DiAf2HTd6jR+HGnUhCB+8X4VdW018O9e46Uj6LCet43kPMkTqeEFzFR9ZnvNEA6T hO4bxg6W7DpgO7hQeXeCaLtOtp4B+Dc35Ftk0q4hP5KJ+drgGRyWkWf8hywriReQuKAl C8n2aDH03j08JWSYny+A6SZ7Ho8c8MD+DcNKxyu0gv1SlP5fWAkj6CS73AiVkU0FiX7T adBWnEOrRrCRpmeDu2C2jC5xAvwXM2TXlHlTa58J7b6Pw5fIJh35Xmfm9L6SB0Yrr6HT sjGhub0oCfjjOODAHyIak/EVEIjUk4yFWuCfrfUKPi4uPGFIq/AT4uy0bM1QeJ6A4gf8 KZGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=wEz7vgw5uhU097Ka8WcVBT886eUanKE5TMj9tFqtF7o=; b=TcU91ZyjZYnYvjUd/3VaY0vgBMMWRKdBNycdmhv3bNqJ7vpLXYw0BWVkOsV+/kqztJ S6Qql1WWPJ0sydxI7gKbz4/pmAtBMl2chsqbkOaNPdwTH5IbmZZBBwZ4dhzvlkF0Q+6U brBC8kWJzDqRIj3YQSfNFq07HIA+axngAiEhL9W3fRNJg3hPTtv2a4NUxfB7Y8lWWwR9 TsirsPYCmeDjqiQq9O0JISVqDjQbP75ak1vp1Wj6cM+Wle0THxMejht8n78UL3E7TQOU lHD17qea9C87yK3E5iGVMKo2gGaMtEhYVdhijBFmqV7sPUM+tQ9vBdkRBZKyRNGWzAQ2 Z8og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=byAot6+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o19-20020a1709064f9300b00947de9f9b54si963214eju.367.2023.04.06.05.05.00; Thu, 06 Apr 2023 05:05:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=byAot6+W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237216AbjDFMBj (ORCPT + 99 others); Thu, 6 Apr 2023 08:01:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229827AbjDFMBL (ORCPT ); Thu, 6 Apr 2023 08:01:11 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A6FAD510 for ; Thu, 6 Apr 2023 04:58:25 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id c9so40047808lfb.1 for ; Thu, 06 Apr 2023 04:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680782303; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=wEz7vgw5uhU097Ka8WcVBT886eUanKE5TMj9tFqtF7o=; b=byAot6+WRARtE+tR55I6QnRD1vOMNjSZjOixlqR0Jqf3sTZA6yyuLbMrdKeojOkkqZ ByTZ45h9eLg029PvTTfbEqVsvb6OpxWcDkmphKm/7wdJrK2SxrSYAKUrIjPhIGYDB6Ey IqVQLI5rIkI/uC49CTdLCol0n+kpZLLGOHWg2eXgOYH30frOJMUoj0BNyAm2uwd0JpbH xZzFKHVoGiO0sg3wTXXZgDLBdySxLe8I/Tet8a1qrAt005NeNTIrbmx8ytUPFVVSbyCd zX9WVrgTuXvIOyRRkDPeodUB2cJcg9X615NAOWaYdkAIEwTwzuppykTHEoCqNGEf2VWi QwMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680782303; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wEz7vgw5uhU097Ka8WcVBT886eUanKE5TMj9tFqtF7o=; b=xZ+yUd6sip8s7lcAZ6TUOXk35pAzU8ptmMKcLOFCDiK7XF77WitGpQdmTYyuX0kJCN XlW7nS25atwesIQoJQ1pekKhjQ/LzEaplP+8l/OhwFj5v+HYLrF0MfTdWEXhH+8LAzvp zQuCTdmSTvi/hSvEYFGnbdzdm0h3HxE+oJIxW3lhW4T+U4+ZnF/u9x0LaQL1qv2QkJWo 1NU9eXvgZbJb+pK3Ga1v8BkdqSLJvVOV00UOo/NVuI4iOzZ/+igLp8breQkNOT/Ugmyb dCn4IZNKbT0xvqeOA5ucYKRp061A0g/pUPRE3UrvKzHJhrMkx/nXveVJJuJvId8p19Fi 92eg== X-Gm-Message-State: AAQBX9cayu0+Cq9J3jnbiXe8QWm2H1+lvo2TrSsESkfAdMHq+lVoASCi NKBYnwMVsxgAGHEC2VN8VneFOA== X-Received: by 2002:ac2:4309:0:b0:4e8:43e2:a8 with SMTP id l9-20020ac24309000000b004e843e200a8mr2300539lfh.8.1680782303599; Thu, 06 Apr 2023 04:58:23 -0700 (PDT) Received: from [192.168.1.101] (abxh37.neoplus.adsl.tpnet.pl. [83.9.1.37]) by smtp.gmail.com with ESMTPSA id w3-20020a056512098300b004dd7fefd2c8sm231338lft.242.2023.04.06.04.58.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 04:58:23 -0700 (PDT) From: Konrad Dybcio Date: Thu, 06 Apr 2023 13:58:19 +0200 Subject: [PATCH v2] dt-bindings: iommu: Convert QCOM IOMMU to YAML MIME-Version: 1.0 Message-Id: <20230406-topic-qciommu-v2-1-b8547622b2a4@linaro.org> X-B4-Tracking: v=1; b=H4sIANqzLmQC/3WNQQ6CMBBFr0K6dkwLxKor72FYlDKFSaDFKRAN6 d2t7F2+l/z/dhGRCaO4F7tg3ChS8BnKUyHsYHyPQF1mUcqykrW8wBJmsvCyFKZpBW21qjq8Ond DkTetiQgtG2+HvPLrOGY5Mzp6H5Fnk3mguAT+HM1N/ey/+02BAlk5pbXSpq71YyRvOJwD96JJK X0BD1/xEsAAAAA= To: Andy Gross , Bjorn Andersson , Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1680782302; l=7496; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=hbr4tzXSxd2ffGS4hFOwUKVc93mD2kMGyhvcAspOwI4=; b=DenXYPio0tCOKPyO9yuknO35YDNBAxKz78rm5tpZrAdgUcAoPBpKB55NrCHEvhQGBBDDnThZeInQ ULe3hHBmAF+O+JX5fTHZbHrCMzc7VymjX4MIanXuFGyWAWQ7yOQY X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762428427826944593?= X-GMAIL-MSGID: =?utf-8?q?1762428427826944593?= Convert the Qualcomm IOMMU bindings to YAML. Signed-off-by: Konrad Dybcio --- v1 -> v2: - Include missing header - pad the addresses to 8 hex digits - add 'reg' to the mdp device v1: https://lore.kernel.org/r/20230406-topic-qciommu-v1-1-03f17717a447@linaro.org --- .../devicetree/bindings/iommu/qcom,iommu.txt | 122 --------------------- .../devicetree/bindings/iommu/qcom,iommu.yaml | 112 +++++++++++++++++++ 2 files changed, 112 insertions(+), 122 deletions(-) --- base-commit: 8417c8f5007bf4567ccffda850a3157c7d905f67 change-id: 20230406-topic-qciommu-7c713de8ff9e Best regards, diff --git a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt b/Documentation/devicetree/bindings/iommu/qcom,iommu.txt deleted file mode 100644 index e6cecfd360eb..000000000000 --- a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt +++ /dev/null @@ -1,122 +0,0 @@ -* QCOM IOMMU v1 Implementation - -Qualcomm "B" family devices which are not compatible with arm-smmu have -a similar looking IOMMU but without access to the global register space, -and optionally requiring additional configuration to route context irqs -to non-secure vs secure interrupt line. - -** Required properties: - -- compatible : Should be one of: - - "qcom,msm8916-iommu" - "qcom,msm8953-iommu" - - Followed by "qcom,msm-iommu-v1". - -- clock-names : Should be a pair of "iface" (required for IOMMUs - register group access) and "bus" (required for - the IOMMUs underlying bus access). - -- clocks : Phandles for respective clocks described by - clock-names. - -- #address-cells : must be 1. - -- #size-cells : must be 1. - -- #iommu-cells : Must be 1. Index identifies the context-bank #. - -- ranges : Base address and size of the iommu context banks. - -- qcom,iommu-secure-id : secure-id. - -- List of sub-nodes, one per translation context bank. Each sub-node - has the following required properties: - - - compatible : Should be one of: - - "qcom,msm-iommu-v1-ns" : non-secure context bank - - "qcom,msm-iommu-v1-sec" : secure context bank - - reg : Base address and size of context bank within the iommu - - interrupts : The context fault irq. - -** Optional properties: - -- reg : Base address and size of the SMMU local base, should - be only specified if the iommu requires configuration - for routing of context bank irq's to secure vs non- - secure lines. (Ie. if the iommu contains secure - context banks) - - -** Examples: - - apps_iommu: iommu@1e20000 { - #address-cells = <1>; - #size-cells = <1>; - #iommu-cells = <1>; - compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; - ranges = <0 0x1e20000 0x40000>; - reg = <0x1ef0000 0x3000>; - clocks = <&gcc GCC_SMMU_CFG_CLK>, - <&gcc GCC_APSS_TCU_CLK>; - clock-names = "iface", "bus"; - qcom,iommu-secure-id = <17>; - - // mdp_0: - iommu-ctx@4000 { - compatible = "qcom,msm-iommu-v1-ns"; - reg = <0x4000 0x1000>; - interrupts = ; - }; - - // venus_ns: - iommu-ctx@5000 { - compatible = "qcom,msm-iommu-v1-sec"; - reg = <0x5000 0x1000>; - interrupts = ; - }; - }; - - gpu_iommu: iommu@1f08000 { - #address-cells = <1>; - #size-cells = <1>; - #iommu-cells = <1>; - compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; - ranges = <0 0x1f08000 0x10000>; - clocks = <&gcc GCC_SMMU_CFG_CLK>, - <&gcc GCC_GFX_TCU_CLK>; - clock-names = "iface", "bus"; - qcom,iommu-secure-id = <18>; - - // gfx3d_user: - iommu-ctx@1000 { - compatible = "qcom,msm-iommu-v1-ns"; - reg = <0x1000 0x1000>; - interrupts = ; - }; - - // gfx3d_priv: - iommu-ctx@2000 { - compatible = "qcom,msm-iommu-v1-ns"; - reg = <0x2000 0x1000>; - interrupts = ; - }; - }; - - ... - - venus: video-codec@1d00000 { - ... - iommus = <&apps_iommu 5>; - }; - - mdp: mdp@1a01000 { - ... - iommus = <&apps_iommu 4>; - }; - - gpu@1c00000 { - ... - iommus = <&gpu_iommu 1>, <&gpu_iommu 2>; - }; diff --git a/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml b/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml new file mode 100644 index 000000000000..5bb376aeb958 --- /dev/null +++ b/Documentation/devicetree/bindings/iommu/qcom,iommu.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iommu/qcom,iommu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Technologies legacy IOMMU implementations + +maintainers: + - Konrad Dybcio + +description: | + Qualcomm "B" family devices which are not compatible with arm-smmu have + a similar looking IOMMU, but without access to the global register space + and optionally requiring additional configuration to route context IRQs + to non-secure vs secure interrupt line. + +properties: + compatible: + items: + - enum: + - qcom,msm8916-iommu + - qcom,msm8953-iommu + - const: qcom,msm-iommu-v1 + + clocks: + items: + - description: Clock required for IOMMU register group access + - description: Clock required for underlying bus access + + clock-names: + items: + - const: iface + - const: bus + + power-domains: + maxItems: 1 + + reg: + maxItems: 1 + + ranges: true + + qcom,iommu-secure-id: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + The SCM secure ID of the IOMMU instance. + + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + '#iommu-cells': + const: 1 + +patternProperties: + "^iommu-ctx@[0-9a-f]+$": + type: object + properties: + compatible: + enum: + - qcom,msm-iommu-v1-ns + - qcom,msm-iommu-v1-sec + + interrupts: + maxItems: 1 + + reg: + maxItems: 1 + +required: + - compatible + - clocks + - clock-names + - ranges + - '#address-cells' + - '#size-cells' + - '#iommu-cells' + +additionalProperties: false + +examples: + - | + #include + #include + + apps_iommu: iommu@1e20000 { + compatible = "qcom,msm8916-iommu", "qcom,msm-iommu-v1"; + reg = <0x01ef0000 0x3000>; + clocks = <&gcc GCC_SMMU_CFG_CLK>, + <&gcc GCC_APSS_TCU_CLK>; + clock-names = "iface", "bus"; + qcom,iommu-secure-id = <17>; + #address-cells = <1>; + #size-cells = <1>; + #iommu-cells = <1>; + ranges = <0 0x01e20000 0x40000>; + + /* mdp_0: */ + iommu-ctx@4000 { + compatible = "qcom,msm-iommu-v1-ns"; + reg = <0x4000 0x1000>; + interrupts = ; + }; + }; + + mdp: mdp@1a01000 { + reg = <0x01a01000 0x1000>; + iommus = <&apps_iommu 4>; + };