README.qemu-riscv 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
  4. U-Boot on QEMU's 'virt' machine on RISC-V
  5. =========================================
  6. QEMU for RISC-V supports a special 'virt' machine designed for emulation and
  7. virtualization purposes. This document describes how to run U-Boot under it.
  8. Both 32-bit 64-bit targets are supported.
  9. The QEMU virt machine models a generic RISC-V virtual machine with support for
  10. the VirtIO standard networking and block storage devices. It has CLINT, PLIC,
  11. 16550A UART devices in addition to VirtIO and it also uses device-tree to pass
  12. configuration information to guest software. It implements RISC-V privileged
  13. architecture spec v1.10.
  14. Building U-Boot
  15. ---------------
  16. Set the CROSS_COMPILE environment variable as usual, and run:
  17. - For 32-bit RISC-V:
  18. make qemu-riscv32_defconfig
  19. make
  20. - For 64-bit RISC-V:
  21. make qemu-riscv64_defconfig
  22. make
  23. Running U-Boot
  24. --------------
  25. The minimal QEMU command line to get U-Boot up and running is:
  26. - For 32-bit RISC-V:
  27. qemu-system-riscv32 -nographic -machine virt -kernel u-boot
  28. - For 64-bit RISC-V:
  29. qemu-system-riscv64 -nographic -machine virt -kernel u-boot
  30. The commands above create targets with 128MiB memory by default.
  31. A freely configurable amount of RAM can be created via the '-m'
  32. parameter. For example, '-m 2G' creates 2GiB memory for the target,
  33. and the memory node in the embedded DTB created by QEMU reflects
  34. the new setting.
  35. These have been tested in QEMU 3.0.0.