Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1978490ioo; Mon, 23 May 2022 07:28:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiWDCzMltjzCMjIDexPsnoGf4Ua0T7uYfmG4oQ496DO9JmrKZF7gv33tmpsKDrsk2gmT3s X-Received: by 2002:a17:90b:4c47:b0:1df:ad5b:e32e with SMTP id np7-20020a17090b4c4700b001dfad5be32emr26338688pjb.59.1653316123834; Mon, 23 May 2022 07:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653316123; cv=none; d=google.com; s=arc-20160816; b=asIQZcnxdP34Lvma+qCY6kOv8A+4Nk4CgvimfMiEBh2XdAH1fGZwUtWnEmPTBflWYm aqHwIkFnXIRXDxIVZuSSf+bgyxm3bX4xoJgHrDahic0Rrg1zLJanpBDwnJI1aydh+RAw s+pB0FbjSvSDQL1qCz0AyGfE4akfOac7WL01+9Wij+dX38H1oVA50bnxWUOCFX9i/WmJ BdW+nNrCI08yK5w/fKmJMdL21I2/xQNIcQQ+4V+/ZOHp7VX4SORCoym0eA1tbJQ6hf4N tJOsVlMs6aqNg3u0YN1mqBS0oZRrZuKT7uUqVWazSVyWs2sTNXW4VTyVjvjSSPTkKAKZ cBkg== 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=G8pSkplAhfSaVtqePqq8XjdcWWlymy9x8EhPSya+xcQ=; b=Zc1NbkkVMOY8hOlwleXRi1EEvjFXLo8eIzPJykutqyQPrN2Xmc4ydM5BV8MZdWt2sK I+t7kEo46VNAZC50xHAg6bZvEpptV/Xuy+cuooU3xwOto/udM3IXPWDFMDecmlMLguIK RdNKnxOahqz5BInSLOW9d4lRGY+hay6Pw8K7CpO9HoORVfJI2j2S6PG0hFd29IE6og73 /yptoZssHmpDnL3y0kKSXoZ7MIcom/513h/kiUuOYFMmc+dpR0pTsCcQm2c0cf4KmHP9 VrmJSED+/VYasMO/QWz83sWXFKMUqoDL0DY8mgyWZltDt9yFjfQm1Ikr84009u9KMr3u 5Ksg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lyhx55/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id mu4-20020a17090b388400b001e012c2ea7fsi12256187pjb.144.2022.05.23.07.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 07:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lyhx55/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1916DF8D; Mon, 23 May 2022 07:27:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237144AbiEWO0r (ORCPT + 99 others); Mon, 23 May 2022 10:26:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237148AbiEWO0p (ORCPT ); Mon, 23 May 2022 10:26:45 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 836BA2B255 for ; Mon, 23 May 2022 07:26:43 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id y32so25873338lfa.6 for ; Mon, 23 May 2022 07:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=G8pSkplAhfSaVtqePqq8XjdcWWlymy9x8EhPSya+xcQ=; b=lyhx55/zAIKWU6MNtflmwMRqCG3WK3SvnlXBXjiHgsLYWJSvlsGHURt2CfjXGw+w5Z 9T/POO0IfWlxnm4ldWUCRi3apjNO415HWjuc39OoXNAAwX4IGXl8DNXTlHR+XFeoSJ9p ANhgfgJGy6QNR135WdYD6NGcQ6YwEPM2b22/HGCJoWDokpUm/cpTJdqUsFkRKzI83br0 lHzoZTZdQLhPjghrdM9RLgmXELx7Y0Hp5ahgfmltIRWRh0vIOfL6daJIuXxC4l3vqGpQ MvPNaDEINtn11/AdRN7lye2gTDxYFv0orSrAwwsS1jgDwvlJjV1ZgVVNrOdTlpgFMDw2 P81A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=G8pSkplAhfSaVtqePqq8XjdcWWlymy9x8EhPSya+xcQ=; b=sqrDZEjP7HG03oUEt83/sfsYNfKwJYgiCwNpT5e5u44p9kcc6W85yY0qtPFsdBdjSB ULgKK3lop4xHXq5FQY4C/G1gWUKfe6QdW6gOeNITVwPTpGr4ScLLyPhvWJJIwJT39v1P EHvrG4QWUL7AbFbDs3dQrgUEZZ1cX5K60zULX2hg/V6LTc7QujCm8ukqtnQRp5JfwTHK qrjiYY63dv3Hn0kJBIfg8R9MqRKj9UbjktiopvRyTB75SXOPRQ9uxWclqpTulArePWMu Mj5+lrMsUFdPJD4e9N5LX0pbVL42iRAQ0vXTrvDaSV4csBIhhMWsSEyioWi3QZx4YSc0 2XDw== X-Gm-Message-State: AOAM531FLABBAD9FYEeAKqGu/t/aDzPZ0XngQgQ23OGKz7SFhGK8464q OH0M8TmliZ0bt01bQYwzfilahg== X-Received: by 2002:a05:6512:33ce:b0:478:83ea:9e61 with SMTP id d14-20020a05651233ce00b0047883ea9e61mr433374lfg.264.1653316001764; Mon, 23 May 2022 07:26:41 -0700 (PDT) Received: from [192.168.0.17] (78-11-189-27.static.ip.netia.com.pl. [78.11.189.27]) by smtp.gmail.com with ESMTPSA id h16-20020a0565123c9000b00477a0eb9ab8sm1056497lfv.133.2022.05.23.07.26.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 May 2022 07:26:41 -0700 (PDT) Message-ID: <62562cdf-93e3-f642-5bbd-48329eff33ea@linaro.org> Date: Mon, 23 May 2022 16:26:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v1 11/19] dt-bindings: reset: npcm: Add support for NPCM8XX Content-Language: en-US To: Geert Uytterhoeven , Tomer Maimon Cc: Avi Fishman , Tali Perry , Joel Stanley , Patrick Venture , Nancy Yuen , Benjamin Fair , Rob Herring , Krzysztof Kozlowski , Michael Turquette , Stephen Boyd , Philipp Zabel , Greg KH , Daniel Lezcano , Thomas Gleixner , Wim Van Sebroeck , Guenter Roeck , Catalin Marinas , Will Deacon , Arnd Bergmann , Olof Johansson , Jiri Slaby , Shawn Guo , =?UTF-8?Q?Bj=c3=b6rn_Andersson?= , Geert Uytterhoeven , Marcel Ziswiler , Vinod Koul , Biju Das , Nobuhiro Iwamatsu , Robert Hancock , =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= , Lubomir Rintel , arm-soc , devicetree , Linux Kernel Mailing List , linux-clk , "open list:SERIAL DRIVERS" , Linux Watchdog Mailing List , Linux ARM References: <20220522155046.260146-1-tmaimon77@gmail.com> <20220522155046.260146-12-tmaimon77@gmail.com> <86cd6a37-70ad-3a90-bc8a-dcd8b41f1175@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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 23/05/2022 16:22, Geert Uytterhoeven wrote: > Hi Tomer, > > On Mon, May 23, 2022 at 4:03 PM Tomer Maimon wrote: >> On Mon, 23 May 2022 at 12:01, Krzysztof Kozlowski wrote: >>> On 22/05/2022 17:50, Tomer Maimon wrote: >>>> Add binding document and device tree binding >>>> constants for Nuvoton BMC NPCM8XX reset controller. >>>> >>>> Signed-off-by: Tomer Maimon > >>>> --- /dev/null >>>> +++ b/include/dt-bindings/reset/nuvoton,npcm8xx-reset.h >>>> @@ -0,0 +1,124 @@ >>>> +/* SPDX-License-Identifier: GPL-2.0 */ >>>> +// Copyright (c) 2022 Nuvoton Technology corporation. >>>> + >>>> +#ifndef _DT_BINDINGS_NPCM8XX_RESET_H >>>> +#define _DT_BINDINGS_NPCM8XX_RESET_H >>>> + >>>> +#define NPCM8XX_RESET_IPSRST1 0x20 >>>> +#define NPCM8XX_RESET_IPSRST2 0x24 >>>> +#define NPCM8XX_RESET_IPSRST3 0x34 >>>> +#define NPCM8XX_RESET_IPSRST4 0x74 >>> >>> What are these? All IDs should be incremental, decimal and start from 0. >> >> Register offset, we use the same method in NPCM7xx. please refer >> https://elixir.bootlin.com/linux/v5.18/source/include/dt-bindings/reset/nuvoton,npcm7xx-reset.h >> >> and the driver asserts the reset according to the reset include definitions > > So if they're easy to look up the values, you could do without the > definitions? Cfr. the interrupts properties in .dtsi files, where we > typically just use the hardcoded numbers. > > If you do decide to keep them, a comment explaining their origins > would be useful. > >>>> + >>>> +/* Reset lines on IP1 reset module (NPCM8XX_RESET_IPSRST1) */ >>>> +#define NPCM8XX_RESET_GDMA0 3 >>> >>> IDs start from 0 and do not have holes. >> >> This represents the reset BIT in the reset register. > > Likewise, I think it's a good idea to document that in a comment, cfr. > https://elixir.bootlin.com/linux/v5.18/source/include/dt-bindings/power/r8a7795-sysc.h#L8 Renesas is also doing it not correct (just like many others). The bindings are not for register bits or offsets. Such data can be DTS but not part of bindings. Imagine now you made mistake in this register offset and hardware uses slightly different value. What now? Change bindings? No. Bindings hold here ID, the abstraction, and ID stays fixed. Best regards, Krzysztof