From patchwork Thu Dec 28 11:57:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 758588 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp3969864wrw; Thu, 28 Dec 2023 03:58:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRoV3PEhdGSnwxapHtOtRuof9/uCxx9MeHB5jgLHgiENhm8IjISob5kWm/jKdQ0oO9Kjyn X-Received: by 2002:a05:600c:4511:b0:40d:60ac:65ac with SMTP id t17-20020a05600c451100b0040d60ac65acmr923303wmo.62.1703764717538; Thu, 28 Dec 2023 03:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703764717; cv=none; d=google.com; s=arc-20160816; b=0iDCk/GKDwUvERhYZ7/2jRF1CnH1ua6Htie5fjylJPjBBLssMTQ0t2Pfc2EqN/oDf4 gInCGycz495k9u9SB8+BuWxHgXIfKsfsVCjVrlLG4nLXtSmIuKC2qgIao9FQ4C8txMOJ 2Kn0QVFe9JHA0X3qsteRO6PVQ/e2bleEF6qJIHQ+DrtnypA2OsxfisGPRzHjBnjEAF66 mpszw2vzDmkdwl7RYDHaCOlJ+NAc63rJY80U3uytC/dDVxy3GzAVAd+/vxMWSbX/mvng 0422hNQLpycFLD5WndKes4RlegF6fk2rS8OToWUmmfuYB1op2wBKJZ95Nvwqt4iOJB5x Eirg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=GxMXClwD9vUmpuV83YCdcBGWcfgC711sy1kH6OqMoaM=; fh=LuHobO/PNlphnzT1n7Wd/yJxuMleLEX8L6cMH6/BHvI=; b=inzqN6ZXTKgR+zg0rRimlW32tBtnpCLMSlFGZSBirJrl7VhU4EHqaoJbJNkH6IHrgC txwJJ7H+m/5zlrdjNxB47CBq43De3JJHCy15loyztE5ceICpQz1C6ntPjSFNrw+6pQsH t2yT2Vm2LrSRZA7t2A4N0OhrXmYq+LDrEkmYOzwvVMiNzYxbiuN3JggNMp1ydNTtrGUi wCBkBdgO1+1REkPKuIg/yuSz5KKlSDgJVpy7a+UIgPSghLgK0wNVp5gavRmGRNg082nv 6Zj+6Zmg0filv49NNTdZixTyYQ6PkF4YPJ9/G+lLfLJNEBPv/a9tRiJPDsEUOgcqClZ8 TShQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P6jn3UK1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id i13-20020adfefcd000000b003370e1b67b1si566416wrp.649.2023.12.28.03.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 03:58:37 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P6jn3UK1; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 34814879F0; Thu, 28 Dec 2023 12:58:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="P6jn3UK1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8240D879F0; Thu, 28 Dec 2023 12:58:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F4214879F6 for ; Thu, 28 Dec 2023 12:58:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sumit.garg@linaro.org Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1d420aaa2abso18230985ad.3 for ; Thu, 28 Dec 2023 03:58:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703764707; x=1704369507; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GxMXClwD9vUmpuV83YCdcBGWcfgC711sy1kH6OqMoaM=; b=P6jn3UK1zI+8fSd6SBwFpiP4msxoU33/maoHS2Nzwg3Q7TWlurM2Kb92bjIoPRm68M JI0GYtWmBoeAAoXGUgFp7zwsF9T+sfV161JgZyJoExAbVYBI58UmdbVg4pdMDnc6+tTd CT0VUmEibswRrhKYFgbaDu6IaSvhzP4kpY7dIfLDk2sReb8O6pNJOiG3ouex4NYhGnpv 6+ZVJxk0iLAzV9jgHYlRWbYm22fMXaVEjuBIgWGap7NFh0hXgpntHhmgTsLj0+ePQQLn utOBzdGb8+UBNXj4Rh3TuxE6JWf5jQsETTXZdNIgzIBmNVezNeaOkp+F/UTBqyITq6l+ nhKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703764707; x=1704369507; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GxMXClwD9vUmpuV83YCdcBGWcfgC711sy1kH6OqMoaM=; b=kMzpKeDYXrFez4EODL+JWJMW7+idFHM5R6rsJddEbl8+BPrhZ5muLyt84tVfnP85dE 7opgMNU6RLQZkTK00dE9TCMpApbjVTrgPS0Ga+9BrniTrhkXQ89wxQCs0ozSMjq28e1L UFklRScyBbGxuJuAxiUegXRIssLnv7DuRFL7mw7TBsqHm6Suyxmq/iAX7ZYfPoKwMfDr kT4WemGw+EVCwSPjxU9JM0EF3ZmTSdDWK8fk3RWuuq1kVYH9Ypk2g3YXiLSyEIJOR6SD 0muqQIzbeQoSn3/1j4xA1dlji31RYKdcAUY+u+v+YDE1Gb/YX3OfskVBQLAeXXssWQ5N y6Jg== X-Gm-Message-State: AOJu0Yxeo7vEFc0wX5qLs1Vqo0mzpDGKd4YMJq7UfVOqV0j6rsnITr/w iBEo1WeN6k4hQKLF51wRm1co+Qzks/t+5ty1DigkbMO0Uk4N9Q== X-Received: by 2002:a17:902:f689:b0:1d4:87c8:1cfa with SMTP id l9-20020a170902f68900b001d487c81cfamr1465825plg.35.1703764707076; Thu, 28 Dec 2023 03:58:27 -0800 (PST) Received: from sumit-X1.. ([223.178.209.202]) by smtp.gmail.com with ESMTPSA id r4-20020a170902ea4400b001d3f285157dsm13700579plg.124.2023.12.28.03.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 03:58:26 -0800 (PST) From: Sumit Garg To: u-boot@lists.denx.de, u-boot-amlogic@groups.io, u-boot-custodians@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor@kernel.org, neil.armstrong@linaro.org, caleb.connolly@linaro.org, ff@shokubai.tech, daniel.thompson@linaro.org, dgilmore@fedoraproject.org, pbrobinson@gmail.com, ilias.apalodimas@linaro.org, maxim.uvarov@linaro.org, b.galvani@gmail.com, xypron.glpk@gmx.de, michal.simek@amd.com, seanga2@gmail.com, rasmus.villemoes@prevas.dk, peng.fan@nxp.com, jh80.chung@samsung.com, rfried.dev@gmail.com, marex@denx.de, mibodhi@gmail.com, Sumit Garg Subject: [PATCH v3 0/8] An effort to bring DT bindings compliance within U-Boot Date: Thu, 28 Dec 2023 17:27:56 +0530 Message-Id: <20231228115804.3626579-1-sumit.garg@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Changes in v3: -------------- - Patch #4: Minor commit message update - Patch #5: Replace CONFIG_* with Kconfig options - Patch #7: Dropped Makefile portion and enabled OF_UPSTREAM for SoC instead. - Patch #1, #3, #6 and #8: Picked up review tags Changes in v2: -------------- - Patch #1: excluded gitab CI config check and added commit description. - Patch #3: s/UBOOT_DTSI_LOC/u_boot_dtsi_loc/ - Patch #4: s/DEVICE_TREE_LOC/dt_dir/ and s/U-boot/U-Boot/ - Patch #5: s/U-boot/U-Boot/ - Patch #6 and #7: Picked up review tags Prerequisite ------------ This patch series requires devicetree-rebasing git repo to be added as a subtree to the main U-Boot repo via: $ git subtree add --prefix devicetree-rebasing \ git://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git \ v6.6-dts --squash Background ---------- This effort started while I was reviewing patch series corresponding to Qcom platforms [1] which was about to import modified devicetree source files from Linux kernel. I suppose keeping devicetree files sync with Linux kernel without any DT bindings schema validation has been a pain for U-Boot SoC/platform maintainers. There has been past discussions about a single DT repo but that hasn't come up and Linux kernel remained the place where DT source files as well as bindings are placed and maintained. However, Linux kernel DT maintainers proposed [2] for U-Boot to rather use devicetree-rebasing repo [3] which is a forked copy from Linux kernel for DT source files as well as bindings. It is tagged at every Linux kernel major release or intermideate release candidates. So here I have tried to reuse that to bring DT bingings compliance as well as a standard way to maintain a regular sync of DT source files with Linux kernel. In order to maintain devicetree files sync, U-Boot will maintains a Git subtree for devicetee-rebasing repo as `devicetee-rebasing/` sub-directory. It will be regularly updated with every new kernel major release via subtree pull as follows: $ git subtree pull --prefix devicetree-rebasing \ git://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git \ --squash The RFC/prototype for this series has been discussed with Linux DT maintainers as well as U-Boot maintainers here [4]. Now we would like to reach out to wider U-Boot community to seek feedback. [1] https://lore.kernel.org/all/CAFA6WYMLUD9cnkr=R0Uur+1UeTMkKjM2zDdMJtXb3nmrLk+pDg@mail.gmail.com/ [2] https://lore.kernel.org/all/CAL_JsqKEjv2tSGmT+0ZiO7_qbBfhTycbGnhJhYpKDFzfO9jzDg@mail.gmail.com/ [3] https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/ [4] https://github.com/u-boot/u-boot/pull/451 Changes ------- Traditionally, U-Boot placed copies of devicetree source files from Linux kernel into `arch//dts/.dts`, which can be selected via: CONFIG_DEFAULT_DEVICE_TREE "" SoC/board maintainers are encouraged to migrate to using mirrored copies from `devicetree-rebasing/` into `dts/arch//` via: CONFIG_OF_UPSTREAM=y CONFIG_DEFAULT_DEVICE_TREE "/" An example have been shown for Amlogic meson-gxbb SoC and corresponding derived boards via patch #7 and #8. Devicetree bindings schema checks --------------------------------- With devicetee-rebasing Git subtree, the devicetree bindings are also regularly synced with Linux kernel as `devicetree-rebasing/Bindings/` sub-directory. This allows U-Boot to run devicetree bindings schema checks which will bring compliance to U-Boot core/drivers regarding usage of devicetree. Dependencies ------------ The DT schema project must be installed in order to validate the DT schema binding documents and validate DTS files using the DT schema. The DT schema project can be installed with pip: $ pip3 install dtschema Note that 'dtschema' installation requires 'swig' and Python development files installed first. On Debian/Ubuntu systems: $ apt install swig python3-dev Several executables (dt-doc-validate, dt-mk-schema, dt-validate) will be installed. Ensure they are in your PATH (~/.local/bin by default). Recommended is also to install yamllint (used by dtschema when present). Running checks -------------- In order to perform validation of DTB files, use the ``dtbs_check`` target: $ make dtbs_check It is also possible to run checks with a subset of matching schema files by setting the ``DT_SCHEMA_FILES`` variable to 1 or more specific schema files or patterns (partial match of a fixed string). Each file or pattern should be separated by ':'. $ make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml:rtc.yaml $ make dtbs_check DT_SCHEMA_FILES=/gpio/ $ make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml Sumit Garg (8): CI: Exclude devicetree-rebasing subtree for CONFIG checks Makefile: Add support for DT bindings schema checks scripts/Makefile.lib: Statically define *-u-boot.dtsi files location dts: Add alternative location for upstream DTB builds doc: devicetree: Updates for devicetree-rebasing subtree MAINTAINERS: Add myself as devicetree-rebasing maintainer dts: meson-gxbb: Switch to using upstream DT dts: meson-gxbb: Drop redundant devicetree files .azure-pipelines.yml | 3 +- .gitlab-ci.yml | 3 +- MAINTAINERS | 6 + Makefile | 20 +- arch/arm/dts/Makefile | 8 - arch/arm/dts/meson-gxbb-kii-pro.dts | 140 ---- arch/arm/dts/meson-gxbb-nanopi-k2.dts | 415 ------------ arch/arm/dts/meson-gxbb-odroidc2.dts | 418 ------------ arch/arm/dts/meson-gxbb-p200.dts | 100 --- arch/arm/dts/meson-gxbb-p201.dts | 26 - arch/arm/dts/meson-gxbb-p20x.dtsi | 250 ------- arch/arm/dts/meson-gxbb-wetek-hub.dts | 58 -- arch/arm/dts/meson-gxbb-wetek-play2.dts | 119 ---- arch/arm/dts/meson-gxbb-wetek.dtsi | 292 -------- arch/arm/dts/meson-gxbb.dtsi | 856 ------------------------ arch/arm/mach-meson/Kconfig | 1 + configs/nanopi-k2_defconfig | 2 +- configs/odroid-c2_defconfig | 2 +- configs/p200_defconfig | 2 +- configs/p201_defconfig | 2 +- configs/videostrong-kii-pro_defconfig | 2 +- configs/wetek-hub_defconfig | 2 +- configs/wetek-play2_defconfig | 2 +- doc/develop/devicetree/control.rst | 131 +++- dts/Kconfig | 11 + dts/Makefile | 17 +- dts/arch/arm64/Makefile | 14 + dts/arch/arm64/amlogic | 1 + scripts/Makefile.lib | 42 +- 29 files changed, 201 insertions(+), 2744 deletions(-) delete mode 100644 arch/arm/dts/meson-gxbb-kii-pro.dts delete mode 100644 arch/arm/dts/meson-gxbb-nanopi-k2.dts delete mode 100644 arch/arm/dts/meson-gxbb-odroidc2.dts delete mode 100644 arch/arm/dts/meson-gxbb-p200.dts delete mode 100644 arch/arm/dts/meson-gxbb-p201.dts delete mode 100644 arch/arm/dts/meson-gxbb-p20x.dtsi delete mode 100644 arch/arm/dts/meson-gxbb-wetek-hub.dts delete mode 100644 arch/arm/dts/meson-gxbb-wetek-play2.dts delete mode 100644 arch/arm/dts/meson-gxbb-wetek.dtsi delete mode 100644 arch/arm/dts/meson-gxbb.dtsi create mode 100644 dts/arch/arm64/Makefile create mode 120000 dts/arch/arm64/amlogic