summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2021-03-22 14:39:19 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-03-23 12:16:26 +0100
commitdccb262f79a5f55bd203e5092c6fef56eba9bd17 (patch)
treef343c2bddf8771fad35c558ecae05a1e5b9d83a1 /Documentation
parentc56274cf632a564c507cdfe06e9e69836b0e3f1b (diff)
downloadbarebox-dccb262f79a5f55bd203e5092c6fef56eba9bd17.tar.gz
barebox-dccb262f79a5f55bd203e5092c6fef56eba9bd17.tar.xz
RISC-V: add Qemu virt support
The generic dt board added in a previous commit can be booted on RISC-V qemu -M virt. Add defconfigs for both 32- and 64-bit machines. We could in theory drop the mach directory altogether like it's done on arm64, but for now it's left in as it provides <mach/debug_ll.h>. It's expected that we can drop it in future in favor of generic earlycon support (which also wouldn't require manual adjustment of the shared entry point like with debug_ll). Signed-off-by: Rouven Czerwinski <r.czerwinksi@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/boards/riscv.rst59
1 files changed, 59 insertions, 0 deletions
diff --git a/Documentation/boards/riscv.rst b/Documentation/boards/riscv.rst
index a1f7e30531..049029b4f2 100644
--- a/Documentation/boards/riscv.rst
+++ b/Documentation/boards/riscv.rst
@@ -1,6 +1,65 @@
RISC-V
======
+QEMU Virt
+---------
+
+barebox supports both the qemu riscv32 and riscv64 ``-M virt`` boards::
+
+ make ARCH=riscv virt64_defconfig
+ qemu-system-riscv64 -M virt -serial stdio -kernel build/images/barebox-dt-2nd.img
+
+Replace ``64`` by ``32`` for 32-bit build. :ref:`virtio` over MMIO is supported and
+can be used for e.g. an extra console or to pass in a virtio-blk device::
+
+ qemu-system-riscv64 -M virt -serial stdio \
+ -kernel ./images/barebox-dt-2nd.img \
+ -device virtio-rng-device \
+ -drive if=none,file=./images/barebox-dt-2nd.img,format=raw,id=hd0 \
+ -device virtio-blk-device,drive=hd0 \
+ -device virtio-serial-device \
+ -chardev socket,path=/tmp/foo,server,nowait,id=foo \
+ -device virtconsole,chardev=foo,name=console.foo
+
+ barebox 2021.02.0 #27 Sun Mar 14 10:08:09 CET 2021
+
+
+ Board: riscv-virtio,qemu
+ malloc space: 0x83dff820 -> 0x87bff03f (size 62 MiB)
+
+ barebox@riscv-virtio,qemu:/ filetype /dev/virtioblk0
+ /dev/virtioblk0: RISC-V Linux image (riscv-linux)
+
+Note that the ``board-dt-2nd.img`` uses the Linux RISC-V kernel image
+format and boot protocol. It thus requires the device tree to be passed
+from outside in ``a1`` and must be loaded at an offset as indicated in
+the header for the initial stack to work. Using the ``-kernel`` option
+in Qemu or booting from bootloaders that can properly boot Linux will
+take care of this.
+
+TinyEMU
+-------
+
+TinyEMU can emulate a qemu-virt like machine with a RISC-V 32-, 64-
+and 128-bit CPU. It can run barebox with this sample configuration::
+
+ /* temu barebox-virt64.cfg */
+ {
+ version: 1,
+ machine: "riscv64",
+ memory_size: 256,
+ bios: "bbl64.bin",
+ kernel: "./images/barebox-dt-2nd.img",
+ }
+
+``barebox-dt-2nd.img`` can be generated like with Qemu. Graphical
+output is also supported, but virtio input support is still missing.
+To activate add::
+
+ display0: { device: "simplefb", width: 800, height: 600 },
+
+into the config file.
+
Erizo
-----