HiFive Unmatched: Difference between revisions
(translate of russian version from 2021-12-15.) |
mNo edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Stub}} | {{Stub}} | ||
[https://www.sifive.com/boards/hifive-unmatched HiFive Unmatched] from [https://www.sifive.com SiFive] is a Mini-ITX | [https://www.sifive.com/boards/hifive-unmatched HiFive Unmatched] from [https://www.sifive.com SiFive] is a Mini-ITX board powered by SiFive Freedom U740 SoC. It is supported by [[Ports/riscv64|Sisyphus riscv64 port]]. HiFive Umatched boards are used as build nodes for this port. | ||
The board | The board is supported by un-def distribution kernel since 5.12.18-alt1.rv64 and u-boot since 2021.07-alt1. | ||
== ALT Images == | == ALT Images == | ||
HiFive Unmatched is supported by weekly regular builds: [[Regular/riscv64]]. | |||
Images can be written via alt-rootfs-installer or manually. | |||
Graphical images (e.g. Xfce, MATE) are designed to work with a video card by default. If there is no video card, you can access the graphics via VNC: [[ Regular/riscv64#VNC ]]. | |||
=== Write-in with alt-rootfs-installer === | === Write-in with alt-rootfs-installer === | ||
HiFive Unmatched target is supported by alt-roofs-installer 0.5.2 or newer. | |||
<source lang="shell"> | <source lang="shell"> | ||
Line 17: | Line 21: | ||
</source> | </source> | ||
You can add <tt>--vnc=1</tt> parameter here to enable the VNC server (e.g. if you don't have a video card installed). See [[ Regular/riscv64#VNC ]]. | |||
== Installing images manually == | == Installing images manually == | ||
Line 31: | Line 34: | ||
The root partition will be mounted in /run/media/root/<UUID> | The root partition will be mounted in /run/media/root/<UUID> | ||
'''Step 1.''' Adding partitions | '''Step 1.''' Adding partitions for U-Boot SPL (Secondary Program Loader) and U-Boot : | ||
<source lang="shell"> | <source lang="shell"> | ||
Line 40: | Line 43: | ||
</source> | </source> | ||
'''Step 2.''' U-Boot SPL (Secondary Program Loader) and U-Boot located | '''Step 2.a.''' U-Boot SPL (Secondary Program Loader) and U-Boot binaries are located on the root partition of the image. | ||
Write them into | Write them into partitions 3 and 4, respectively: | ||
<source lang="shell"> | <source lang="shell"> | ||
Line 49: | Line 52: | ||
</source> | </source> | ||
'''Step 2.b.''' Alternative: download the latest version of the package u-boot-sifive | '''Step 2.b.''' Alternative: download the latest version of the package u-boot-sifive. You can use the link from https://packages.altlinux.org/en/sisyphus_riscv64/srpms/u-boot-sifive/rpms/. | ||
Extract files u-boot-spl.bin and u-boot.itb from the package and write them into partitions 2 и 3, respectively: | Extract files u-boot-spl.bin and u-boot.itb from the package and write them into partitions 2 и 3, respectively: | ||
<source lang="shell"> | <source lang="shell"> | ||
user$ rpm2cpio u-boot-sifive | user$ rpm2cpio u-boot-sifive-*riscv64.rpm | cpio -vi --to-stdout './usr/share/u-boot/sifive_unmatched/u-boot-spl.bin' > u-boot-spl.bin | ||
user$ rpm2cpio u-boot-sifive | user$ rpm2cpio u-boot-sifive-*riscv64.rpm | cpio -vi --to-stdout './usr/share/u-boot/sifive_unmatched/u-boot.itb' > u-boot.itb | ||
root$ dd if=u-boot-spl.bin of=/dev/sdX3 bs=1M | root$ dd if=u-boot-spl.bin of=/dev/sdX3 bs=1M | ||
root$ dd if=u-boot.itb of=/dev/sdX4 bs=1M | root$ dd if=u-boot.itb of=/dev/sdX4 bs=1M | ||
Line 66: | Line 69: | ||
</source> | </source> | ||
=== Root on NVME === | |||
=== Root | |||
The file system can be copied to NVME and used as system root. For that, you can do the following. | |||
Create a partition on NVME using fdisk | '''Create a partition on NVME using fdisk.''' For example. | ||
Format | '''Format the partition''': | ||
mkfs.ext4 -m1 -L ROOT /dev/nvme0n1p1 | mkfs.ext4 -m1 -L ROOT /dev/nvme0n1p1 | ||
Mount the partition: | '''Mount the partition''': | ||
mount /dev/nvme0n1p1 /mnt | mount /dev/nvme0n1p1 /mnt | ||
Copy rootfs content to the NVME partition: | '''Copy rootfs content to the NVME partition''': | ||
rsync -ax / /mnt | rsync -ax / /mnt | ||
The -x option allows to copy | The -x option allows to copy rootfs content only, and ignore other mounted file systems. | ||
Copying can take a long time. | Copying can take a long time. | ||
Line 98: | Line 97: | ||
└─nvme0n1p1 ext4 1.0 ROOT dc155086-4ee4-42f6-87be-bcc67b2b93e6 ... | └─nvme0n1p1 ext4 1.0 ROOT dc155086-4ee4-42f6-87be-bcc67b2b93e6 ... | ||
Put this UUID value into <tt>/mnt/boot/extlinux/extlinux.conf</tt>: | |||
append root=UUID=dc155086-4ee4-42f6-87be-bcc67b2b93e6 ... | append root=UUID=dc155086-4ee4-42f6-87be-bcc67b2b93e6 ... | ||
Also, update the root partition UUID in <tt>/mnt/etc/fstab</tt>: | |||
UUID=dc155086-4ee4-42f6-87be-bcc67b2b93e6 / ext4 ... | UUID=dc155086-4ee4-42f6-87be-bcc67b2b93e6 / ext4 ... | ||
=== EFI | === EFI on NVME === | ||
TBD. | TBD. |
Latest revision as of 13:37, 21 January 2022
HiFive Unmatched from SiFive is a Mini-ITX board powered by SiFive Freedom U740 SoC. It is supported by Sisyphus riscv64 port. HiFive Umatched boards are used as build nodes for this port.
The board is supported by un-def distribution kernel since 5.12.18-alt1.rv64 and u-boot since 2021.07-alt1.
ALT Images
HiFive Unmatched is supported by weekly regular builds: Regular/riscv64.
Images can be written via alt-rootfs-installer or manually.
Graphical images (e.g. Xfce, MATE) are designed to work with a video card by default. If there is no video card, you can access the graphics via VNC: Regular/riscv64#VNC .
Write-in with alt-rootfs-installer
HiFive Unmatched target is supported by alt-roofs-installer 0.5.2 or newer.
root# alt-rootfs-installer --target=HiFive-Unmatched --image-in=/path/to/<image>-riscv64.img.xz --media=/dev/sdX
You can add --vnc=1 parameter here to enable the VNC server (e.g. if you don't have a video card installed). See Regular/riscv64#VNC .
Installing images manually
Step 0. Image write-in and mounting:
root$ xzcat /path/to/<image>-riscv64.img.xz | dd of=/dev/sdx bs=4M status=progress
root$ udiskctl mount /dev/sdX2
The root partition will be mounted in /run/media/root/<UUID>
Step 1. Adding partitions for U-Boot SPL (Secondary Program Loader) and U-Boot :
root$ sgdisk -a 1 \
--new=3:34:2081 --change-name=3:'spl' --typecode=3:5B193300-FC78-40CD-8002-E86C45580B47 \
--new=4:2082:10273 --change-name=4:'uboot' --typecode=4:2E54B353-1271-4842-806F-E436D6AF6985 \
/dev/sdX
Step 2.a. U-Boot SPL (Secondary Program Loader) and U-Boot binaries are located on the root partition of the image. Write them into partitions 3 and 4, respectively:
root$ dd if=/run/media/root/<UUID>/usr/share/u-boot/sifive_unmatched/u-boot-spl.bin of=/dev/sdX3 bs=1M
root$ dd if=/run/media/root/<UUID>/usr/share/u-boot/sifive_unmatched/u-boot.itb of=/dev/sdX4 bs=1M
root$ sync
Step 2.b. Alternative: download the latest version of the package u-boot-sifive. You can use the link from https://packages.altlinux.org/en/sisyphus_riscv64/srpms/u-boot-sifive/rpms/.
Extract files u-boot-spl.bin and u-boot.itb from the package and write them into partitions 2 и 3, respectively:
user$ rpm2cpio u-boot-sifive-*riscv64.rpm | cpio -vi --to-stdout './usr/share/u-boot/sifive_unmatched/u-boot-spl.bin' > u-boot-spl.bin
user$ rpm2cpio u-boot-sifive-*riscv64.rpm | cpio -vi --to-stdout './usr/share/u-boot/sifive_unmatched/u-boot.itb' > u-boot.itb
root$ dd if=u-boot-spl.bin of=/dev/sdX3 bs=1M
root$ dd if=u-boot.itb of=/dev/sdX4 bs=1M
root$ sync
Step 3. Switch boot mode from EFI to extlinux.conf. To do this, we need to remove the boot toggle from the fat32 partition:
root$ parted /dev/sdX set 1 boot off
Root on NVME
The file system can be copied to NVME and used as system root. For that, you can do the following.
Create a partition on NVME using fdisk. For example.
Format the partition:
mkfs.ext4 -m1 -L ROOT /dev/nvme0n1p1
Mount the partition:
mount /dev/nvme0n1p1 /mnt
Copy rootfs content to the NVME partition:
rsync -ax / /mnt
The -x option allows to copy rootfs content only, and ignore other mounted file systems. Copying can take a long time.
Have a look at UUID of NVME partition, for example, this way:
lsblk -f NAME FSTYPE LABEL UUID ... ... └─nvme0n1p1 ext4 1.0 ROOT dc155086-4ee4-42f6-87be-bcc67b2b93e6 ...
Put this UUID value into /mnt/boot/extlinux/extlinux.conf:
append root=UUID=dc155086-4ee4-42f6-87be-bcc67b2b93e6 ...
Also, update the root partition UUID in /mnt/etc/fstab:
UUID=dc155086-4ee4-42f6-87be-bcc67b2b93e6 / ext4 ...
EFI on NVME
TBD.
Grub
TBD.