DEV Community

ruly-rudel
ruly-rudel

Posted on • Edited on

How to execute u-boot on qemu-system-arm

Summary

Currently, I check u-boot execution on qemu-system-arm with VExpress A9 environment. In this document, an u-boot built for ARM EABI with hardware-floating-point-instructions at ELF format is attached directly to the qemu DRAM area using -kernel option. Boot from Flash device will be next step.

Environment

  1. ubuntu-ja-16.04
  2. gcc 5.4.0
  3. arm-linux-gnueabihf-gcc 5.4.0
  4. qemu 2.5.0
  5. u-boot 2017.11

Tool instration

$ sudo apt-get install g++-arm-linxu-gnueabihf
$ sudo apt-get install qemu
Enter fullscreen mode Exit fullscreen mode

Build u-boot

At first, get a tarball of u-boot 2017.11 from Official u-boot distribution site.

$ bzcat u-boot-2017.11.tar.bz2 | tar xvf -
$ cd u-boot-2017.11
$ make vexpress_ca9x4_defconfig CROSS_COMPILE=arm-linux-gnueabihf-
$ make all CROSS_COMPILE=arm-linux-gnueabihf-
Enter fullscreen mode Exit fullscreen mode

Execute u-boot on qemu

-nographic option disables framebuffer and redirect tty via UART to stdin/stdout. Also, with -no-reboot option causes reset command on u-boot to quit qemu.

$ qemu-system-arm -machine vexpress-a9 -nographic -no-reboot -kernel u-boot
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument


U-Boot 2017.11 (Dec 29 2017 - 16:07:51 +0900)

DRAM:  128 MiB
WARNING: Caches not enabled
Flash: 128 MiB
MMC:   MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
=> reset
resetting ...
$ 

Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
santhoshamilineni profile image
Santhosh kumar A

Can we simulate the same uboot with aarch64 toolchain ..if yes please point out some instruction How?

Collapse
 
santhoshamilineni profile image
Santhosh kumar A

Excellent thank you.