[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c80a285-27fc-4d61-9eef-af4744a9decc@amd.com>
Date: Tue, 21 Nov 2023 12:55:54 +0100
From: Michal Simek <michal.simek@....com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Cc: Andrew Davis <afd@...com>, Arnd Bergmann <arnd@...db.de>,
Bjorn Andersson <andersson@...nel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Heiko Stuebner <heiko@...ech.de>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Neil Armstrong <neil.armstrong@...aro.org>,
Nishanth Menon <nm@...com>, Olof Johansson <olof@...om.net>,
linux-rockchip@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org,
linux-amlogic@...ts.infradead.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v2] docs: dt-bindings: add DTS Coding Style document
On 11/20/23 15:53, Krzysztof Kozlowski wrote:
> On 20/11/2023 15:01, Michal Simek wrote:
>>
>>
>> On 11/20/23 09:40, Krzysztof Kozlowski wrote:
>>> Document preferred coding style for Devicetree sources (DTS and DTSI),
>>> to bring consistency among all (sub)architectures and ease in reviews.
>>>
>>> Cc: Andrew Davis <afd@...com>
>>> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
>>> Cc: Arnd Bergmann <arnd@...db.de>
>>> Cc: Bjorn Andersson <andersson@...nel.org>
>>> Cc: Geert Uytterhoeven <geert+renesas@...der.be>
>>> Cc: Heiko Stuebner <heiko@...ech.de>
>>> Cc: Konrad Dybcio <konrad.dybcio@...aro.org>
>>> Cc: Matthias Brugger <matthias.bgg@...il.com>
>>> Cc: Michal Simek <michal.simek@....com>
>>> Cc: Neil Armstrong <neil.armstrong@...aro.org>
>>> Cc: Nishanth Menon <nm@...com>
>>> Cc: Olof Johansson <olof@...om.net>
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
>>>
>>> ---
>>>
>>> Merging idea: Rob/DT bindings
>>>
>>> Changes in v2
>>> =============
>>> 1. Hopefully incorporate entire feedback from comments:
>>> a. Fix \ { => / { (Rob)
>>> b. Name: dts-coding-style (Rob)
>>> c. Exceptions for ordering nodes by name for Renesas and pinctrl (Geert,
>>> Konrad)
>>> d. Ordering properties by common/vendor (Rob)
>>> e. Array entries in <> (Rob)
>>>
>>> 2. New chapter: Organizing DTSI and DTS
>>>
>>> 3. Several grammar fixes (missing articles)
>>>
>>> Cc: linux-rockchip@...ts.infradead.org
>>> Cc: linux-mediatek@...ts.infradead.org
>>> Cc: linux-samsung-soc@...r.kernel.org
>>> Cc: linux-amlogic@...ts.infradead.org
>>> Cc: linux-arm-kernel@...ts.infradead.org
>>> Cc: linux-arm-msm@...r.kernel.org
>>> ---
>>> .../devicetree/bindings/dts-coding-style.rst | 163 ++++++++++++++++++
>>> Documentation/devicetree/bindings/index.rst | 1 +
>>> 2 files changed, 164 insertions(+)
>>> create mode 100644 Documentation/devicetree/bindings/dts-coding-style.rst
>>>
>>> diff --git a/Documentation/devicetree/bindings/dts-coding-style.rst b/Documentation/devicetree/bindings/dts-coding-style.rst
>>> new file mode 100644
>>> index 000000000000..cc7e3b4d1b92
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/dts-coding-style.rst
>>> @@ -0,0 +1,163 @@
>>> +.. SPDX-License-Identifier: GPL-2.0
>>> +.. _dtscodingstyle:
>>> +
>>> +=====================================
>>> +Devicetree Sources (DTS) Coding Style
>>> +=====================================
>>> +
>>> +When writing Devicetree Sources (DTS) please observe below guidelines. They
>>> +should be considered complementary to any rules expressed already in Devicetree
>>> +Specification and dtc compiler (including W=1 and W=2 builds).
>>> +
>>> +Individual architectures and sub-architectures can add additional rules, making
>>> +the style stricter.
>>> +
>>> +Naming and Valid Characters
>>> +---------------------------
>>> +
>>> +1. Node and property names are allowed to use only:
>>> +
>>> + * lowercase characters: [a-z]
>>> + * digits: [0-9]
>>> + * dash: -
>>
>> device-tree specification v0.4. Chapter 2.2.1/Table 2.1 is describing much more
>> valid characters for node names.
>> It means above description is not accurate or DT spec should be updated.
>
> Spec allows way to much. dtc doesn't.
> One thing is the spec, second
> thing is coding style.
From my point of view spec is primary source of truth. If spec is saying name
can use upper case then I can use it. If upper case is not
recommended/deprecated because of whatever reason spec should be updated to
reflect it.
I know that DTC is reporting other issues but isn't it the right way to reflect
it back to the spec?
No doubt that it is nice to see to have guide like this.
Thanks,
Michal
Powered by blists - more mailing lists