Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp163072rdb; Tue, 19 Dec 2023 12:27:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFopHYRNI6kLQjJRuoBYygmgs/ElwuKJqbEig3Ehh3IcB9TpL19z9NlpXe0k8k5TsTe/exG X-Received: by 2002:a05:600c:16d4:b0:40c:2c1b:27ab with SMTP id l20-20020a05600c16d400b0040c2c1b27abmr9204856wmn.155.1703017637522; Tue, 19 Dec 2023 12:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703017637; cv=none; d=google.com; s=arc-20160816; b=sh4cmg8Wd0dC2rk4M3Jb5ya+FXHPSyy9smxg6b08Bqs9qm5wF24a7CCxUEnO4Nd3L9 rh51c/wKHkOOFq3KQ5P/RMf+lRfDMRa1zjIG7jcZNND6xwGfp9bbMtPdyah5FrgkTAAS kXxUSoceeLXtMrd7EvzSb3GDMJj5wRAxHj44h8J1ukHbi2em5nIEIvhtAcEcwhLyQeOa lsflp6lrydq38QYqFVNgAvD6bqWhASzDY2H0wiJ1bpr8gQEo8kFz16QdS8bQxvxZ+zNc f4DROHozAlzesWtqnYhVPwUiaKRldg9+zsBmEV9Pa6fwMcrI8Pgi3Z89tf7kHZlU/+h4 DhFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=zWCL0gIlbW4MfNh5yQGlR+a5SpC6h/NHdsEWW1PbXCg=; fh=orMid0gm7RWI7Uor/Y/xsw33cmaExkkwoe1SZoC1h3U=; b=cMv2htoyvh90Xrv4x5cEGDmQ4gp+IslxPxqRAOdjBAlaMGz2Tz9zgO3MsbY26hMlOg stsNWoXxW6Rw+igHa6K+4VlgnUualAHzC7cEhGsWnpQv8MCWX/ue0JO4BJmxlIz+r087 02k2V3bGBT/p+FQFMXA+7YEyAM3R93T1ZY1LLgE7dGzGcphp3/ctUHvkh1vriirD7I8v rn4U5HyNq14AyaRgUwQeCkjG6L1ipHMfeAOL0+8w94Ts/EUjvuYgrOVJGlpIk1BHvcSw GE32pW5v0d8vwyg5Xn2+r7040rEGVdKOzpWDxou26jMGwT/Awqb4I3NMCl80ZBSq2NIK 5V2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ixit.cz header.s=dkim header.b=CykwndEs; spf=pass (google.com: domain of linux-kernel+bounces-5905-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5905-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=ixit.cz Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v18-20020a170906489200b00a236c4a0a9esi1264305ejq.785.2023.12.19.12.27.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 12:27:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5905-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ixit.cz header.s=dkim header.b=CykwndEs; spf=pass (google.com: domain of linux-kernel+bounces-5905-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5905-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=ixit.cz 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1F7301F25E77 for ; Tue, 19 Dec 2023 20:27:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F0A639AE7; Tue, 19 Dec 2023 20:27:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ixit.cz header.i=@ixit.cz header.b="CykwndEs" X-Original-To: linux-kernel@vger.kernel.org Received: from ixit.cz (ip-89-177-23-149.bb.vodafone.cz [89.177.23.149]) (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 B747839AC1; Tue, 19 Dec 2023 20:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ixit.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ixit.cz Received: from [10.0.0.200] (unknown [10.0.0.1]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ixit.cz (Postfix) with ESMTPSA id DB7551630CE; Tue, 19 Dec 2023 21:26:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ixit.cz; s=dkim; t=1703017617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=zWCL0gIlbW4MfNh5yQGlR+a5SpC6h/NHdsEWW1PbXCg=; b=CykwndEsXvMHuodS+M9f7BHCPLJb0K20+ClaCCczoMzU4SsPAORd3+4YdxZzUOE3BS+wNw xB1tOQAfcwmpG+DX37bQgd4q9LCEr/ADJBYCAbRQs5qUGrUmhPj5rfvI3t7bQmG9zLbPyS oVNumOpX2TQmmIESFSTRcP0gNC1jedw= Message-ID: Date: Tue, 19 Dec 2023 21:26:57 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH v5] dt-bindings: iommu: Convert msm,iommu-v0 to yaml To: Robin Murphy , Joerg Roedel , Will Deacon , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20231216002242.112310-2-david@ixit.cz> Content-Language: en-US From: David Heidelberg Autocrypt: addr=david@ixit.cz; keydata= xsFNBF5v1x4BEADS3EddwsNsvVAI1XF8uQKbdYPY/GhjaSLziwVnbwv5BGwqB1tfXoHnccoA 9kTgKAbiXG/CiZFhD6l4WCIskQDKzyQN3JhCUIxh16Xyw0lECI7iqoW9LmMoN1dNKcUmCO9g lZxQaOl+1bY/7ttd7DapLh9rmBXJ2lKiMEaIpUwb/Nw0d7Enp4Jy2TpkhPywIpUn8CoJCv3/ 61qbvI9y5utB/UhfMAUXsaAgwEJyGPAqHlC0YZjaTwOu+YQUE3AFzhCbksq95CwDz4U4gdls dmv9tkATfu2OmzERZQ6vJTehK0Pu4l5KmCAzYg42I9Dy4E6b17x6NncKbcByQFOXMtG0qVUk F1yeeOQUHwu+8t3ZDMBUhCkRL/juuoqLmyDWKMc0hKNNeZ9BNXgB8fXkRLWEUfgDXsFyEkKp NxUy5bDRlivf6XfExnikk5kj9l2gGlNQwqROti/46bfbmlmc/a2GM4k8ZyalHNEAdwtXYSpP 8JJmlbQ7hNTLkc3HQLRsIocN5th/ur7pPMz1Beyp0gbE9GcOceqmdZQB80vJ01XDyCAihf6l AMnzwpXZsjqIqH9r7T7tM6tVEVbPSwPt4eZYXSoJijEBC/43TBbmxDX+5+3txRaSCRQrG9dY k3mMGM3xJLCps2KnaqMcgUnvb1KdTgEFUZQaItw7HyRd6RppewARAQABzSBE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4WoNnifc8QjyhsQ7K0UI9jykBXrb1ZZO DYlcrAqh9Sx4vNTmdi6pJWSsrhDtfmDIw81GIW5pc0QpZPqGeKMi5xEU8se5fQ21DuE5LRKF Zd4Uq64igWvLAgHIcJHgNbc5BruuZm9p1+S5SfQGfnOYxJM1PkY/E32H52iV/Babj30= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 19/12/2023 16:25, Robin Murphy wrote: > On 2023-12-16 12:22 am, David Heidelberg wrote: >> Convert Qualcomm IOMMU v0 implementation to yaml format. >> >> Signed-off-by: David Heidelberg >> --- >> v5: >>   - updated example (thx @Konrad) >>   - ordering of requirements + dropped > and | and reformatted (thx >> @Konrad) >> v4: >>   - renamed to qcom,apq8064-iommu as Rob requested >>   - changed title to Qualcomm APQ8064 IOMMU >>   - dropped quotes around URLs >>   - dropped mdp node >>   - dropped unused mdp_port0 label >> >> v3: >>   - I kept the name as -v0, since we have other binding -v1 and it look >>     good, I can change thou in v4 if requested. >>   - dropped non-existent smmu_clk part (and adjusted example, which was >>     using it) >>   - dropped iommu description >>   - moved iommu-cells description to the property #iommu-cells >> >> v2: >>   - fix wrong path in binding $id >>   - comment qcom,mdp4 node example (we don't want to validate it yet) >> >>   .../bindings/iommu/msm,iommu-v0.txt           | 64 --------------- >>   .../bindings/iommu/qcom,apq8064-iommu.yaml    | 82 +++++++++++++++++++ >>   2 files changed, 82 insertions(+), 64 deletions(-) >>   delete mode 100644 >> Documentation/devicetree/bindings/iommu/msm,iommu-v0.txt >>   create mode 100644 >> Documentation/devicetree/bindings/iommu/qcom,apq8064-iommu.yaml >> >> diff --git a/Documentation/devicetree/bindings/iommu/msm,iommu-v0.txt >> b/Documentation/devicetree/bindings/iommu/msm,iommu-v0.txt >> deleted file mode 100644 >> index 20236385f26e..000000000000 >> --- a/Documentation/devicetree/bindings/iommu/msm,iommu-v0.txt >> +++ /dev/null >> @@ -1,64 +0,0 @@ >> -* QCOM IOMMU >> - >> -The MSM IOMMU is an implementation compatible with the ARM VMSA short >> -descriptor page tables. It provides address translation for bus >> masters outside >> -of the CPU, each connected to the IOMMU through a port called >> micro-TLB. >> - >> -Required Properties: >> - >> -  - compatible: Must contain "qcom,apq8064-iommu". >> -  - reg: Base address and size of the IOMMU registers. >> -  - interrupts: Specifiers for the MMU fault interrupts. For >> instances that >> -    support secure mode two interrupts must be specified, for >> non-secure and >> -    secure mode, in that order. For instances that don't support >> secure mode a >> -    single interrupt must be specified. >> -  - #iommu-cells: The number of cells needed to specify the stream >> id. This >> -          is always 1. >> -  - qcom,ncb:      The total number of context banks in the IOMMU. >> -  - clocks    : List of clocks to be used during SMMU register >> access. See >> - Documentation/devicetree/bindings/clock/clock-bindings.txt >> -          for information about the format. For each clock specified >> -          here, there must be a corresponding entry in clock-names >> -          (see below). >> - >> -  - clock-names    : List of clock names corresponding to the clocks >> specified in >> -          the "clocks" property (above). >> -          Should be "smmu_pclk" for specifying the interface clock >> -          required for iommu's register accesses. >> -          Should be "smmu_clk" for specifying the functional clock >> -          required by iommu for bus accesses. >> - >> -Each bus master connected to an IOMMU must reference the IOMMU in >> its device >> -node with the following property: >> - >> -  - iommus: A reference to the IOMMU in multiple cells. The first >> cell is a >> -        phandle to the IOMMU and the second cell is the stream id. >> -        A single master device can be connected to more than one iommu >> -        and multiple contexts in each of the iommu. So multiple entries >> -        are required to list all the iommus and the stream ids that the >> -        master is connected to. >> - >> -Example: mdp iommu and its bus master >> - >> -                mdp_port0: iommu@7500000 { >> -            compatible = "qcom,apq8064-iommu"; >> -            #iommu-cells = <1>; >> -            clock-names = >> -                "smmu_pclk", >> -                "smmu_clk"; >> -            clocks = >> -                <&mmcc SMMU_AHB_CLK>, >> -                <&mmcc MDP_AXI_CLK>; >> -            reg = <0x07500000 0x100000>; >> -            interrupts = >> -                , >> -                ; >> -            qcom,ncb = <2>; >> -        }; >> - >> -        mdp: qcom,mdp@5100000 { >> -            compatible = "qcom,mdp"; >> -            ... >> -            iommus = <&mdp_port0 0 >> -                  &mdp_port0 2>; >> -        }; >> diff --git >> a/Documentation/devicetree/bindings/iommu/qcom,apq8064-iommu.yaml >> b/Documentation/devicetree/bindings/iommu/qcom,apq8064-iommu.yaml >> new file mode 100644 >> index 000000000000..5af59305d277 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iommu/qcom,apq8064-iommu.yaml >> @@ -0,0 +1,82 @@ >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> + >> +$id: http://devicetree.org/schemas/iommu/qcom,apq8064-iommu.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: Qualcomm APQ8064 IOMMU >> + >> +maintainers: >> +  - Will Deacon >> + >> +description: >> +  The MSM IOMMU is an implementation compatible with the ARM VMSA short >> +  descriptor page tables. It provides address translation for bus >> masters >> +  outside of the CPU, each connected to the IOMMU through a port >> called micro-TLB. >> + >> +properties: >> +  compatible: >> +    const: qcom,apq8064-iommu >> + >> +  clocks: >> +    items: >> +      - description: interface clock for register accesses >> +      - description: functional clock for bus accesses >> + >> +  clock-names: >> +    items: >> +      - const: smmu_pclk >> +      - const: iommu_clk >> + >> +  reg: >> +    maxItems: 1 >> + >> +  interrupts: >> +    description: Specifiers for the MMU fault interrupts. >> +    minItems: 1 >> +    items: >> +      - description: non-secure mode interrupt >> +      - description: secure mode interrupt (for instances which >> supports it) >> + >> +  "#iommu-cells": >> +    const: 1 >> +    description: >> +      The first cell is a phandle to the IOMMU and the second cell >> +      is the stream id. >> +      A single master device can be connected to more than one iommu >> +      and multiple contexts in each of the iommu. >> +      So multiple entries are required to list all the iommus and >> +      the stream ids that the master is connected to. > > This seems pretty confusing since it's the description for some other > property, not this one. FWIW I'd just put this as something like "Each > IOMMU specifier describes a single Stream ID.", and if you think it's > really worth calling out that clients can have multiple IOMMU > specifiers, I'd stick that in the overall description. > > Thanks, > Robin. Good catch, I must do wrong copy-paste here. I would think that the description you wrote is good enough and I can drop the rest :) Sending v6. Thanks David > >> + >> +  qcom,ncb: >> +    $ref: /schemas/types.yaml#/definitions/uint32 >> +    description: The total number of context banks in the IOMMU. >> + >> +required: >> +  - reg >> +  - interrupts >> +  - clocks >> +  - clock-names >> +  - qcom,ncb >> + >> +additionalProperties: false >> + >> +examples: >> +  - | >> +    #include >> +    #include >> +    #include >> + >> +    iommu@7500000 { >> +            compatible = "qcom,apq8064-iommu"; >> +            reg = <0x07500000 0x100000>; >> +            interrupts = , >> +                         ; >> +            clocks = <&clk SMMU_AHB_CLK>, >> +                     <&clk MDP_AXI_CLK>; >> +            clock-names = "smmu_pclk", >> +                          "iommu_clk"; >> +            #iommu-cells = <1>; >> +            qcom,ncb = <2>; >> +    }; -- David Heidelberg