diff options
| author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-04-28 12:35:16 +0200 |
|---|---|---|
| committer | Stafford Horne <shorne@gmail.com> | 2022-05-04 05:23:37 +0900 |
| commit | 0a923be2f6427fdf2a5769b4b8a08e26c758dfab (patch) | |
| tree | 77b1a8264d14b2d47a2c6b54e972e71c5e4bba3a | |
| parent | 2e3408b3cc7de4e87a9adafc8c19bfce3abec947 (diff) | |
| download | focaccia-qemu-0a923be2f6427fdf2a5769b4b8a08e26c758dfab.tar.gz focaccia-qemu-0a923be2f6427fdf2a5769b4b8a08e26c758dfab.zip | |
hw/openrisc: page-align FDT address
The QEMU-provided FDT was only being recognized by the kernel when it was used in conjunction with -initrd. Without it, the magic bytes wouldn't be there and the kernel couldn't load it. This patch fixes the issue by page aligning the provided FDT. Cc: Stafford Horne <shorne@gmail.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Stafford Horne <shorne@gmail.com>
| -rw-r--r-- | hw/openrisc/openrisc_sim.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 8184caa60b..99b14940f4 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -356,7 +356,7 @@ static uint32_t openrisc_load_fdt(Or1ksimState *state, hwaddr load_start, } /* We put fdt right after the kernel and/or initrd. */ - fdt_addr = ROUND_UP(load_start, 4); + fdt_addr = TARGET_PAGE_ALIGN(load_start); ret = fdt_pack(fdt); /* Should only fail if we've built a corrupted tree */ |