mirror of
https://github.com/ivoszbg/uniLoader.git
synced 2026-08-15 05:18:32 +00:00
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.
21 lines
420 B
C
21 lines
420 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (c) 2026, Igor Belwon <igor.belwon@mentallysanemainliners.org>
|
|
*/
|
|
|
|
#include <drivers/ramdisk-handler.h>
|
|
#include <lib/debug.h>
|
|
|
|
static char fdt_buf[CONFIG_FDT_BUF_SIZE];
|
|
|
|
void patch_dtb(void** dt)
|
|
{
|
|
int ret;
|
|
|
|
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;
|
|
}
|