main: Pass address of address of DTB to patch_dtb

Pass the address of the address of the DTB to patch_dtb in boot.c, rather than just the address to the DTB.
This allows the modified DTB address to overwrite the address of the original DTB, fixing a bug where
the ramdisk address was not being passed to the kernel via the DTB successfully.
This commit is contained in:
Aiden Isik authored and Igor Bełwon committed 2026-05-14 21:03:32 +02:00
1 parent 3e61800372
commit 6ae4e8084f
3 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -6,6 +6,6 @@
#ifndef BOOT_FDT_H_
#define BOOT_FDT_H_
void patch_dtb(void* dt);
void patch_dtb(void** dt);
#endif // BOOT_FDT_H_
+3 -3
View File
@@ -8,13 +8,13 @@
static char fdt_buf[CONFIG_FDT_BUF_SIZE];
void patch_dtb(void* dt)
void patch_dtb(void** dt)
{
int ret;
ret = ramdisk_handler_patch_dtb(dt, &fdt_buf, sizeof(fdt_buf));
ret = ramdisk_handler_patch_dtb(*dt, &fdt_buf, sizeof(fdt_buf));
if (ret != 0)
printk(KERN_ERR, "failed to patch dtb\n");
else
dt = &fdt_buf;
*dt = &fdt_buf;
}
+1 -1
View File
@@ -12,7 +12,7 @@
void boot_kernel(void* dt, void* kernel, void* ramdisk)
{
#ifdef CONFIG_LIBFDT
patch_dtb(dt);
patch_dtb(&dt);
#endif
printk(KERN_INFO, "Booting kernel...\n");