Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2273590rdb; Mon, 20 Nov 2023 06:54:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3NBuFESZXR7m4cSZjIfQBK1/GdgQYano5BkoLZLuC5DkVWXupeKiCr449KOLddWyNjmh+ X-Received: by 2002:a05:6a00:84b:b0:6cb:a60c:14 with SMTP id q11-20020a056a00084b00b006cba60c0014mr2269290pfk.18.1700492095979; Mon, 20 Nov 2023 06:54:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700492095; cv=none; d=google.com; s=arc-20160816; b=nclxlZEuuHdVmG3Zw+obZI6rq7ThpKeZcIHpTOVv9rZpI1q/JQ8BHrqE1SqrC/XcEZ 4wGY+HLg5ctIT1W+MOvXJHtovYoem4ogmy0EabBfKkVOsM1P+jiH+iN30JsHpycHmhjP +Q4Vsjp5q7SPzi3Nn1Qx7fyElFGV2g6C9qPEmjpPXqgytfjF+dDyWZsYjhsZS/OFsSxU YF+5Ydgnsw2QqY29Iwj3rbH5UMTZ2iqA/myOJA1b3spDK8Fg/XcYkxvue0StdXLpY0Hz 04JNASSavcFdOpdfCkscAIjSZ++ug0mo7QWbztB3VbbwXwifJlNSPQYXffUOLdCPybNL 6xDg== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=ET7XZBuYSIsGm9CmNHfDH0i0uNlWweXSO9s0Phl8jmQ=; fh=Ufz3sQ+kpfLlXf0BuybPSp/s+givNhN2mL7JtR8NUOY=; b=TpslmwqCwq6Aq+vvRNOw8pmaMCQH3dM30p9GaHm34c0IbOsT2Jx3h6IZbj65rV290W 2Bwn/YAwT5aSxEvUdZTEEpylrtnFtWuhypTJixo6mKqyUNJ2sWtSLkZS3ix9XQqHdrvQ kUzucYXzB7geGauSjKoNaIi9Bj87h9J00RJegY9aHXBu3TfYhouZgpds5h5Kj9H3QW5k 0jdOZ7/Lu0VmCjXXq8GOokHlioaVEnk8IW0rTcQT1WnL4Wt/MCdVNPwtdAfNeavf2hpx epqbn7T8M/+1iwHQfVj+CfDoGybA+Tdh2/LjDIRz/340I2hIfoYGJc11eDP0x/3xrKjQ k73g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G8KOGDNC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c9-20020a631c49000000b005b3b86ab19csi8107838pgm.107.2023.11.20.06.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:54:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G8KOGDNC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1E2CD80B816C; Mon, 20 Nov 2023 06:54:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233834AbjKTOya (ORCPT + 99 others); Mon, 20 Nov 2023 09:54:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjKTOyJ (ORCPT ); Mon, 20 Nov 2023 09:54:09 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 275453255 for ; Mon, 20 Nov 2023 06:53:33 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5480edd7026so5672773a12.0 for ; Mon, 20 Nov 2023 06:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700492011; x=1701096811; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ET7XZBuYSIsGm9CmNHfDH0i0uNlWweXSO9s0Phl8jmQ=; b=G8KOGDNC2GPE4Oe5Ed8Rz72LIR+1xnWFJDYRi3KffyMW5Uej193i1DILprSIsLRvtF 33bKUVpd11am5xY2IIuYjTJDKLQk5al9/4vUWT+XEwbQE7NQZY6IakIIoSz51pwsZJ1D 60IJYAkNADXmII+Qw22z+bjiyX0/vzorJegrlqF7AyitpEB+7PRufL4cySZcxzf/JRej QEHGfpkcJ8NLiQxrVgMG6uS1KtjhTBo6oO7BrdE+cKHJj6ps7QCL9FSoVWNjtNl1AY1s Yf83fDi2kiiLHg0W6lfxNVBcp26Az8Q+LjHZGtTJKvC9oNesLQKMWQJfFrzswXNaAAMU dCrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700492011; x=1701096811; h=content-transfer-encoding:in-reply-to:autocrypt: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=ET7XZBuYSIsGm9CmNHfDH0i0uNlWweXSO9s0Phl8jmQ=; b=ZWQ2ymMmeGeqr5drJw6BaeXafcV6nveJTrTmkMsJtLGkBjTQxTdUsETod2j0R7paHv pjip67cEqzzg4BYgZVMISNOQX7Zi+HcWHpfOhQB0/igMhGJiKv9pDepJoJxeONKaszA6 WtfPmOQX5Q/kIjk/gV4Us9/06HqzxjUX6ZtOt94DZKoqkOJx9eG80xH66nFesAN8/CVi iOn9aUER8MOxiH2axBuxsN+v7XS5/noEDEqPjSBqExfXNU//ZMg7pXXRlGYlLSjf3KgF Pw3kNoejs7ADZfKRxp2v6jnckMt3WtE0gr2ADGkztFXlndFc3qsnD0uqbq2DVRXvz2iH 9Cnw== X-Gm-Message-State: AOJu0YyEHikOwoHg3do6ohBBt9/sqsuKAmluE9deGOJQpnkifn1mtODA AuB9jQYTjcFHWLKqgxMFjtxilA== X-Received: by 2002:aa7:c588:0:b0:548:e8aa:dfc8 with SMTP id g8-20020aa7c588000000b00548e8aadfc8mr291110edq.32.1700492011605; Mon, 20 Nov 2023 06:53:31 -0800 (PST) Received: from [192.168.1.20] ([178.197.222.11]) by smtp.gmail.com with ESMTPSA id q3-20020aa7cc03000000b0054847e78203sm3387002edt.29.2023.11.20.06.53.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Nov 2023 06:53:31 -0800 (PST) Message-ID: <76fa8f61-fe31-4040-a38d-cc05be3f4f17@linaro.org> Date: Mon, 20 Nov 2023 15:53:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] docs: dt-bindings: add DTS Coding Style document Content-Language: en-US To: Michal Simek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Cc: Andrew Davis , Arnd Bergmann , Bjorn Andersson , Geert Uytterhoeven , Heiko Stuebner , Konrad Dybcio , Neil Armstrong , Nishanth Menon , Olof Johansson , linux-rockchip@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org References: <20231120084044.23838-1-krzysztof.kozlowski@linaro.org> <19358871-009d-4498-9c13-90d5338b1e9f@amd.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzTRLcnp5c3p0b2Yg S296bG93c2tpIDxrcnp5c3p0b2Yua296bG93c2tpQGxpbmFyby5vcmc+wsGUBBMBCgA+FiEE m9B+DgxR+NWWd7dUG5NDfTtBYpsFAmI+BxMCGwMFCRRfreEFCwkIBwIGFQoJCAsCBBYCAwEC HgECF4AACgkQG5NDf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F0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <19358871-009d-4498-9c13-90d5338b1e9f@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:54:46 -0800 (PST) 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 >> Cc: AngeloGioacchino Del Regno >> Cc: Arnd Bergmann >> Cc: Bjorn Andersson >> Cc: Geert Uytterhoeven >> Cc: Heiko Stuebner >> Cc: Konrad Dybcio >> Cc: Matthias Brugger >> Cc: Michal Simek >> Cc: Neil Armstrong >> Cc: Nishanth Menon >> Cc: Olof Johansson >> Signed-off-by: Krzysztof Kozlowski >> >> --- >> >> 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@lists.infradead.org >> Cc: linux-mediatek@lists.infradead.org >> Cc: linux-samsung-soc@vger.kernel.org >> Cc: linux-amlogic@lists.infradead.org >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: linux-arm-msm@vger.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. > > >> + >> +2. Labels are allowed to use only: >> + >> + * lowercase characters: [a-z] >> + * digits: [0-9] >> + * underscore: _ > > based on dt spec uppercase is also valid char in label. Which we do not want in the DTS. > > >> + >> +3. Unit addresses should use lowercase hex, without leading zeros (padding). >> + >> +4. Hex values in properties, e.g. "reg", should use lowercase hex. The address >> + part can be padded with leading zeros. >> + >> +Example:: >> + >> + gpi_dma2: dma-controller@800000 { >> + compatible = "qcom,sm8550-gpi-dma", "qcom,sm6350-gpi-dma"; >> + reg = <0x0 0x00800000 0x0 0x60000>; > > Is 0x0 recommended or 0 is enough? I don't want to impose any rule on that, because someone would like to argue that hex should be also in SPI chip-select reg. > >> + } >> + >> +Order of Nodes >> +-------------- >> + >> +1. Nodes within any bus, thus using unit addresses for children, shall be >> + ordered incrementally by unit address. >> + Alternatively for some sub-architectures, nodes of the same type can be >> + grouped together (e.g. all I2C controllers one after another even if this >> + breaks unit address ordering). >> + >> +2. Nodes without unit addresses should be ordered alpha-numerically by the node >> + name. For a few types of nodes, they can be ordered by the main property >> + (e.g. pin configuration states ordered by value of "pins" property). >> + >> +3. When extending nodes in the board DTS via &label, the entries should be >> + ordered alpha-numerically. >> + >> +Example:: >> + >> + // SoC DTSI > > Same comment about /* */ as was mentioned in another thread. > >> + >> + / { >> + cpus { >> + // ... >> + }; >> + >> + psci { >> + // ... >> + }; >> + >> + soc@ { >> + dma: dma-controller@10000 { >> + // ... >> + }; >> + >> + clk: clock-controller@80000 { >> + // ... >> + }; >> + }; >> + }; >> + >> + // Board DTS >> + >> + &clk { >> + // ... >> + }; >> + >> + &dma { >> + // ... >> + }; >> + >> + >> +Order of Properties in Device Node >> +---------------------------------- >> + >> +Following order of properties in device nodes is preferred: >> + >> +1. compatible >> +2. reg >> +3. ranges >> +4. Standard/common properties (defined by common bindings, e.g. without >> + vendor-prefixes) >> +5. Vendor-specific properties >> +6. status (if applicable) >> +7. Child nodes, where each node is preceded with a blank line > > Isn't the order already defined in DT spec in 2.3 in chapters? Where is it defined as this is preferred order? > compatible > model > status > #address/size cells > reg > virtual-reg > ranges > dma-ranges > dma-coherent > dma-non-coherent > > Again I am fine with whatever order but I think we should reflect it in the spec Spec is not a coding style. > too. Especially status property is for my taste too low simply because you start > to read and then you will find that IP is disabled. Which is exactly what you want. status is irrelevant for hardware description, so should be the last item. > > And are you describing all properties starting with # as standard properties? Yes. > > >> + >> +The "status" property is by default "okay", thus it can be omitted. >> + >> +Example:: >> + >> + // SoC DTSI > > > /* */ > >> + >> + usb_1_hsphy: phy@88e3000 { >> + compatible = "qcom,sm8550-snps-eusb2-phy"; >> + reg = <0x0 0x088e3000 0x0 0x154>; >> + #phy-cells = <0>; >> + resets = <&gcc GCC_QUSB2PHY_PRIM_BCR>; >> + status = "disabled"; >> + }; >> + >> + // Board DTS >> + >> + &usb_1_hsphy { >> + clocks = <&tcsr TCSR_USB2_CLKREF_EN>; >> + clock-names = "ref"; >> + status = "okay"; >> + }; >> + >> + >> +Indentation >> +----------- >> + >> +1. Use indentation according to :ref:`codingstyle`. >> +2. For arrays spanning across lines, it is preferred to align the continued >> + entries with opening < from the first line. >> +3. Each entry in arrays with multiple cells (e.g. "reg" with two IO addresses) >> + should be enclosed in <>. >> + >> +Example:: >> + >> + thermal-sensor@c271000 { >> + compatible = "qcom,sm8550-tsens", "qcom,tsens-v2"; >> + reg = <0x0 0x0c271000 0x0 0x1000>, >> + <0x0 0x0c222000 0x0 0x1000>; >> + }; >> + >> +Organizing DTSI and DTS >> +----------------------- >> + >> +The DTSI and DTS files should be organized in a way representing the common >> +(and re-usable) parts of the hardware. Typically this means organizing DTSI >> +and DTS files into several files: >> + >> +1. DTSI with contents of the entire SoC (without nodes for hardware not present >> + on the SoC). >> +2. If applicable: DTSI with common or re-usable parts of the hardware (e.g. >> + entire System-on-Module). > > DTS/DTSI - SOMs can actually run as they are that's why it is fair to say that > there doesn't need to be DTS representing the board. I have never seen a SoM which can run without elaborate hardware-hacking (e.g. connecting multiple wires to the SoM pins). The definition of the SoM is that it is a module. Module can be re-used, just like SoC. Best regards, Krzysztof