Thread (75 messages) flat view 75 messages, 1 author, 23d ago
COLD23d

Revision v2 of 2 in this series.

Revisions (2)
  1. rfc [diff vs current]
  2. v2 current

[RFC PATCH v2 14/74] tests: Add a test related to addon dt_flags header value

From: Herve Codina <herve.codina@bootlin.com>
Date: 2026-08-26 09:51:26
Also in: lkml
Subsystem: the rest · Maintainer: Linus Torvalds

Addon dtbs leads to the dt_flags header field set to FDT_FLAG_ADDON
(0x1).

Add a specific test to check this value.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 tests/dtflags_addon.dtb.expect |  1 +
 tests/dtflags_addon.dts        | 11 +++++++++++
 tests/run_tests.sh             |  8 ++++++++
 3 files changed, 20 insertions(+)
 create mode 100644 tests/dtflags_addon.dtb.expect
 create mode 100644 tests/dtflags_addon.dts
diff --git a/tests/dtflags_addon.dtb.expect b/tests/dtflags_addon.dtb.expect
new file mode 100644
index 00000000..00f98f32
--- /dev/null
+++ b/tests/dtflags_addon.dtb.expect
@@ -0,0 +1 @@
+// dt_flags:		0x1
diff --git a/tests/dtflags_addon.dts b/tests/dtflags_addon.dts
new file mode 100644
index 00000000..d2b22951
--- /dev/null
+++ b/tests/dtflags_addon.dts
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
+/*
+ * Copyright (C) 2026 Bootlin
+ */
+
+/dts-v1/;
+/addon/;
+
+/ {
+	prop = <1>;
+};
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index f5ea02bf..734fd39a 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -926,6 +926,14 @@ dtc_tests () {
     sed -i '/dt_flags/!d' dtflags_default.dtb.out
     base_run_test check_diff dtflags_default.dtb.out "$SRCDIR/dtflags_default.dtb.expect"
     run_test check_full dtflags_default.dtb
+
+    # Tests dt_flags header field (FDT_FLAG_ADDON value)
+    run_dtc_test -I dts -O dtb -o dtflags_addon.dtb "$SRCDIR/dtflags_addon.dts"
+    base_run_test wrap_fdtdump dtflags_addon.dtb dtflags_addon.dtb.out
+    # Keep only lines containing 'dt_flags'
+    sed -i '/dt_flags/!d' dtflags_addon.dtb.out
+    base_run_test check_diff dtflags_addon.dtb.out "$SRCDIR/dtflags_addon.dtb.expect"
+    run_test check_full dtflags_addon.dtb
 }
 
 cmp_tests () {
-- 
2.55.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help