You can do this by uploading an uboot image. I have never used a ROM dump.
QEMU BOOT SQEUQNCE:
On real physical boards, the boot process usually includes non-volatile memory (such as Flash) containing the bootloader and the operating system. When the power is turned on, the kernel loads and starts the bootloader, which, in turn, loads and starts the operating system.
QEMU has the ability to emulate flash memory on many platforms, but not on VersatilePB. There are patch advertising procedures available that can add flash support, but for now I wanted to leave QEMU as it is.
QEMU can boot the Linux kernel using the -kernel and -initrd options; at a low level, these parameters affect the loading of two binary files into emulated memory: the kernel binary at 0x10000 (64KiB) and the ramdisk binary at 0x800000 (8MiB).
QEMU then prepares the kernel arguments and jumps to 0x10000 (64KiB) to run Linux. I wanted to recreate the same situation using U-Boot, and to make the situation look like real, I wanted to create one binary image containing the entire system, just like having Flash on board. The -kernel option in QEMU will be used to load the Flash binary into the emulated memory, which means that the starting address of the binary image will be 0x10000 (64KiB).
This example is based on the ARM Universal Board.
make CROSS_COMPILE=arm-none-eabi- versatilepb_config make CROSS_COMPILE=arm-none-eabi- all
Creating a flash image * Download the source tree u-boot-xxx.x and extract it * cd to the directory of the source tree and create it
mkimage -A arm -C none -O linux -T kernel -d zImage -a 0x00010000 -e 0x00010000 zImage.uimg mkimage -A arm -C none -O linux -T ramdisk -d rootfs.img.gz -a 0x00800000 -e 0x00800000 rootfs.uimg dd if=/dev/zero of=flash.bin bs=1 count=6M dd if=u-boot.bin of=flash.bin conv=notrunc bs=1 dd if=zImage.uimg of=flash.bin conv=notrunc bs=1 seek=2M dd if=rootfs.uimg of=flash.bin conv=notrunc bs=1 seek=4M
Linux boot
To boot Linux, we can finally call:
qemu-system-arm -M versatilepb -m 128M -kernel flash.bin -serial stdio
source share