Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5271632ybe; Tue, 10 Sep 2019 00:47:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrIfKvB56gbwxtr+t2vhirYrG7X4niBNnbzwVQwSZx4PiDsbRQqz22aVoXWTk8l3iX5NQa X-Received: by 2002:a50:fd03:: with SMTP id i3mr26867414eds.223.1568101678771; Tue, 10 Sep 2019 00:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568101678; cv=none; d=google.com; s=arc-20160816; b=iCouGK4xJBOdLop49A0XQeFravGJZRzayYapkDqxQFbb2OVQckutu+oVkK1yrB8M7m 3TeQFbfBSUHQLvo4dtUIilxVRLMMDiuCtjmbjKo/T/00kQi9+mmycsbpInXvPrqryuy6 lrUFmMzD6oFtuyaK2hnGDiMs/rTTEhuM2KdjV2dPeAXKCFW+5pOjpuvcDUiYhF+C+sEf 63NKQN2uT5/75RQzeid+XUodTgAQL6UEh0mZArJK5ZnL7sU4sWA9Ub/2Y9Sor2XVAGsP 2/vqRfBWRphAFiptZED0qyR20xBdCliZ/cBcgZg2c0zPN8BonCDS2yHrh2huimENTGhu k2Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bZTKx+LTS9bdFxpd8Hz9VkDvNUgEdG1SPk+YefDRcs8=; b=g5pdGPD+T2TbwQtPjVMwBmTsjWPQVDHAfu1uv0WblnlcNFhNjMznW2IUogL2toqcb3 Q2H2u0qj0za5SeHjJaWU69WKTlwzj8nEDP+/HxXmuWgY13OqB94xnM553KGBUZxpyPBC Nr5TcbzQTMYoWXZfoDTRNS8vTf9JBfTCMSzSxxf89rHvKOzMUJ8vtjvo6kJuYQ7SB6NH YvLwDbuV4TtqK2Elx05kL+iY1Nx/5/u7ww7Wankl0cARXScXhrKY0LfyD6bgg4vxYlgh 8iwpkLJD7fZUTAclMfxXfRRkVvhsnY7Zi3SkauHTuLwYJWqaywSm7ofwNXD70tJ8nSzD 84iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tVWuIwN1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si5603096edy.409.2019.09.10.00.47.33; Tue, 10 Sep 2019 00:47:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tVWuIwN1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730085AbfIINTR (ORCPT + 99 others); Mon, 9 Sep 2019 09:19:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729485AbfIINTO (ORCPT ); Mon, 9 Sep 2019 09:19:14 -0400 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E45AA2196E; Mon, 9 Sep 2019 13:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568035153; bh=mQl8SFN7L25FSqXgnAwmU/zVUdVkvZll+y2qPF6NdBg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tVWuIwN1HHBPbhQRDOkNbyTGqjr9PCGG/8TWAVt5GFvaYdo2xPISWwMjj1hS99H/f fOsnfKIDwOk10Dw51FUXe5N7uYSn2O5OkiIBRLSqIvyy61LJLtUhinGNPBKQU5/lqe /ECCYiehmD49BqJYA2JGacjXIhjEynMqwvAqeRfQ= Received: by mail-lj1-f170.google.com with SMTP id h2so6197971ljk.1; Mon, 09 Sep 2019 06:19:12 -0700 (PDT) X-Gm-Message-State: APjAAAUp5jwfWmFkmSQMBpIVPQuVU6L79OsqonL2RbWxStwnJL4/XS/+ AHlcMBunwrAGPmz187JndSFRMOz4avpdJ0f1IDA= X-Received: by 2002:a2e:b4e3:: with SMTP id s3mr16524934ljm.143.1568035151088; Mon, 09 Sep 2019 06:19:11 -0700 (PDT) MIME-Version: 1.0 References: <20190909124147.17510-1-m.falkowski@samsung.com> In-Reply-To: <20190909124147.17510-1-m.falkowski@samsung.com> From: Krzysztof Kozlowski Date: Mon, 9 Sep 2019 15:18:59 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: arm: samsung: Convert Samsung Exynos IOMMU H/W, System MMU to dt-schema To: Maciej Falkowski Cc: "linux-samsung-soc@vger.kernel.org" , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , robh+dt@kernel.org, mark.rutland@arm.com, Marek Szyprowski , Andrzej Hajda Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 9 Sep 2019 at 14:42, Maciej Falkowski wrote: > > Convert Samsung Exynos IOMMU H/W, System Memory Management Unit > to newer dt-schema format. > > Signed-off-by: Maciej Falkowski > Signed-off-by: Andrzej Hajda Hi Maciej, Thanks for the patch. Few comments below. > --- > .../bindings/iommu/samsung,sysmmu.txt | 67 ------------ > .../bindings/iommu/samsung,sysmmu.yaml | 102 ++++++++++++++++++ > 2 files changed, 102 insertions(+), 67 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt > create mode 100644 Documentation/devicetree/bindings/iommu/samsung,sysmmu.yaml > > diff --git a/Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt b/Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt > deleted file mode 100644 > index 525ec82615a6..000000000000 > --- a/Documentation/devicetree/bindings/iommu/samsung,sysmmu.txt > +++ /dev/null > @@ -1,67 +0,0 @@ > -Samsung Exynos IOMMU H/W, System MMU (System Memory Management Unit) > - > -Samsung's Exynos architecture contains System MMUs that enables scattered > -physical memory chunks visible as a contiguous region to DMA-capable peripheral > -devices like MFC, FIMC, FIMD, GScaler, FIMC-IS and so forth. > - > -System MMU is an IOMMU and supports identical translation table format to > -ARMv7 translation tables with minimum set of page properties including access > -permissions, shareability and security protection. In addition, System MMU has > -another capabilities like L2 TLB or block-fetch buffers to minimize translation > -latency. > - > -System MMUs are in many to one relation with peripheral devices, i.e. single > -peripheral device might have multiple System MMUs (usually one for each bus > -master), but one System MMU can handle transactions from only one peripheral > -device. The relation between a System MMU and the peripheral device needs to be > -defined in device node of the peripheral device. > - > -MFC in all Exynos SoCs and FIMD, M2M Scalers and G2D in Exynos5420 has 2 System > -MMUs. > -* MFC has one System MMU on its left and right bus. > -* FIMD in Exynos5420 has one System MMU for window 0 and 4, the other system MMU > - for window 1, 2 and 3. > -* M2M Scalers and G2D in Exynos5420 has one System MMU on the read channel and > - the other System MMU on the write channel. > - > -For information on assigning System MMU controller to its peripheral devices, > -see generic IOMMU bindings. > - > -Required properties: > -- compatible: Should be "samsung,exynos-sysmmu" > -- reg: A tuple of base address and size of System MMU registers. > -- #iommu-cells: Should be <0>. > -- interrupts: An interrupt specifier for interrupt signal of System MMU, > - according to the format defined by a particular interrupt > - controller. > -- clock-names: Should be "sysmmu" or a pair of "aclk" and "pclk" to gate > - SYSMMU core clocks. > - Optional "master" if the clock to the System MMU is gated by > - another gate clock other core (usually main gate clock > - of peripheral device this SYSMMU belongs to). > -- clocks: Phandles for respective clocks described by clock-names. > -- power-domains: Required if the System MMU is needed to gate its power. > - Please refer to the following document: > - Documentation/devicetree/bindings/power/pd-samsung.txt > - > -Examples: > - gsc_0: gsc@13e00000 { > - compatible = "samsung,exynos5-gsc"; > - reg = <0x13e00000 0x1000>; > - interrupts = <0 85 0>; > - power-domains = <&pd_gsc>; > - clocks = <&clock CLK_GSCL0>; > - clock-names = "gscl"; > - iommus = <&sysmmu_gsc0>; > - }; > - > - sysmmu_gsc0: sysmmu@13e80000 { > - compatible = "samsung,exynos-sysmmu"; > - reg = <0x13E80000 0x1000>; > - interrupt-parent = <&combiner>; > - interrupts = <2 0>; > - clock-names = "sysmmu", "master"; > - clocks = <&clock CLK_SMMU_GSCL0>, <&clock CLK_GSCL0>; > - power-domains = <&pd_gsc>; > - #iommu-cells = <0>; > - }; > diff --git a/Documentation/devicetree/bindings/iommu/samsung,sysmmu.yaml b/Documentation/devicetree/bindings/iommu/samsung,sysmmu.yaml > new file mode 100644 > index 000000000000..6c40dfb86899 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iommu/samsung,sysmmu.yaml > @@ -0,0 +1,102 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iommu/samsung,sysmmu.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Samsung Exynos IOMMU H/W, System MMU (System Memory Management Unit) > + > +maintainers: > + - Marek Szyprowski > + > +description: |+ > + Samsung's Exynos architecture contains System MMUs that enables scattered > + physical memory chunks visible as a contiguous region to DMA-capable peripheral > + devices like MFC, FIMC, FIMD, GScaler, FIMC-IS and so forth. > + > + System MMU is an IOMMU and supports identical translation table format to > + ARMv7 translation tables with minimum set of page properties including access > + permissions, shareability and security protection. In addition, System MMU has > + another capabilities like L2 TLB or block-fetch buffers to minimize translation > + latency. > + > + System MMUs are in many to one relation with peripheral devices, i.e. single > + peripheral device might have multiple System MMUs (usually one for each bus > + master), but one System MMU can handle transactions from only one peripheral > + device. The relation between a System MMU and the peripheral device needs to be > + defined in device node of the peripheral device. > + > + MFC in all Exynos SoCs and FIMD, M2M Scalers and G2D in Exynos5420 has 2 System > + MMUs. > + * MFC has one System MMU on its left and right bus. > + * FIMD in Exynos5420 has one System MMU for window 0 and 4, the other system MMU > + for window 1, 2 and 3. > + * M2M Scalers and G2D in Exynos5420 has one System MMU on the read channel and > + the other System MMU on the write channel. > + > + For information on assigning System MMU controller to its peripheral devices, > + see generic IOMMU bindings. > + > +properties: > + compatible: > + const: samsung,exynos-sysmmu Add empty line between properties. Makes it easier to read. > + reg: > + description: A tuple of base address and size of System MMU registers. Description not needed. > + maxItems: 1 > + interrupts: > + description: | > + An interrupt specifier for interrupt signal of System MMU, > + according to the format defined by a particular interrupt > + controller. Description not needed. > + clocks: > + description: Phandles for respective clocks described by clock-names. Description not needed but I think number of elements is. > + clock-names: > + description: | > + Should be "sysmmu" or a pair of "aclk" and "pclk" to gate > + SYSMMU core clocks. > + Optional "master" if the clock to the System MMU is gated by > + another gate clock other core (usually main gate clock > + of peripheral device this SYSMMU belongs to). > + minItems: 1 > + maxItems: 2 Based on the description this can be up to three clocks. Please declare the exact items within each combination (so either sysmmu or aclk+pclk, plus optional master?). If this does not depend on compatible, then oneOf could work. Then number of items could be removed. > + "#iommu-cells": > + const: 0 > + description: Should be <0>. Description not needed. > + power-domains: $ref: /schemas/types.yaml#/definitions/phandle > + description: | > + Required if the System MMU is needed to gate its power. > + Please refer to the following document: > + Documentation/devicetree/bindings/power/pd-samsung.txt > + > +required: > + - compatible > + - reg > + - interrupts > + - clocks > + - clock-names > + - "#iommu-cells" > + > +examples: > + - | > + gsc_0: gsc@13e00000 { > + compatible = "samsung,exynos5-gsc"; > + reg = <0x13e00000 0x1000>; > + interrupts = <0 85 0>; > + power-domains = <&pd_gsc>; > + clocks = <&clock 0>; //CLK_GSCL0 Missing space after // > + clock-names = "gscl"; > + iommus = <&sysmmu_gsc0>; > + }; > + - | This is one example, not two. Best regards, Krzysztof > + sysmmu_gsc0: sysmmu@13e80000 { > + compatible = "samsung,exynos-sysmmu"; > + reg = <0x13E80000 0x1000>; > + interrupt-parent = <&combiner>; > + interrupts = <2 0>; > + clock-names = "sysmmu", "master"; > + clocks = <&clock 0>, // CLK_SMMU_GSCL0 > + <&clock 0>; // CLK_GSCL0 > + power-domains = <&pd_gsc>; > + #iommu-cells = <0>; > + }; > + > -- > 2.17.1 >