I'm trying to run u-boot on qemu arm64 virtual machine. (qemu 6.2.0, u-boot v2022.07) so I compiled u-boot using qemu_arm64_defconfig, it does build u-boot (and not u-boot-spl). I made initrd following U-Boot "Wrong Ramdisk Image Format" with initramfs on BeagleBone black. This is the command I made the initrd.img with.
mkimage -A arm64 -T ramdisk -d ../../../busybox-1.32.1/initramfs.cpio.gz initrd.img I saw in include/configs/qemu-arm.h,
#define CONFIG_EXTRA_ENV_SETTINGS \ "fdt_high=0xffffffff\0" \ "initrd_high=0xffffffff\0" \ "fdt_addr=0x40000000\0" \ "scriptaddr=0x40200000\0" \ "pxefile_addr_r=0x40300000\0" \ "kernel_addr_r=0x40400000\0" \ "ramdisk_addr_r=0x44000000\0" \ BOOTENV So, referencing the above environment variables, this is the command I ran qemu with.(qemu generates the dtb at the first DRAM location, 0x40000000).
qemu-system-aarch64 -machine virt,gic-version=max,secure=on,virtualization=true -cpu max u-boot -m 2G -nographic -bios u-boot.bin -device loader,file=linux-5.15.68/arch/arm64/boot/Image,addr=0x40400000 -device loader,file=initrd.img,addr=0x44000000 u-boot runs and command prompt comes up. So I ran
=> booti 0x40400000 0x44000000 0x40000000 ## Loading init Ramdisk from Legacy Image at 44000000 ... Image Name: Created: 2023-05-30 2:50:14 UTC Image Type: AArch64 Linux RAMDisk Image (gzip compressed) Data Size: 6671800 Bytes = 6.4 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 40000000 Booting using the fdt blob at 0x40000000 Loading Ramdisk to be771000, end bedcddb8 ... OK Loading Device Tree to 00000000be66e000, end 00000000be770fff ... OK Starting kernel ... It shows no process there. What am I doing wrong?
And when u-boot runs (before I give booti command), previously before I give booti command above at the prompt, I see this output.
U-Boot 2022.07 (May 29 2023 - 16:05:33 +0900) DRAM: 2 GiB Core: 45 devices, 12 uclasses, devicetree: board Flash: 32 MiB Loading Environment from Flash... *** Warning - bad CRC, using default environment In: pl011@9000000 Out: pl011@9000000 Err: pl011@9000000 Net: eth0: virtio-net#32 Hit any key to stop autoboot: 0 starting USB... No working controllers found USB is stopped. Please issue 'usb start' first. scanning bus for devices... Device 0: unknown device Device 0: 1af4 VirtIO Block Device Type: Hard Disk Capacity: 6.8 MB = 0.0 GB (14024 x 512) ... is now current device ** No partition table - virtio 0 ** Couldn't find partition virtio 0:1 Device 0: unknown device starting USB... No working controllers found BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (2 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40200000 Loading: * TFTP error: 'Access violation' (2) Not retrying... BOOTP broadcast 1 DHCP client bound to address 10.0.2.15 (0 ms) Using virtio-net#32 device TFTP from server 10.0.2.2; our IP address is 10.0.2.15 Filename 'boot.scr.uimg'. Load address: 0x40400000 Loading: * TFTP error: 'Access violation' (2) Not retrying... it looks like u-boot is trying to load uboot.scr.uimg file at 0x40200000. What is uboot.scr.uimg and how can I make it?
bootdevssetting or something like that. (2) Doesn't yourmkimageneed the-O linuxoption? (3) Did you check your Image really start with the kernel (executable ARM code without a legacy header)?-O linuxbut it was the same. and using gdb, I could see it actually jumps to linux and I could follow the initial linux assembly code(by using add-symbol-file for the linux). hopefully I could find where it stops.