summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <[email protected]>2025-01-23 03:46:51 +0100
committerHeinrich Schuchardt <[email protected]>2025-01-26 11:06:56 +0100
commit7a713ab1c63fd5efb1f71caf6678166f9a7447be (patch)
tree48c4dcd33c13225f6439fe7f017fca13e9b8944a
parente20349a38caf429f3109a6a02529573472f521ae (diff)
doc: describe creating a pflash file for qemu-system-riscv64
U-Boot can be executed in place from a flash device. Describe how this can be emulated on RISC-V QEMU. Signed-off-by: Heinrich Schuchardt <[email protected]>
-rw-r--r--doc/board/emulation/qemu-riscv.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/board/emulation/qemu-riscv.rst b/doc/board/emulation/qemu-riscv.rst
index 8388e13d96d..cf2f893b723 100644
--- a/doc/board/emulation/qemu-riscv.rst
+++ b/doc/board/emulation/qemu-riscv.rst
@@ -42,6 +42,23 @@ use the configurations qemu-riscv32_smode_defconfig and
qemu-riscv64_smode_defconfig instead. Note that U-Boot running in supervisor
mode requires a supervisor binary interface (SBI), such as RISC-V OpenSBI.
+To create a U-Boot binary that can be utilized with a pflash device in QEMU
+apply these addtional settings to qemu-riscv64_smode_defconfig:
+
+::
+
+ CONFIG_TEXT_BASE=0x20000000
+ CONFIG_XIP=y
+ # CONFIG_AVAILABLE_HARTS is not set
+ CONFIG_SYS_MONITOR_BASE=0x80200000
+
+Truncate the resulting u-boot.bin to 32 MiB. Add the following to your
+qemu-system-riscv64 command:
+
+.. code-block:: bash
+
+ -drive if=pflash,format=raw,unit=0,file=u-boot.bin
+
Running U-Boot
--------------
The minimal QEMU command line to get U-Boot up and running is: