Thread (59 messages) flat view 59 messages, 2 authors, 15h ago
HOTtoday

Revision v3 of 3 in this series.

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

[PATCH v3 04/15] tests/nopulate: Add a FDT_NOP before the root node

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

A FDT_NOP tag can be present at the offset 0 and so before the root
node. This is a legit case.

The nopulate tool adds FDT_NOP tag after each tag encountered but it
doesn't add a FDT_NOP tag at offset 0.

Improve nopulate to fix this lack and add a FDT_NOP tag at offset 0.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 tests/nopulate.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/tests/nopulate.c b/tests/nopulate.c
index 06f8369a..050e69fb 100644
--- a/tests/nopulate.c
+++ b/tests/nopulate.c
@@ -22,7 +22,10 @@ static int nopulate_struct(char *buf, const char *fdt)
 	uint32_t tag;
 	char *p;
 
+	/* Add a FDT_NOP before the root node (first node) */
 	p = buf;
+	*((fdt32_t *)p) = cpu_to_fdt32(FDT_NOP);
+	p += FDT_TAGSIZE;
 
 	do {
 		offset = nextoffset;
-- 
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