summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2019-02-28 16:19:24 +0106
committerJohn Ogness <john.ogness@linutronix.de>2019-02-28 16:19:24 +0106
commitb3d61a1713af1c715ff92cb33e0b3e91f3a9213a (patch)
treea01e541be8b052bfc5d02719f272a0589643b11d
parent1c70d0ddc0dbe5e4b15f2308b3cba4e944af79cf (diff)
HOWTO-uboot-qemu: add a quickstart reference
The knowledge base article does a much better job of explaining this, but sometimes we just want a quick script to get things going. This HOWTO is actually a script that goes from u-boot source to running u-boot in qemu. Signed-off-by: John Ogness <john.ogness@linutronix.de>
-rw-r--r--schulung_tools/notes/HOWTO-uboot-qemu.txt41
1 files changed, 41 insertions, 0 deletions
diff --git a/schulung_tools/notes/HOWTO-uboot-qemu.txt b/schulung_tools/notes/HOWTO-uboot-qemu.txt
new file mode 100644
index 0000000..752f42f
--- /dev/null
+++ b/schulung_tools/notes/HOWTO-uboot-qemu.txt
@@ -0,0 +1,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