Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp451050rdb; Thu, 21 Dec 2023 14:19:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjEPQ6wHdwfFh9ovKNX/tqIwUP8x4EcotT7Vj/6JUmQghSbQ/FDPtCLBGQy/fdZbu05LPE X-Received: by 2002:a05:6359:2c43:b0:174:c5fb:7f1a with SMTP id qv3-20020a0563592c4300b00174c5fb7f1amr393191rwb.52.1703197171785; Thu, 21 Dec 2023 14:19:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703197171; cv=none; d=google.com; s=arc-20160816; b=MFnud/hcCtsO3Ze2HDrZwo3QnMoNa4IpZ4pkYH9hr3WTgz/iUs2K8AhDHNZS2R4k1s I3SY+aU+NJvvKXOQEOwAnutP/QrPFz1N8AtPIJeV00rc8w4y/IwgDQBC22F+8+R4JOny mREZltQCakoiP2F09UaSICm+ddYjp2Sjjw0vawCHBS8M4eH94MAmq5fiuUgQ+FknyIgL EJKfNE67uJPiMXLYrIZ14qwMXCqbS6lnFH4lltVBpTeHQjALd2IkpKy16iLUX8gxL9Gf EGj0dBB4vOfgWrj3nQYJ7mEPHe+nXCe5IynWH2u6kbDn5RoBANpYvyQJLSBM0/g70UBo lNqg== 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=Oyn0x9j7Q/evOuVYf/pwa9Zz2tqlf6BV4LqW1vk5c/4=; fh=lfnT5/RB3qvXUqJ9ZFaQdwcUt0/kijdDT865gm8OoFA=; b=paKRdTM7yoRUq9pLN3p36uWOVAfDIteaLEuFxQzsaEtS2iZW0fsuCqHbghxBr640sd 9pXxK+IXPlh22tVtdsl8E2a9dOdMQMY2Zbnx6OK9BCRCmn7RaQO9P3JsDnkSDBP9TTfo xSzBwuzvrFVLOe5kMuegzQ13vhyUwmKYST0uKaVNjgqiKJq3MRdAdfl0GrH8o8KXWTCm cAe+MphlLDXJ/+TQph73UeaBvoDMk2n6CGBAky0OkYoeMLvzfPSL5Sknl0KD01QHVrqM Q3+nQd33qJRdH1oOHu9ULZD+S+Q+mPZvWPp/7UQsEMlAR6UOpyHSrN2RGbjhyR2wI5YD 75lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ixit.cz header.s=dkim header.b=H272Hf02; spf=pass (google.com: domain of linux-kernel+bounces-9123-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=ixit.cz Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h33-20020a63f921000000b005c660017567si2214087pgi.575.2023.12.21.14.19.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 14:19:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9123-linux.lists.archive=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=@ixit.cz header.s=dkim header.b=H272Hf02; spf=pass (google.com: domain of linux-kernel+bounces-9123-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9123-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 64A46284DAA for ; Thu, 21 Dec 2023 22:19:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FC4377F10; Thu, 21 Dec 2023 22:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ixit.cz header.i=@ixit.cz header.b="H272Hf02" 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 AB9C777635; Thu, 21 Dec 2023 22:19:02 +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 5591D16370D; Thu, 21 Dec 2023 23:18:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ixit.cz; s=dkim; t=1703197134; 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=Oyn0x9j7Q/evOuVYf/pwa9Zz2tqlf6BV4LqW1vk5c/4=; b=H272Hf020r9S6wemNcdO/WSAqYtbQHYjV+7S54Hsf9jiOO+Hwvi3VfCnmmWiMvihzkBp0w y1qyFb7HeKa7W4BX23jA5n1bEBuWNbJUpXDgssg+L0x8U/+JgRsLaBGYn9PCsU7N9GZ3Dx EWTMzsD8ZlAJ+Zr3ckbLpuFweCFCS/g= Message-ID: <2945c7f7-a847-4a7f-b075-70c1b4e6e7dc@ixit.cz> Date: Thu, 21 Dec 2023 23:18:54 +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 v6] dt-bindings: iommu: Convert msm,iommu-v0 to yaml To: Rob Herring , Sricharan Ramabadhran Cc: Joerg Roedel , Will Deacon , Robin Murphy , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20231219202907.186381-1-david@ixit.cz> <20231221134121.GA3660857-robh@kernel.org> 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/43T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yjQN7e2i0RcElGaHQ+82iRIJD3cvDfrk4+HPzeE 8udw5/rKxFMHhti1wgtklyJBc64JK2vgB6xJz9Zc4WoNnifc8QjyhsQ7K0UI9jykBXrb1ZZO DYlcrAqh9Sx4vNTmdi6pJWSsrhDtfmDIw81GIW5pc0QpZPqGeKMi5xEU8se5fQ21DuE5LRKF Zd4Uq64igWvLAgHIcJHgNbc5BruuZm9p1+S5SfQGfnOYxJM1PkY/E32H52iV/Babj30= In-Reply-To: <20231221134121.GA3660857-robh@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 21/12/2023 14:41, Rob Herring wrote: > On Tue, Dec 19, 2023 at 09:28:27PM +0100, David Heidelberg wrote: >> Convert Qualcomm IOMMU v0 implementation to yaml format. >> >> iommus part being ommited for the other bindings, as mdp4 one. >> >> Signed-off-by: David Heidelberg >> --- >> v6: >> - clean iommu-cells description (thx @Robin) >> 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) >> Signed-off-by: David Heidelberg >> >> .../bindings/iommu/msm,iommu-v0.txt | 64 ---------------- >> .../bindings/iommu/qcom,apq8064-iommu.yaml | 76 +++++++++++++++++++ >> 2 files changed, 76 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..b9a2d02ed2e6 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/iommu/qcom,apq8064-iommu.yaml >> @@ -0,0 +1,76 @@ >> +# 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 > This should be someone from QCom or that otherwise cares about this > device. Can I put Sricharan Ramabadhran here (CCed)? > >> + >> +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: Each IOMMU specifier describes a single Stream ID. >> + >> + qcom,ncb: >> + $ref: /schemas/types.yaml#/definitions/uint32 >> + description: The total number of context banks in the IOMMU. > Is there a maximum? I assume it is not 2^32. It's signed 32-bit int (because of armv7), haven't seen any limit in the code . In dts there are only values 2 or 3. Should I set min to 1 and max to (2^31)-1? > >> + >> +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>; >> + }; >> -- >> 2.43.0 >> -- David Heidelberg