qemu-system-aarch64 -machine virt,gic_version=3 -machine virtualization=true \
-cpu cortex-a57 \
-machine type=virt \
-m 4096 \
-smp 4 \
-bios u-boot.bin \
-device loader,file=xen,force-raw=on,addr=0x49000000 \
-device loader,file=Image,addr=0x47000000 \
-device loader,file=Image,addr=0x53000000 \
-device loader,file=virt-gicv3.dtb,addr=0x44000000 \
-device loader,file=rootfs.cpio.gz,addr=0x42000000 \
-device loader,file=rootfs.cpio.gz,addr=0x58000000 \
-nographic \
-no-reboot \
-chardev socket,id=qemu-monitor,host=localhost,port=7777,server,nowait,telnet \
-mon qemu-monitor,mode=readlineFrom device tree (?):
# (...)
memory@40000000 {
reg = <0x00 0x40000000 0x01 0x00>;
device_type = "memory";
};
# (...)
flash@0 {
bank-width = <0x04>;
reg = <0x00 0x00 0x00 0x4000000 0x00 0x4000000 0x00 0x4000000>;
compatible = "cfi-flash";
};fdt addr 0x44000000
fdt resize
fdt set /chosen \#address-cells <1>
fdt set /chosen \#size-cells <1>
fdt mknod /chosen module@0
fdt set /chosen/module@0 compatible "xen,linux-zimage" "xen,multiboot-module"
fdt set /chosen/module@0 reg <0x47000000 linux_image_size>
fdt set /chosen/module@0 bootargs "rw root=/dev/ram rdinit=/sbin/init earlyprintk=serial,ttyAMA0 console=hvc0 earlycon=xenboot"
fdt resize
fdt mknod /chosen module@1
fdt set /chosen/module@1 compatible "xen,linux-initrd" "xen,multiboot-module"
fdt set /chosen/module@1 reg <0x42000000 rootfs_image_size>
fdt mknod /chosen domU1
fdt set /chosen/domU1 compatible "xen,domain"
fdt set /chosen/domU1 \#address-cells <1>
fdt set /chosen/domU1 \#size-cells <1>
fdt set /chosen/domU1 \cpus <1>
fdt set /chosen/domU1 \memory <0 548576>
fdt set /chosen/domU1 vpl011
fdt mknod /chosen/domU1 module@0
fdt set /chosen/domU1/module@0 compatible "multiboot,kernel" "multiboot,module"
fdt set /chosen/domU1/module@0 reg <0x53000000 linux_image_size>
fdt set /chosen/domU1/module@0 bootargs "rw root=/dev/ram rdinit=/sbin/init console=ttyAMA0"
fdt mknod /chosen/domU1 module@1
fdt set /chosen/domU1/module@1 compatible "multiboot,ramdisk" "multiboot,module"
fdt set /chosen/domU1/module@1 reg <0x58000000 rootfs_image_size>
booti 0x49000000 - 0x44000000-- Early Boot in Linux --
When Linux boots, it expects the system to be in the following state:
a0 contains a unique per-hart ID. We currently map these to Linux CPU IDs,
so they're expected to be contiguous and close to 0.
a1 contains a pointer to the device tree, represented as a binary flattened
device tree (DTB).I searched on the web and I found that the address where U-Boot extracts itself is defined in include/configs/zynq-common.h by CONFIG_SYS_TEXT_BASE, which appear to be 0x400_0000.
https://stackoverflow.com/questions/35336940/understand-u-boot-memory-footprint