From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 5353B1BDCA for ; Fri, 10 Nov 2023 14:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF6B539CEB; Fri, 10 Nov 2023 06:51:13 -0800 (PST) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1r1Sqf-0006vh-2c; Fri, 10 Nov 2023 14:51:05 +0000 Date: Fri, 10 Nov 2023 14:51:00 +0000 From: Daniel Golle To: Krzysztof Kozlowski Cc: AngeloGioacchino Del Regno , Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Philipp Zabel , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 1/2] dt-bindings: watchdog: mediatek,mtk-wdt: add MT7988 watchdog and toprgu Message-ID: References: <6912f6f406bc45674020681184f3eeca2f2cb63f.1699576174.git.daniel@makrotopia.org> <2678cb48-1d2b-47bc-9272-06d9aa140c58@collabora.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Nov 10, 2023 at 03:46:14PM +0100, Krzysztof Kozlowski wrote: > On 10/11/2023 15:40, Daniel Golle wrote: > > On Fri, Nov 10, 2023 at 03:20:53PM +0100, Krzysztof Kozlowski wrote: > >> On 10/11/2023 15:17, Daniel Golle wrote: > >>> On Fri, Nov 10, 2023 at 12:56:18PM +0100, AngeloGioacchino Del Regno wrote: > >>>> Il 10/11/23 01:30, Daniel Golle ha scritto: > >>>>> Add binding description for mediatek,mt7988-wdt. > >>>>> > >>>>> Signed-off-by: Daniel Golle > >>>>> --- > >>>>> .../bindings/watchdog/mediatek,mtk-wdt.yaml | 1 + > >>>>> include/dt-bindings/reset/mediatek,mt7988-resets.h | 12 ++++++++++++ > >>>>> 2 files changed, 13 insertions(+) > >>>>> create mode 100644 include/dt-bindings/reset/mediatek,mt7988-resets.h > >>>>> > >>>>> diff --git a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml > >>>>> index cc502838bc398..8d2520241e37f 100644 > >>>>> --- a/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml > >>>>> +++ b/Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml > >>>>> @@ -25,6 +25,7 @@ properties: > >>>>> - mediatek,mt6735-wdt > >>>>> - mediatek,mt6795-wdt > >>>>> - mediatek,mt7986-wdt > >>>>> + - mediatek,mt7988-wdt > >>>>> - mediatek,mt8183-wdt > >>>>> - mediatek,mt8186-wdt > >>>>> - mediatek,mt8188-wdt > >>>>> diff --git a/include/dt-bindings/reset/mediatek,mt7988-resets.h b/include/dt-bindings/reset/mediatek,mt7988-resets.h > >>>>> new file mode 100644 > >>>>> index 0000000000000..fa7c937505e08 > >>>>> --- /dev/null > >>>>> +++ b/include/dt-bindings/reset/mediatek,mt7988-resets.h > >>>>> @@ -0,0 +1,12 @@ > >>>>> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ > >>>>> + > >>>>> +/* TOPRGU resets */ > >>>> > >>>> The first reset is zero, the second reset is one. > >>>> > >>>> Where's the zero'th reset? :-) > >>> > >>> Currently the reset numbers represent the corresponding bit positions in > >>> the toprgu register, as this is how the mtk-wdt driver is organized. > >>> > >>> So there is probably something at bit 0, and also at bit 3~11 and > >>> maybe also 17~23, but it's unknown and may be added later once known > >>> and/or needed. > >> > >> There is no need to put register bits, which are not used by the driver, > >> in the bindings. > > > > There aren't. That's why there isn't a zero'th reset (and also not 3~11, 17~24). > > > > Or should the driver be reorganized to provide a mapping of logical to > > physical resets, and then have only the needed once present and start > > counting logical resets from 0? This is doable, of course, but it's a > > bit of effort just for the aesthetical goal of starting to count from > > zero and continous in header file. > > > > And, of course, chances are that other currently still unused bits > > will be needed at a later point which then would mean having to add > > them in at least 2 places (header file and mapping logical<->physical) > > where as currently it would just mean adding a line defining it in the > > header file. > > You can do it, but it's not what I wrote here. So bear with me: > > "There is no need to put register bits in the bindings." > > You replied "There aren't", which I don't understand in this context. I > can be clearer: > Drop this hunk. So adding the file to include/dt-bindings/reset/ should go into a seperate patch? Because including it with the driver itself gave me a checkpath warning telling me that dt-bindings should go seperate, which is why I included it with the binding docs. > > > > > A quick looks at all the other headers in > > include/dt-binding/reset/mt*-resets.h also shows that currently all of > > them have unused bits and e.g. infracfg on MT7986 starts counting from > > 6. > > Best regards, > Krzysztof > >