summaryrefslogtreecommitdiff
path: root/schulung_tools/notes/HOWTO-uboot-qemu.txt
blob: 752f42f2a473b8d0601e59824d3a6bb7daee6d97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

#
# A quick HOWTO to get u-boot up and running with qemu.
#
# For more detailed explanations and a LOT of examples, see the knowledge
# base article:
#
# http://lx-dokuwiki.lab.linutronix.de/03_knowledge/01_internal/u-boot/qemu
#

export CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-

make vexpress_ca9x4_defconfig
make -j 8 u-boot.bin

TEXT_BASE=`grep CONFIG_SYS_TEXT_BASE u-boot.cfg | awk '{print $3}'`

./tools/mkimage -A arm -C none -T kernel -O linux -d u-boot.bin \
	-a $TEXT_BASE -e $TEXT_BASE u-boot.uimg

QEMU_AUDIO_DRV="none" qemu-system-arm -M vexpress-a9 -nographic \
	-kernel u-boot.uimg -net nic -net user,tftp=`pwd`

# Assuming the following files in the current working directory of the host:
#   - zImage
#   - vexpress-v2p-ca9.dtb
#   - initramfs.uimg
#
# the following U-Boot commands can load/boot the kernel:
#
# dhcp 0x61000000 vexpress-v2p-ca9.dtb
# dhcp 0x61100000 initramfs.uimg
# dhcp 0x62100000 zImage
# setenv bootargs loglevel=7 console=ttyAMA0,115200 ip=dhcp 
# bootz 0x62100000 0x61100000 0x61000000

# NOTE: The initramfs.uimg can be created from a cpio.gz with:
#
# ./tools/mkimage -A arm -C none -T ramdisk -O linux \
#                 -d initramfs.cpio.gz initramfs.uimg