From 871e4d1551ac8c5be4339e4a3129c45014e613b5 Mon Sep 17 00:00:00 2001 From: Bradley Morgan Date: Sun, 4 Oct 2026 01:44:02 +0000 Subject: tashaboot: devicetree relocate and grow, real chosen properties Firmware edits the devicetree it hands the kernel: new properties cannot go into a packed fdt in place, the blob moves to scratch first and the blocks grow there. The insert moves the strings block up by the prop size, opens the prop slot before /chosen's end token, the new name lands at the strings end, and all four header fields track the geometry, totalsize, off_dt_ strings, size_dt_strings and size_dt_struct. The last one bounds the token walk in libfdt and a stale value there reads as BADSTRUCTURE, the kernel parsed no memory node and panicked on page table allocation before the first print. The strings block length comes from the size_dt_strings header field, not totalsize minus off_dt_strings, qemu's tree carries a hole after the strings block and the subtraction drags it along as tree. The initrd start and end land in /chosen as real properties now, the initrd= bootargs shortcut is gone. receipt: smp brought up 1 node 4 cpus, run /init, userspace, busybox shell, the initrd mounted from the chosen cells. --- include/boot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/boot.h b/include/boot.h index a28b47c..06b05d7 100644 --- a/include/boot.h +++ b/include/boot.h @@ -26,7 +26,7 @@ struct tb_image { int tb_image_setup(uintptr_t image, struct tb_image *img); /* common/load.c */ -int tb_load_raw(const char *fname, uintptr_t load_addr); +int tb_load_raw(const char *fname, uintptr_t load_addr, size_t *sizep); int tb_load_semihosting(const char *fname, uintptr_t load_addr, struct tb_image *img); -- cgit v1.2.3