From patchwork Tue Aug 19 19:39:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 32 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=1755632424; bh=vV1+vkJd3iQKjByHJfAWHw8ySoiUmvVcgmVc40EKp3s=; 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=KB8zm/FRfSjS9hYY8XWJ3jbxMFJrxU9YWFKvz19fqJDqhFex3NzheRtgHPHGHktg+ hUA0tMVUM8rrdwXTWw4xwbd/PZD6VOQB9wKEJAgoh0PEyqy6BznM1YBlAestMw1/C2 C97dd4mVv6th08Do8Wn17izl/08eccQlUqjzLGH332L56oZ/bJ1WqNr0L07u7fKB5n zC5DIdHXV33AHwuPOlLiEP45wz4whf/msD1WUgTiU3gWTW6HijvZxayhagn/QZdtcj 5g9KvQUzY+g7tuzVTjgiSZeOpqp7Sv5X8NNdPyPv+Ep6eumhnpYV1jmijupgyIHJim alg9OXLMJW6gw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E4C73675F4 for ; Tue, 19 Aug 2025 13:40:24 -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 pTdklXrm6V6A for ; Tue, 19 Aug 2025 13:40:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755632424; bh=vV1+vkJd3iQKjByHJfAWHw8ySoiUmvVcgmVc40EKp3s=; 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=KB8zm/FRfSjS9hYY8XWJ3jbxMFJrxU9YWFKvz19fqJDqhFex3NzheRtgHPHGHktg+ hUA0tMVUM8rrdwXTWw4xwbd/PZD6VOQB9wKEJAgoh0PEyqy6BznM1YBlAestMw1/C2 C97dd4mVv6th08Do8Wn17izl/08eccQlUqjzLGH332L56oZ/bJ1WqNr0L07u7fKB5n zC5DIdHXV33AHwuPOlLiEP45wz4whf/msD1WUgTiU3gWTW6HijvZxayhagn/QZdtcj 5g9KvQUzY+g7tuzVTjgiSZeOpqp7Sv5X8NNdPyPv+Ep6eumhnpYV1jmijupgyIHJim alg9OXLMJW6gw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6F1B467608 for ; Tue, 19 Aug 2025 13:40:24 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755632421; bh=6nmnjaCtmTdtBzWnL9ziR0shbPQz7S5w/XNpnKgoZ+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lhd8WKmnfdsiNqQA8aNlcFXbSZpBmYWxxD4lG+k2Za5P+dN3vVYemG/zo2Xqboev3 Bgjw8CAjz+8t1tkRuHsBvdysxln1HYgkeOOghFeNcYGSIYXJKQ9xJx3P6x9MxdoovR tsR7LqA42lX8AcESWcAhTD7EMYlcvBKpRyR42KizWFtwNEtJir3pxF18KHo5iHrrYw PQceY194r/CiaNmRqPj+S7tByuN9QExSEnvhhTkRCvaSh0QmmEIb5z26Q8mW5L//OO 3bczGz7bmavBIr2Wa9Fqzk2bqE4JRDDsVUy3Z3Zk7ab2mT8nnw9wvzLx52zb9lSG/X a3EUBjWTMUsaQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E0AE567608; Tue, 19 Aug 2025 13:40:21 -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 kHegQHBBn12E; Tue, 19 Aug 2025 13:40:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1755632421; bh=hclzkzHoIPhX0pgjD9JNMFmpGJWVxj2sKXOf493AfR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ih9ki7zEBzrhyYIhONuXP0FJLFm1Uesw+inKgI0mD+Osu3lupyHBj8rZSDaumdEbD vACF8E19X0nhnY6OtpxdO1dgyIFMyA0x7eiaCl3XmIOy34zxOe7XSgMb/wqM5q+Xj8 o9rgmT2Ahs+q+4kH8KorJizDgkFkoLZ62mcacFTv4u4Ei7Q+IXzlN6eTLuywQkrcHg ZYB1JNeUJUvEkLnNa4cvAOogpGqL1WTRTmrhWHfy8HTVPXKvOCLcOgo/2/oIe5/Xox 4N8D3IznnwrETjeeykX1PPorRcWo4tt5gAjz66PCo/DJ+j+AyvYt9I+dbpmAvo6KS9 raVcUNlEQLQcw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 622F95E436; Tue, 19 Aug 2025 13:40:21 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 19 Aug 2025 13:39:05 -0600 Message-ID: <20250819193918.874215-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250819193918.874215-1-sjg@u-boot.org> References: <20250819193918.874215-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JWKDN3NXQ7ICK3PX7XCQUPPW764VZBZZ X-Message-ID-Hash: JWKDN3NXQ7ICK3PX7XCQUPPW764VZBZZ 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 09/15] dtoc: Add a test for the fdt_util.EnsureCompiled with indir 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 Provide a test which covers this feature of the EnsureCompiled() function. Signed-off-by: Simon Glass --- tools/dtoc/test/dtoc_test_inc.dts | 14 ++++++++++++++ tools/dtoc/test/test-include.dtsi | 5 +++++ tools/dtoc/test_fdt.py | 10 ++++++++++ 3 files changed, 29 insertions(+) create mode 100644 tools/dtoc/test/dtoc_test_inc.dts create mode 100644 tools/dtoc/test/test-include.dtsi diff --git a/tools/dtoc/test/dtoc_test_inc.dts b/tools/dtoc/test/dtoc_test_inc.dts new file mode 100644 index 00000000000..bf87fffb8fc --- /dev/null +++ b/tools/dtoc/test/dtoc_test_inc.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Test device tree file for dtoc + * + * Copyright 2017 Google, Inc + */ + +/dts-v1/; + +/ { +}; + +/include/ "test-include.dtsi" +#include "test-include.dtsi" diff --git a/tools/dtoc/test/test-include.dtsi b/tools/dtoc/test/test-include.dtsi new file mode 100644 index 00000000000..45b9da6dd0a --- /dev/null +++ b/tools/dtoc/test/test-include.dtsi @@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0+ +/ { + #address-cells = <1>; + #size-cells = <1>; +}; diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index a0bed4e18bb..d66b7eb0f98 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -932,6 +932,16 @@ class TestFdtUtil(unittest.TestCase): finally: tools.outdir = old_outdir + def test_ensure_compiled_indir(self): + """Test compiling with input directories specified""" + tmpdir = tempfile.mkdtemp(prefix='test_fdt.') + dest = os.path.join(tmpdir, 'try.dts') + shutil.copy(find_dtb_file('dtoc_test_inc.dts'), dest) + + dtb = fdt_util.EnsureCompiled(dest, indir=['tools/dtoc/test']) + self.assertEqual(dtb, fdt_util.EnsureCompiled(dtb)) + shutil.rmtree(tmpdir) + def test_get_phandle_name_offset(self): val = fdt_util.GetPhandleNameOffset(self.node, 'missing') self.assertIsNone(val)