Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2275613rdb; Mon, 20 Nov 2023 06:58:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKS8nm4rpulBjPFWLcZoewVAlL7A6z0nzkIbqDnLHtE8qF0Ek5t+iPdphudufxq0SBs3nd X-Received: by 2002:a05:6a20:1584:b0:151:35ad:f331 with SMTP id h4-20020a056a20158400b0015135adf331mr10453217pzj.14.1700492319916; Mon, 20 Nov 2023 06:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700492319; cv=none; d=google.com; s=arc-20160816; b=hqBXxztO7hjJUovBH+ggbCm3Y6b/Wmh7TvdQ10lsidWFW4CiImFFHQ9KhVjJoBL3Jd 9rZkq7zgd6zpv2l+YJWwSK4QdPs8FCsqyLirr5F3Y6fK3MCW6IRbbqEprM7WY1a/KAAQ Qlt1DljdQ+DkFYjq0vvdNWCfXrhSnmy7vY5D2b5fvIGZnIf4e2TSGgZW6VKTbv3vZTsP W2y7+TtErqmqXtqSrsEhvRJHtcStG3/v1mnKI5uhQl9YgHjBor8PZLQngcvk0IfTCWH/ t3CSRekFgRSrerBRsieaeTZJZSSAYK6R1pH2z4OBaezGU7+heHwdwpAlP67gGsh/+qyv SOTQ== 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=mQdmwJggkH5N5H7bleDZIaCxHcp1ZmwZnDUsdCqchNc=; fh=X1Jn3asrhfy4bWXmkq1xT7fodqEzIzzCFhGf3tYLSms=; b=yemehzS1ctKHlZXVfMHLLfLiQqdU1k/HN6Rva0++WIQdDMFYYCVjsHzyy27o2QyoMd osCE1meRYNqAbZ7JPXNdsCLiVzPMrDAwBeVzuNfQixejdICUKd6wOCfvF/gPamPK4SF4 cFydfJyrFFOK/ooz9jnJTMI0ayp+I4qU0k8AtIFfqYo78GmrpS9grtXPiFAc116HSO0f N21JWiKn5QnXfVrTfIWCQiH3rhsVHkPZNhx1F945xag7Kwbwhd+1O6wUdP9V606uab/i BBs6eMFpXdBsbWdPxgz2pewxQEByFP+W1StxwcjhX4wkgM3Ukta4Dlisp7+MuReAzW8n auQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kyCoYEku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e6-20020a63d946000000b00585463c36fbsi8148042pgj.44.2023.11.20.06.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 06:58:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kyCoYEku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 6AFF7806CF68; Mon, 20 Nov 2023 06:57:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233238AbjKTO5Z (ORCPT + 99 others); Mon, 20 Nov 2023 09:57:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233132AbjKTO5Y (ORCPT ); Mon, 20 Nov 2023 09:57:24 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F405D10F for ; Mon, 20 Nov 2023 06:57:19 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-54366784377so6160323a12.3 for ; Mon, 20 Nov 2023 06:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700492238; x=1701097038; 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=mQdmwJggkH5N5H7bleDZIaCxHcp1ZmwZnDUsdCqchNc=; b=kyCoYEkufDTe+kFpqhgMv00qbQIJt8Tr/6F/sO2XFZEE8q15L9waF3Bd2p8AODBYDA /PYm6oljdMls8LTPeWAu2T05W20ICKgxvr1qpqoUCNWVIJR9aKJHDNkR4c559VoMiisd Zt416RVgJLUDqC13cGGbBvRE6L8pGuIwUxRJXJzC95I5CfGjXSA2mWTbRymRIcIBaIJo //XiiZjVCsW9Qsx93vNED42H1cvIlTIuMG9dQgReqmAx364U7tksBpbSf6x+itEowKhi zeShj9Wr4MtqjJ2SY8gTYduiOBoSnfBtTeDU2OwZ+J4Zvc2uKhE6sWd+LGckgWKSPDVR OTCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700492238; x=1701097038; 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=mQdmwJggkH5N5H7bleDZIaCxHcp1ZmwZnDUsdCqchNc=; b=suBlX+mSslPGQIQJQOf50n3RL0CZtvhzWzUMTbWob+mokPcXNXL1BkrmpAB+hPOTTP NoeAYfkdA14SZHXtINt/uvTsYClRLjd9anUM0qgwBJHFx5JJUEgUFPReDaXd5zSoCt0V I6UXiGhJHuh4VWzcYSWsahqM3sfmsljXOMLE8HTdf9/soD3QDZiyb9BBftCBS3JDxJNk QI8OX5zOYi56dZhqN0kvvmIFgEFx/fF7CT5CKD25ErOUz1fRd2amBA3XZjWHo1HS2Rwz 1dVHlFGqtQ44WlOgP6MWPnrOEarm6HFAjFUJ5eoL2+idmQ2n2tt53/bIrQsDB9jDT45d ygLQ== X-Gm-Message-State: AOJu0Yxt0tS/zgw8aJeyQl4PHxh5X020un5POHMcYpz0bSO4ZcXA5iqh Poz/ZnlduFxjeVNMcwdyq0MQhA== X-Received: by 2002:a17:907:6d0a:b0:9a5:b878:7336 with SMTP id sa10-20020a1709076d0a00b009a5b8787336mr6347418ejc.7.1700492238455; Mon, 20 Nov 2023 06:57:18 -0800 (PST) Received: from [192.168.1.20] ([178.197.222.11]) by smtp.gmail.com with ESMTPSA id me23-20020a170906aed700b009e5c644e34dsm3899105ejb.82.2023.11.20.06.57.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Nov 2023 06:57:17 -0800 (PST) Message-ID: Date: Mon, 20 Nov 2023 15:57:15 +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: AngeloGioacchino Del Regno , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , 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 , Michal Simek , 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> <92cf3bcc-18e7-40ba-a082-1b8b6bea0dee@collabora.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 HgECF4AACgkQG5NDfTtBYptgbhAAjAGunRoOTduBeC7V6GGOQMYIT5n3OuDSzG1oZyM4kyvO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-a082-1b8b6bea0dee@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 20 Nov 2023 06:57:33 -0800 (PST) On 20/11/2023 12:43, AngeloGioacchino Del Regno wrote: > Il 20/11/23 09:40, Krzysztof Kozlowski ha scritto: >> 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: - >> + >> +2. Labels are allowed to use only: >> + >> + * lowercase characters: [a-z] >> + * digits: [0-9] >> + * underscore: _ >> + >> +3. Unit addresses should use lowercase hex, without leading zeros (padding). > > This is imperative, so: s/should/shall/g Sure, fine. > >> + >> +4. Hex values in properties, e.g. "reg", should use lowercase hex. The address >> + part can be padded with leading zeros. >> + > > Same here, I'd say.... :-) > >> +Example:: >> + >> + gpi_dma2: dma-controller@800000 { >> + compatible = "qcom,sm8550-gpi-dma", "qcom,sm6350-gpi-dma"; >> + reg = <0x0 0x00800000 0x0 0x60000>; >> + } >> + >> +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:: >> + > > Hmm, comments! > >> + // SoC DTSI > > ....speaking of commenting, should we at least suggest to use C-style comments? > > /* SoC DTSI */ I can switch it to C-style in the example, but we are going with Linux Coding Style which soon will allow // judging by Linus' statements. > >> + >> + / { >> + 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 >> + >> +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"; >> + }; > > Since this describes vendor-specific properties and vendor prefixes as well > as standard properties, I think it would be clearer if we use something more > complex that actually contains those as an example. > > There's a few. One is MediaTek: > > vdo1_rdma0: dma-controller@1c104000 { > compatible = "mediatek,mt8195-vdo1-rdma"; > reg = <0 0x1c104000 0 0x1000>; > #dma-cells = <1>; > clocks = <&vdosys1 CLK_VDO1_MDP_RDMA0>; > interrupts = ; > iommus = <&iommu_vdo M4U_PORT_L2_MDP_RDMA0>; > power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; > mediatek,gce-client-reg = <&gce0 SUBSYS_1c10XXXX 0x4000 0x1000>; > }; > > ...or other one can be nVidia: > > mipi: mipi@700e3000 { > compatible = "nvidia,tegra210-mipi"; > reg = <0x0 0x700e3000 0x0 0x100>; > clocks = <&tegra_car TEGRA210_CLK_MIPI_CAL>; > clock-names = "mipi-cal"; > power-domains = <&pd_sor>; > #nvidia,mipi-calibrate-cells = <1>; > }; > > ...or we could make an example out of fantasy, which could work even better > as far as describing goes. > > /* SoC DTSI */ > > device_node: device-class@6789abc { > compatible = "vendor,device"; Yep. I'll use this, unless checkpatch complains about undocumented compatible. :) This allows to show the child node. > reg = <0 0x06789abc 0 0xa123>; > ranges = <0 0 0x6789abc 0x1000>; > #dma-cells = <1>; > clocks = <&clock_controller SOC_CLOCK>; > clock-names = "dev-clk"; > #vendor,custom-cells = <2>; > status = "disabled"; > > child_node: child-class@100 { > reg = <0x100 0x200>; > /* ... */ > }; > }; > > /* Board DTS */ > > &device_node { > device-supply = <&board_vreg1>; > status = "okay"; > } > >> + >> + // 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 > > ^^^^ > There's a double space here, it was probably unintentional. I think I used everywhere double-spaces. At least this was my intention, so I will fix single-spaces :) Best regards, Krzysztof