From patchwork Wed Sep 3 13:36:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 209 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906678; bh=nvM5LyTNPxDpW/verkDr3FVrE+Lnn1+ULhvL7xUY9qM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=BEuG5bDQsVhOJiyJlocl4c0OWmqU1Ic9Y52+sRAtV3B09rqjfWYUcrlWfDjvYnif+ 1cLGQp3xesjc4CQ8IKou5YqfE880sl0Ae3In7rpCbKNPnXtZUVH2iGjONLeBte95LK acC5FHMoNdQxo8IDA+l9CuDgfAhjiCIIrUkrZeQ2pXf91Vybzz2VOmIJBUODVDLLdG KIavtIPsdjxEruLu0nyUCngNYc1XrfeJPXDheE/SQBhRUj/P0vPQdpfzJ5o0UfWOwS 0sySiJ6XP/4ZmCYv1NQtDymOV3lNt2Bkg37JYrMbenqZ9sTP3fC93H9YM6nopJ2jsA pQUIZ8rZqxA/w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 084EC6774F for ; Wed, 3 Sep 2025 07:37:58 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Y3xx7e9EH7iu for ; Wed, 3 Sep 2025 07:37:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906677; bh=nvM5LyTNPxDpW/verkDr3FVrE+Lnn1+ULhvL7xUY9qM=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=pIl2qJat7nTqq+g8tK8WGcxH7bxad3QpLliMIrGKrX4AVukOZHXABg4TkxQ418Y3M HXNg6EbmiI/IP69QUP/71m9ytNwqKTY3ffI3Nz15cInCs8WMP+ZCKaUeFrODA4nzBT 91svmdXiaymz5wcq3LZ3D2VPi5lAqj6gyuldwnh91KmQxW/0Q+OWYl0bPdcmmv60Bv jp5hxuoHtOO2YlCd/CPCsLDiLKxmGbSqKElXcOTniI1bs6KDfl6Phq3szs9aY4wVN6 htASxt7dhlEADx05T+bueDZDjZeGxQSZPTpDFGW1yo/HwoK8ybC71D2py8+95oTOEs MOVV262KGgp8w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EC99E67915 for ; Wed, 3 Sep 2025 07:37:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906675; bh=NNWuYw/MDJEt7PpR5jZ9WiZNPHHG/WV0nF8vvawbnxk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HIIxmoAHVErR2F4t1i321DBGWDonyruVSUefKY2nN+Yc3i0PCGmduT5lTRvOAnuB8 nVdXRvv9f6/eDYjjeJFdCZL3o+5VeciiarPZ+iCVlmRAwA3tO5ZjrX7aZsvUx9/Ezb FicNjEZUniv5xrz+rEikoRej3Jgw8BdVP7eGj/kCUMXuT+hwnfQ5FbBe7g4mgf8GZ+ Rh7EoVZDbCYy41uWvxVxZIEys7+soVtknFQOvD794JtNtbF0HjOYFMdOFcR/0Vwn2d CcnnHE+/edvSpEBMddDBfEKfpSuIIkAILdZ3NoRsyBtgxt7nrk+rV9NuxXOoB4+fpX KIL5TdqudOVbg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F04205FCF5; Wed, 3 Sep 2025 07:37:55 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id cSgXoFwXkAhS; Wed, 3 Sep 2025 07:37:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756906672; bh=nq1SAczu8VLO2HTqbV36F2BoAjMNowv/riWkrrS1bgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=urwFb/PFc+kKhgokGb8DhWWKxulAaHnONvXgCyf01i/4xkrlDVXlnBx2HBrkoR+FK Ty/Hwy7zRIY6qrUj/xususFukhxC0zDS9zck6elz3MLKX79PA3QAeOwP/svdwdq17X xoK7/tZNUvmSNlJrzMEycKBCnEtgCBAI3JvUCGaLYajVhqy8aBy/GCZ/7aNj9XGWb3 A7nmYUpolmT2//D5TMNz2hE8g0NX7fSrfy+hxDPQzBeKQD0e7jEakxwKbg8LEi5FQJ MHvEBSVT+TaXZ+QA364LNRAv0p9Jf607/T+NXkROVX4hHiNyx/R/kVIBVufzL1RX5k Bva3d6pVQwN3w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BDAFB67819; Wed, 3 Sep 2025 07:37:51 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 3 Sep 2025 07:36:22 -0600 Message-ID: <20250903133639.3235920-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250903133639.3235920-1-sjg@u-boot.org> References: <20250903133639.3235920-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PR4XGFJT5V4IRHZIU3P6MD2OMAG4L7Z4 X-Message-ID-Hash: PR4XGFJT5V4IRHZIU3P6MD2OMAG4L7Z4 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 22/25] Makefile: Integrate CHID files into the build List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass When CONFIG_CHID is enabled, U-Boot must have access to a set of CHIDs which it can use to identfy the hardware it is running on. Add support for reading a hwids/compatible.hwidmap file in the board directory and including the information in the board's devicetree. This works by running the hwids_to_dtsi.py.py script and putting the result in the dtsi_include_list variable. Signed-off-by: Simon Glass --- scripts/Makefile.lib | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 6d6a21f262a..1156024a446 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -204,6 +204,21 @@ ifdef DEVICE_TREE_DEBUG u_boot_dtsi_options_debug = $(warning $(u_boot_dtsi_options_raw)) endif +# Computer Hardware Identification (CHID) +# Convert files mentioned in the compatible.hwidmap file into .dtsi includes for +# addition to the board's devicetree. +ifdef CONFIG_CHID +chid_hwids_dtsi=hwids.dtsi + +quiet_cmd_chid_dtsi_gen = CHID_DTSI_GEN $@ +cmd_chid_dtsi_gen = $(srctree)/scripts/hwids_to_dtsi.py \ + -m $(srctree)/board/$(BOARDDIR)/hwids/compatible.hwidmap -o $@ + +$(obj)/$(chid_hwids_dtsi): $(srctree)/board/$(BOARDDIR)/hwids/compatible.hwidmap \ + $(wildcard $(srctree)/board/$(BOARDDIR)/hwids/*.txt) FORCE + $(call cmd,chid_dtsi_gen) +endif + # We use the first match to be included dtsi_include_list = $(strip $(u_boot_dtsi_options_debug) \ $(notdir $(firstword $(u_boot_dtsi_options)))) @@ -429,6 +444,12 @@ quiet_cmd_dtb = $(quiet_cmd_dtc) cmd_dtb = $(cmd_dtc) endif +# Add CHID dependency to dtsi_include_list +ifdef CONFIG_CHID +dtsi_include_list += $(chid_hwids_dtsi) +dtsi_include_list_deps += $(obj)/$(chid_hwids_dtsi) +endif + $(obj)/%.dtb: $(src)/%.dts $(DTC) $(dtsi_include_list_deps) $(DT_TMP_SCHEMA) FORCE $(call if_changed_dep,dtb)