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
2026-05-14 18:33:56 +01:00
committed by Igor Bełwon
parent 3e61800372
commit 6ae4e8084f
3 changed files with 5 additions and 5 deletions

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_

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;
}

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");