From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EDA0C433FE for ; Mon, 23 May 2022 14:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237174AbiEWO0q (ORCPT ); Mon, 23 May 2022 10:26:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237141AbiEWO0p (ORCPT ); Mon, 23 May 2022 10:26:45 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 835712AC6A for ; Mon, 23 May 2022 07:26:43 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id p4so24475191lfg.4 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=GA3x9h+ng+IZcKMhkNUhG41sB3GrA04sbYBN7QUX5aWhLohN6tjDLenUfNupQc0NWF SMsJMHUfjo9mHIQ3IbBfSHJHGeUXmyyHpc5l4yx8E5ZvkeZiCIlBo/uFlC5RFnzgSsoW 3S0RTKDB2tk6zFzV0FTurwRz1hA7YAWbbx6+kHSX1jHtMa7lqmAp7IUhEYgDj59tXEkr v7pTJD1hRDznSGsGLGMYLq5Umf8izJSKeoFWc6PqAzHX4TyQmbW/i4HhZP0Wlzdq1Ggr 0TzanCbAI4kcCfSQAyhDoSYRjs7iavfeCe7iuPn+5FH0KNyFeUtvctxi+6/cyLe8h1X/ PQBQ== X-Gm-Message-State: AOAM532tR7aT/3ma75bRdSfoVlBuwcYNqgg9vx1VU3bwbH25y0EZg4EO DcWLTrbCskX0/OD5fkP1zZNXJA== X-Google-Smtp-Source: ABdhPJz+utSxZTs2n/fqh1e5tT8yA+mZZbm0vbet8rrFRC+nV5H+flGflipWNlxlkpty5umsiRR7UQ== 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 Precedence: bulk List-ID: X-Mailing-List: devicetree@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