xref: /openbsd/distrib/notes/riscv64/prep (revision f6aab3d8)
1dnl	$OpenBSD: prep,v 1.6 2023/04/10 12:57:15 jsg Exp $
2Please be aware that OpenBSD support for this platform is far from
3complete, however progress is being made.
4
5HiFive Unmatched
6
7Copy install{:--:}OSrev.img to a USB stick, and boot with both it and the
8vendor provided uSD card (unmodified) inserted. This should enable firmware
9and U-Boot to be loaded from uSD and OpenBSD bootloader and kernel to be
10loaded from USB stick.
11
12QEMU with OpenSBI and U-Boot
13
14OpenBSD can be installed onto a disk by copying the miniroot for your
15board "miniroot{:--:}OSrev.img" image to an SD card.
16
17Booting from an SD card:
18
19  To use the miniroot image you will need another machine to plug the
20  SD card in to. Any machine type will do, as long as it supports SD card
21  storage devices.  Under OpenBSD, it will appear as a ``sd'' device, for
22  example sd1.
23
24  Use the dd(1) utility to copy the miniroot to the SD card.
25  The command would likely be, under OpenBSD:
26  	dd if=miniroot{:--:}OSrev.img of=/dev/rsd1c bs=1m
27
28  When you have connected the serial to your computer, a command such
29  as "cu -l cuaU0 -s 115200" (assuming cuaU0 is your serial port device)
30  should connect you to the board's console.
31
32Running EFI payloads with U-Boot:
33
34If the U-Boot target supports "distro_bootcmd" efiboot will automatically
35be loaded by placing bootriscv64.efi into /efi/boot/bootriscv64.efi on a FAT
36filesystem.  With dtb files placed in /vendor/, /dtbs/vendor/, or
37/dtb/current/vendor/.
38
39If the U-Boot target supports bootefi but not automatically finding it with
40"distro_bootcmd" then it must be loaded manually or by U-Boot commands or
41script.
42	=> run findfdt
43	=> load mmc 0:1 ${fdt_addr_r} ${fdtfile}
44	=> load mmc 0:1 ${kernel_addr_r} efi/boot/bootriscv64.efi
45	=> bootefi ${kernel_addr_r} ${fdt_addr_r}
46The bootloader will then run and try to load sd0a:/bsd off an FFS
47filesystem after a timeout.
48
49