mirror of
https://github.com/ivoszbg/uniLoader.git
synced 2026-08-15 05:18:32 +00:00
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:
@@ -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_
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user