From patchwork Thu Dec 14 13:50:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 753921 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp757862wrr; Thu, 14 Dec 2023 05:51:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/Qm1nNZIxAlitm1cIvKYO8YjhEh1BQpQlQMUxcfakfQYIFl8qvr5axudj5+RDx/E/LWTX X-Received: by 2002:a05:6512:3a92:b0:50c:de34:da09 with SMTP id q18-20020a0565123a9200b0050cde34da09mr6070821lfu.101.1702561905026; Thu, 14 Dec 2023 05:51:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702561905; cv=none; d=google.com; s=arc-20160816; b=uScCGstd0dSBNBPamF1ANP0eyetsats92+hG++vHzVV0BSSMvaYmahB54mYCO8KNZ8 AJsnD2w/7YwiOrvWAF0SQtInVooIQoTWZokG7w2X7Kk1tCZfg8GTL01ShSOv5gh3MSwV 5mvBlZbYBZ1E6dAsjmpLwNmLo1bdQCW/cX1/mCyKEqY7RHe38J18F0/J7wF12DTMa0hK h7H3JxCuoyEeIXENBbeFRXtGewt7OAwVucI7EmQTDnOlQjpa2Ym4SNYrgzdSr67CQ0Ou mYeXCkPkexWW2PvpoSOcAJtlpBWLPX6WhDaSiwV8EvjvkCmDAmVWOjDUMYyDyZKMyDW+ LlSw== 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=iSRp992uEKRTdE3iAiCwlXXfx/j4PoIqabsWhwv1P/E=; fh=VZWdizSVWfhngo19Gt5nLjhnxzdtHBYWvcywp4ujR58=; b=ItLr75EjKyTm87CQTWJktz155rFiWG2DhNQ14lB/M8/WPY8zOcH8TmrIdkr1WgXPoC +Ora/ItGGNmGtiO6UGcPDtQTO2XhgtuArW09epzHfI8l5E+jPW8N3Wh6oIicPgoHYdPB LCHIOhxpXW3OwVMqzd0jZDQbZhXH3QfAdDCqlF0hakqutU78mUkC7/LVENOxkv3rX1gA 70e0OuwKQec9ZxfUdnkQLPwrccnu5nekq/K7KFYvk5IYxOakDcTez5D22GJTFg2FoRba 0WS10jpw5CHtZ3efpF0xtPmFuACj74KK703bAOdR/Pz4B4gU5rcOp0feByFSouLnZEmW uz7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dd1N07fP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id v4-20020ac25924000000b0050bca774abbsi4467189lfi.481.2023.12.14.05.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:51:45 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dd1N07fP; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 8783B87A21; Thu, 14 Dec 2023 14:51:43 +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="dd1N07fP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DAF3E879FB; Thu, 14 Dec 2023 14:51:41 +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-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 EE7D987A4D for ; Thu, 14 Dec 2023 14:51:37 +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-x62a.google.com with SMTP id d9443c01a7336-1d37a6926f7so436285ad.3 for ; Thu, 14 Dec 2023 05:51:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702561896; x=1703166696; 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=iSRp992uEKRTdE3iAiCwlXXfx/j4PoIqabsWhwv1P/E=; b=dd1N07fPlbAQaKQouJUOjN2/st15UDGCAhqLc+/MQFVhWy+1O+xLmYgPJvKI4m5+1t rOCLGGkyiqCkFCuM38SScSL+8IkOUL3va4f/M1RWNpRz7P4i63fgAIhD234aCsZtqgTD 46baxqmiTstCu8mqlw1ep3eRUzs8wIAEbEqCd5oTvWccJMY1yGi1JABXopuaAaDZzGMN YA+y5IjNHW6w98cV4Y1qBMpSF0e7nrqZVJyKyEnXELRZZMJ28ZN70FkKb05XEmC1KVUH 8YlvL7kJ6x/XHKkAyv2eCcPdj9Vw7zSGOA85T7AbfpbeSfRmygRZA1HtROQhgjOzt6Up 643Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702561896; x=1703166696; 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=iSRp992uEKRTdE3iAiCwlXXfx/j4PoIqabsWhwv1P/E=; b=a3lfE1JNaPktzN6saAfvUy/0fVCF4KNAGlvps51JVkmQvaks/L25FD4Y79qDyPzvAj cfxS0wf38nsfuUIDsOGOdXOEQH6AcUcpctRMd3LmjyXhohw8nPdSAHNQWLGlpJ8QACat rcI1mHxhC11EJtkNlkPMzfFq965H1ovX5fB2Iy9UB5qI9Bj/1EzaqAUTlZOxx9XTC930 OiAJ7XamxukSzh0xR5DhZXAFpLQZqZ1+QcbcUcIQtF79nl6gl5W2LO/gEfvFYYPvuOT3 V7EeTO/D9v+CdbQnBfYLCysT+TTRQ6uubxGGkxuw+aqDTL047HHB2nsrJqsu5hKhjo3I CX0g== X-Gm-Message-State: AOJu0YyVGY48TgWOOlNsPK6daHvG8MGAMg3wywCtBQ43VkpC2sqRAPKG dNgH2RrWQENwew8ms1JjEUHjoaesWNTkqove9bFdpg== X-Received: by 2002:a17:902:8d91:b0:1d0:94ed:f843 with SMTP id v17-20020a1709028d9100b001d094edf843mr4589945plo.17.1702561895902; Thu, 14 Dec 2023 05:51:35 -0800 (PST) Received: from sumit-X1.. ([223.178.213.6]) by smtp.gmail.com with ESMTPSA id j3-20020a170902c08300b001cfc68125desm12474956pld.203.2023.12.14.05.51.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:51:35 -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, Sumit Garg Subject: [PATCH 0/8] An effort to bring DT bindings compliance within U-boot Date: Thu, 14 Dec 2023 19:20:55 +0530 Message-Id: <20231214135103.1606605-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 Prerquisite ----------- 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): Azure 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 +- 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 ------------------------ configs/nanopi-k2_defconfig | 3 +- configs/odroid-c2_defconfig | 3 +- configs/p200_defconfig | 3 +- configs/p201_defconfig | 3 +- configs/videostrong-kii-pro_defconfig | 3 +- configs/wetek-hub_defconfig | 3 +- configs/wetek-play2_defconfig | 3 +- doc/develop/devicetree/control.rst | 108 ++- dts/Kconfig | 11 + dts/Makefile | 17 +- dts/arch/arm64/Makefile | 23 + dts/arch/arm64/amlogic | 1 + scripts/Makefile.lib | 42 +- 27 files changed, 204 insertions(+), 2730 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