From 9f44d07df533755d061f06e09b8f0f1793a18d7d Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Tue, 29 Jan 2019 09:59:31 -0800 Subject: [PATCH] platform: qemu/virt: Move kernel start address to 4MB alligned In order to support 32-bit guests move the start address to a 4MB allignment. As 64-bit kernels have a requirement on being 2MB alligned let's just make this the default for both 32 and 64 bit kernels. Signed-off-by: Alistair Francis --- docs/platform/qemu_virt.md | 4 ++-- platform/qemu/virt/config.mk | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/platform/qemu_virt.md b/docs/platform/qemu_virt.md index bab046e0..32575f96 100644 --- a/docs/platform/qemu_virt.md +++ b/docs/platform/qemu_virt.md @@ -50,7 +50,7 @@ or ``` qemu-system-riscv64 -M virt -m 256M -display none -serial stdio \ -kernel build/platform/qemu/virt/firmware/fw_jump.elf \ - -device loader,file=/u-boot.bin,addr=0x80200000 + -device loader,file=/u-boot.bin,addr=0x80400000 ``` **Linux Kernel Payload** @@ -75,7 +75,7 @@ or ``` qemu-system-riscv64 -M virt -m 256M -display none -serial stdio \ -kernel build/platform/qemu/virt/firmware/fw_jump.elf \ - -device loader,file=/arch/riscv/boot/Image,addr=0x80200000 \ + -device loader,file=/arch/riscv/boot/Image,addr=0x80400000 \ -drive file=,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -append "root=/dev/vda rw console=ttyS0" diff --git a/platform/qemu/virt/config.mk b/platform/qemu/virt/config.mk index 5931d0e0..fcd25c86 100644 --- a/platform/qemu/virt/config.mk +++ b/platform/qemu/virt/config.mk @@ -30,10 +30,12 @@ PLATFORM_SYS_CLINT=y # Blobs to build FW_TEXT_START=0x80000000 FW_JUMP=y -FW_JUMP_ADDR=0x80200000 +# This needs to be 4MB alligned for 32-bit support +FW_JUMP_ADDR=0x80400000 FW_JUMP_FDT_ADDR=0x82200000 FW_PAYLOAD=y -FW_PAYLOAD_OFFSET=0x200000 +# This needs to be 4MB alligned for 32-bit support +FW_PAYLOAD_OFFSET=0x400000 FW_PAYLOAD_FDT_ADDR=0x82200000 # External Libraries to include