Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp982284pxm; Thu, 3 Mar 2022 08:12:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwM/LfN1zvPZIE3cRNFb5WVldTxaWJFGFXhkQl/WyGBiwHRU6cQ5CE0XGJ2q6Idq7UThUH X-Received: by 2002:a63:8741:0:b0:37c:728a:e06f with SMTP id i62-20020a638741000000b0037c728ae06fmr1461441pge.458.1646323925830; Thu, 03 Mar 2022 08:12:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646323925; cv=none; d=google.com; s=arc-20160816; b=jh6XohzhXZbs+Lp5TCUvtkFZmbj5kUd9lrdvTxvdyk76zelQ6HctIhF8yFbUWOkRuX wJYP8DPinMyzPD7IurcAvvaw1Ab+mNhaHZCfD6oNPk2+iDCu2Rg1odLWn4kENoOWwfpL NgAMKHixR9Ugrk1anCRVzPgpVP6Uk9YG9AtQF/U/HJToUcRdtG15USUCiWw5+M8GoZXk qdQMZf5jDZwDM5WsATUliGGgTvvLgms36G7PUSJr8GrokRznM/qyH3I0eEIsVJA2HrLv SndxqnTzzLUkNkB8RJGgiIBdaF3hKlQgqSPBfrEts0cqiHyo8JjYN9d2Gp/vPMarJO1d ONYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=oW0Ca6zbN8WwdJ/ON4+exUcdoE1OIClAQbtzaTYv91s=; b=hgW83kAFpUAT0gkQ/S5tOXc0L6of5VjRx5sVBJmEID7qvh3nTi/Vez5hvD7gN9rL5f 7v1kGrpiyWIjBKcKBgJBRbEhkbGTCS6kthkRVK1C+UoUIO1AE4PKq24PuM6Xv5EbLrJj pun1xkfW7XRxbVq/gkID5M96I3To1c1f7tzVKUu7M9wLmAAGrdUYKYdcElxvS2HwO/ak orxTWos8JDyMenmtHN+0tXwoDFnZw8gWSAz28T6OFQosbQ9DExh6tz3EcvsCDakLfdO/ v69sLZvXXfTAsF5pMltRqvNCIvpr6sB3RmnAeuxTPLphPYZUZeXny/qrtmC7yFUNUbDi 9saA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=T0Ed+P8X; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a170902e74800b0014f64f38980si3018019plf.379.2022.03.03.08.11.46; Thu, 03 Mar 2022 08:12:05 -0800 (PST) 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=@collabora.com header.s=mail header.b=T0Ed+P8X; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234031AbiCCOyK (ORCPT + 99 others); Thu, 3 Mar 2022 09:54:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231680AbiCCOyI (ORCPT ); Thu, 3 Mar 2022 09:54:08 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3C70DD967; Thu, 3 Mar 2022 06:53:22 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 2F2FF1F45955 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646319201; bh=Ble5iVaMAvjHc5tgrSsMsD/4kzoBi7xNbSaUci+2wB8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=T0Ed+P8XT1vXh3m1n2h9wBeTHTpkQKT8hUqV8vU1oYMq50V87MsDZBRIanrCILBuF p2YPYRVIRrBY1SMksTjLIjHY67WygNK6qz5lOltemQpBqAJo2UxYbe050d5nwikxv2 BNLc/13yRP3Br0iGVcwjvnXQ+WwXwhQX0jAZrud4FocrjSA7NfqWYn+QBZEEr6kop5 F64ftokrxp7gBfZaSO0NApSwwrk0J5QbhHyadyDhoT//uSe85Sy2rEj6/Qyx6i21Zp oyKI9bzP23JPC8x2pIuGoHo5uqXKKMFdmTrzTU1UOol0ufPcEvmLv+kzySBbJ5UKod UR8KihXcNj5NQ== Message-ID: <0a867f1c-330b-16ac-6c87-42a181e50e1e@collabora.com> Date: Thu, 3 Mar 2022 15:53:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v2, 03/10] dt-bindings: media: mtk-vcodec: Adds encoder cores dt-bindings for mt8195 Content-Language: en-US To: Irui Wang , Hans Verkuil , Tzung-Bi Shih , Alexandre Courbot , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa , Yong Wu Cc: Hsin-Yi Wang , Maoguang Meng , Longfei Wang , Yunfei Dong , Fritz Koenig , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, srv_heupstream@mediatek.com, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20220117120615.21687-1-irui.wang@mediatek.com> <20220117120615.21687-4-irui.wang@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220117120615.21687-4-irui.wang@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 Il 17/01/22 13:06, Irui Wang ha scritto: > Adds encoder cores dt-bindings for mt8195 > > Signed-off-by: Irui Wang > --- > .../media/mediatek,vcodec-encoder-core.yaml | 214 ++++++++++++++++++ > 1 file changed, 214 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/mediatek,vcodec-encoder-core.yaml > > diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder-core.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder-core.yaml > new file mode 100644 > index 000000000000..d1e7bfa50bce > --- /dev/null > +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder-core.yaml > @@ -0,0 +1,214 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > + > +%YAML 1.2 > +--- > +$id: "http://devicetree.org/schemas/media/mediatek,vcodec-encoder-core.yaml#" > +$schema: "http://devicetree.org/meta-schemas/core.yaml#" > + > +title: Mediatek Video Encoder Accelerator With Multi Core > + > +maintainers: > + - Irui Wang > + > +description: | > + Mediatek Video Encode is the video encode hardware present in Mediatek > + SoCs which supports high resolution encoding functionalities. Required > + parent and child device node. > + > +properties: > + compatible: > + const: mediatek,mt8195-vcodec-enc > + > + mediatek,scp: > + $ref: /schemas/types.yaml#/definitions/phandle > + maxItems: 1 > + description: | > + The node of system control processor (SCP), using > + the remoteproc & rpmsg framework. > + > + iommus: > + minItems: 1 > + maxItems: 32 > + description: | > + List of the hardware port in respective IOMMU block for current Socs. > + Refer to bindings/iommu/mediatek,iommu.yaml. > + > + dma-ranges: > + maxItems: 1 > + description: | > + Describes the physical address space of IOMMU maps to memory. > + > + "#address-cells": > + const: 1 > + > + "#size-cells": > + const: 1 > + > + ranges: true > + > +# Required child node: > +patternProperties: > + "venc_core0@1a020000": This should be a pattern, venc-coreN where N is a number between 0 and 9, and any iostart should be allowed, not just 1a020000; doing it that way allows you to do a spec for all the core subnodes in one. > + type: object > + > + properties: > + compatible: > + const: mediatek,mtk-venc-core0 > + ..snip.. > + > +required: > + - compatible > + - mediatek,scp > + - iommus > + - dma-ranges > + - ranges > + > +additionalProperties: false > + > +examples: > + - | > + #include > + #include > + #include > + #include > + #include > + > + venc { > + compatible = "mediatek,mt8195-vcodec-enc"; > + mediatek,scp = <&scp>; > + iommus = <&iommu_vdo M4U_PORT_L19_VENC_RCPU>; > + dma-ranges = <0x1 0x0 0x0 0x40000000 0x0 0xfff00000>; > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; What about doing instead... #address-cells = <2>; #size-cells = <2>; (or fix your dma-ranges property) and... ranges = <0 0 0 0x1a020000 0 0x1020000>; venc-core0@0 { compatible = "mediatek,mtk-venc-hw"; reg = <0 0 0 0x10000>; mediatek,hw-leader; ..... other properties ..... }; venc-core1@1000000 { compatible = "mediatek,mtk-venc-hw"; reg = <0 0x1000000 0 0x10000>; ..... other properties ..... } Regards, Angelo > + > + venc_core0@1a020000 { > + compatible = "mediatek,mtk-venc-core0"; > + reg = <0x1a020000 0x10000>; > + iommus = <&iommu_vdo M4U_PORT_L19_VENC_RCPU>, > + <&iommu_vdo M4U_PORT_L19_VENC_REC>, > + <&iommu_vdo M4U_PORT_L19_VENC_BSDMA>, > + <&iommu_vdo M4U_PORT_L19_VENC_SV_COMV>, > + <&iommu_vdo M4U_PORT_L19_VENC_RD_COMV>, > + <&iommu_vdo M4U_PORT_L19_VENC_CUR_LUMA>, > + <&iommu_vdo M4U_PORT_L19_VENC_CUR_CHROMA>, > + <&iommu_vdo M4U_PORT_L19_VENC_REF_LUMA>, > + <&iommu_vdo M4U_PORT_L19_VENC_REF_CHROMA>; > + interrupts = ; > + clocks = <&vencsys CLK_VENC_VENC>; > + clock-names = "MT_CG_VENC0"; > + assigned-clocks = <&topckgen CLK_TOP_VENC>; > + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D4>; > + power-domains = <&spm MT8195_POWER_DOMAIN_VENC>; > + }; > + > + venc_core1@1b020000 { > + compatible = "mediatek,mtk-venc-core1"; > + reg = <0x1b020000 0x10000>; > + iommus = <&iommu_vpp M4U_PORT_L20_VENC_RCPU>, > + <&iommu_vpp M4U_PORT_L20_VENC_REC>, > + <&iommu_vpp M4U_PORT_L20_VENC_BSDMA>, > + <&iommu_vpp M4U_PORT_L20_VENC_SV_COMV>, > + <&iommu_vpp M4U_PORT_L20_VENC_RD_COMV>, > + <&iommu_vpp M4U_PORT_L20_VENC_CUR_LUMA>, > + <&iommu_vpp M4U_PORT_L20_VENC_CUR_CHROMA>, > + <&iommu_vpp M4U_PORT_L20_VENC_REF_LUMA>, > + <&iommu_vpp M4U_PORT_L20_VENC_REF_CHROMA>; > + interrupts = ; > + clocks = <&vencsys_core1 CLK_VENC_CORE1_VENC>; > + clock-names = "MT_CG_VENC1"; > + assigned-clocks = <&topckgen CLK_TOP_VENC>; > + assigned-clock-parents = <&topckgen CLK_TOP_UNIVPLL_D4>; > + power-domains = <&spm MT8195_POWER_DOMAIN_VENC_CORE1>; > + }; > + };