Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7783568rwd; Tue, 20 Jun 2023 06:16:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Wi3uEGx0fywCd3SBBBLVOQxV8o/U2+lryNgdZQa/R0VbPvBdQZJz76dlOM1oRPT8wQZWi X-Received: by 2002:a92:60c:0:b0:342:23f9:b848 with SMTP id x12-20020a92060c000000b0034223f9b848mr9392617ilg.30.1687266973196; Tue, 20 Jun 2023 06:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687266973; cv=none; d=google.com; s=arc-20160816; b=yUguXjdfEEyxrwCKT0Hn1ZhaWO51ouVf8TOAHnLPKr8bZWpBZsba1WvhAz2KwA8F3w rAQ2AiZfZ5glrmAAlzD2dN7YfX3dR7B3xturZT/T/eyruQiD68yaXY7SWmkTaGLLcf8P wN245EpU2SebWUcXwqMSJAwBriiBd8LVohO/KcqVSxrGeiAcgxcOMfir9ibb2IQoH5Xv ClVN/vQulyl7dqbe+cuhOiB/A4lQHtG9yF9gxOlrx7y7jG9XtYgtQmLWPCl4jG789sTU tPcYYlNZRk3oUKuBeyD73aR/6cgECty6PNWhzWwcVvjVX6NKSrLdHMA7QzSS0tLgE6KG USAw== 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=X+elCcDfXZKuzDxi8bk9krk/t0/AVdCFoDUPSesylM0=; b=iqLG0nE0d2HGaaxM3Fbfq6A9QG5sUFYCtnqj6Ly1wBAAs62TcULaeu0o9BAnQUp3re gD0MO/0Pn/A90ouBBwVc0iClLOiu2evAM3h8yGQZNJNPK7VAMoId2GngG6vs35+wUbTA xhl/uFZaxxV3VNaQJgSv4HTH+6e4mBryJDW0qEhsdYeTYnzbGB6RCE7uFKhucoADrKSG eXwF4kfzyy5dGV035dJwu7o8krnQNO0fVjy72yoHc8DKx5aUsfC6nJNs0bk7U9tXBgd8 hEYGRvxCW6AK++RrI4FbTbS+Dqfczj+NQ9nKBDAb9uA3tBNq7uumUCwzj/7QXMUnqfvL 1nIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x9OMHTeX; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az9-20020a056a02004900b00540102a876csi1799252pgb.73.2023.06.20.06.15.59; Tue, 20 Jun 2023 06:16:13 -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=x9OMHTeX; 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 S231429AbjFTNAQ (ORCPT + 99 others); Tue, 20 Jun 2023 09:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbjFTNAO (ORCPT ); Tue, 20 Jun 2023 09:00:14 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E3E519A2 for ; Tue, 20 Jun 2023 06:00:05 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-307d58b3efbso3709183f8f.0 for ; Tue, 20 Jun 2023 06:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687266003; x=1689858003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=X+elCcDfXZKuzDxi8bk9krk/t0/AVdCFoDUPSesylM0=; b=x9OMHTeXkE4gRObSwizT9qOmCj7avu5YFmrDEXhpwXqGRkRBCVAx9PGebZ+qEM3RDZ OvOgc7z0BeNlQdEsytlaLHZKwfmTP33fsNW6PJw8ZqAyFkXv18FMyk1DAut2nMN5JH/I zfNgBTR87OXG+4VydFkH32FlNYPGw9iKUJbAMWzHhTvNAEn3gwq/DajenzDfMflyfTCr AOsXZKoNUwCX8BN+56D093RNgyDZdDrRkC4hv61wAltfIvdCZ5Mh5YrI2UvFRcQoobA7 e8UauKvf12qTrcdQ58msGnWJb8Vtb4sowzs/nKPy83OCl/aHK9PsYoALzgKcL/mQWVAb 7yRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687266003; x=1689858003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X+elCcDfXZKuzDxi8bk9krk/t0/AVdCFoDUPSesylM0=; b=Xpls8E+jBxSjJ/rfLG4nFHlJR0y/xlzHlJWKLjWOmtHWagFiWzIOEG8X9kG3XSKbrk b8I06Umr9DE/UUpy2laCWMWRklEfJyd04Kuo7KY0ocCY7LvawQSDlOErI9hJLK9Uzw7c 5wmi2jtCqRXPjMZc0weUwFP/meRWISJQ2KNZg2p2DeS6MFZvL/AtgJ7ftvAiExEmwSf1 le/KXJBWz0X58AYkqelLVJp54rDwEHT6Ms3qK7OzV4zDiw4naziGlro+XpL/OMjl9fvM u0bmQk82hZjHvYoRBXhnUfSl1KBeegXQLVwZNDaU3el9eioslgvqYtMLokDMVpNVO0EN xvEg== X-Gm-Message-State: AC+VfDw5Ugh3aNe2s9oSjftE4siZpc5+lUXPZDK8fcEEXPVM96zedYve hsOFIqaX2v6iPdYYu1Wjm9Njng== X-Received: by 2002:adf:df12:0:b0:30d:af7c:5046 with SMTP id y18-20020adfdf12000000b0030daf7c5046mr7667598wrl.60.1687266003293; Tue, 20 Jun 2023 06:00:03 -0700 (PDT) Received: from [192.168.1.20] ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id e14-20020adfef0e000000b0030c2e3c7fb3sm1930310wro.101.2023.06.20.06.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jun 2023 06:00:02 -0700 (PDT) Message-ID: Date: Tue, 20 Jun 2023 15:00:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v3 3/6] media: dt-bindings: mediatek,vcodec: Remove VDEC_SYS for mt8183 Content-Language: en-US To: =?UTF-8?B?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= Cc: Matthias Brugger , Hans Verkuil , AngeloGioacchino Del Regno , kernel@collabora.com, Andrew-CT Chen , Conor Dooley , Krzysztof Kozlowski , Mauro Carvalho Chehab , Rob Herring , Tiffany Lin , Yunfei Dong , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org References: <20230620000349.2122191-1-nfraprado@collabora.com> <20230620000349.2122191-4-nfraprado@collabora.com> <8b5e4a9b-7496-02a1-d3b6-a0be8ea85798@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 20/06/2023 14:46, Nícolas F. R. A. Prado wrote: > On Tue, Jun 20, 2023 at 10:12:14AM +0200, Krzysztof Kozlowski wrote: >> On 20/06/2023 02:03, Nícolas F. R. A. Prado wrote: >>> The binding expects the first register space to be VDEC_SYS. But on >>> mt8183, which uses the stateless decoders, this space is used only for >>> controlling clocks and resets, which are better described as separate >>> clock-controller and reset-controller nodes. >>> >>> In fact, in mt8173's devicetree there are already such separate >>> clock-controller nodes, which cause duplicate addresses between the >>> vdecsys node and the vcodec node. But for this SoC, since the stateful >>> decoder code makes other uses of the VDEC_SYS register space, it's not >>> straightforward to remove it. >>> >>> In order to avoid the same address conflict to happen on mt8183, >>> since the only current use of the VDEC_SYS register space in >>> the driver is to read the status of a hardware controlled clock, remove >>> the VDEC_SYS register space from the binding and describe an extra >>> syscon that will be used to directly check the hardware status. >>> >>> Also add reg-names to be able to tell that this new register schema is >>> used, so the driver can keep backward compatibility. >>> >>> Signed-off-by: Nícolas F. R. A. Prado >>> >>> --- >>> I dropped the tags from this commit since a syscon is now used instead >>> of an extra clock. >>> >>> Changes in v3: >>> - Removed the active clock >>> - Added a mediatek,vdecsys syscon property >>> >>> Changes in v2: >>> - Merged with patch 1 (media: dt-bindings: mediatek,vcodec: Allow single >>> clock for mt8183) to avoid changing number of clocks twice >>> - Added maxItems to reg-names >>> - Constrained clocks for each compatible >>> - Reordered properties for each compatible >>> >>> .../media/mediatek,vcodec-decoder.yaml | 30 +++++++++++++++++++ >>> 1 file changed, 30 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml >>> index 1e56ece44aee..2f625c50bbfe 100644 >>> --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml >>> +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-decoder.yaml >>> @@ -21,8 +21,13 @@ properties: >>> - mediatek,mt8183-vcodec-dec >>> >>> reg: >>> + minItems: 11 >>> maxItems: 12 >>> >>> + reg-names: >>> + minItems: 11 >>> + maxItems: 11 >> >> maxItems: 12 >> >>> + >>> interrupts: >>> maxItems: 1 >>> >>> @@ -60,6 +65,10 @@ properties: >>> description: >>> Describes point to scp. >>> >>> + mediatek,vdecsys: >>> + $ref: /schemas/types.yaml#/definitions/phandle >>> + description: Phandle to the vdecsys syscon node. >>> + >>> required: >>> - compatible >>> - reg >>> @@ -79,8 +88,26 @@ allOf: >>> then: >>> required: >>> - mediatek,scp >>> + - mediatek,vdecsys >>> >>> properties: >>> + reg: >>> + maxItems: 11 >>> + >>> + reg-names: >>> + items: >>> + - const: misc >>> + - const: ld >>> + - const: top >>> + - const: cm >>> + - const: ad >>> + - const: av >>> + - const: pp >>> + - const: hwd >>> + - const: hwq >>> + - const: hwb >>> + - const: hwg >>> + >>> clocks: >>> minItems: 1 >>> maxItems: 1 >>> @@ -101,6 +128,9 @@ allOf: >>> - mediatek,vpu >>> >>> properties: >>> + reg: >>> + minItems: 12 >> >> >> What about reg-names here? They should be also defined and in sync with >> regs. > > That's intentional. As described in the commit message, mt8173 will keep having > the VDEC_SYS iospace, while mt8183 won't. And we use the presence of reg-names > to tell them apart. > > So, mt8173 has 12 regs, no reg-names and no syscon, while mt8183 has 11 regs, > with reg-names and the syscon. reg-names is not the way to tell apart variants. Compatible is. If you add reg-names for one variant, it's expected to have it defined for other as well, because the order of items in reg is always fixed. Best regards, Krzysztof