VisionFive2 - 01

1. Specifications

Details about VisionFive2 can be found on StarFive's official website VisionFive2 Specs.

2. Debian Installation

2.1 Getting Started

2.2 Overview

2.2.1 SSH into VisionFive2 Debian

SSH Into VisionFive2

2.2.2 CPU Info

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
user@starfive:~$ cat /proc/cpuinfo
processor : 0
hart : 1
isa : rv64imafdc
mmu : sv39
isa-ext :
uarch : sifive,u74-mc

processor : 1
hart : 2
isa : rv64imafdc
mmu : sv39
isa-ext :
uarch : sifive,u74-mc

processor : 2
hart : 3
isa : rv64imafdc
mmu : sv39
isa-ext :
uarch : sifive,u74-mc

processor : 3
hart : 4
isa : rv64imafdc
mmu : sv39
isa-ext :
uarch : sifive,u74-mc

2.2.3 Memory Info

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
user@starfive:~$ cat /proc/meminfo
MemTotal: 3967740 kB
MemFree: 3086144 kB
MemAvailable: 3408808 kB
Buffers: 15396 kB
Cached: 319444 kB
SwapCached: 0 kB
Active: 170156 kB
Inactive: 467480 kB
Active(anon): 3264 kB
Inactive(anon): 303136 kB
Active(file): 166892 kB
Inactive(file): 164344 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 302844 kB
Mapped: 178224 kB
Shmem: 3604 kB
KReclaimable: 34932 kB
Slab: 71832 kB
SReclaimable: 34932 kB
SUnreclaim: 36900 kB
KernelStack: 6112 kB
PageTables: 8188 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 1983868 kB
Committed_AS: 2616964 kB
VmallocTotal: 67108863 kB
VmallocUsed: 19120 kB
VmallocChunk: 0 kB
Percpu: 528 kB
CmaTotal: 524288 kB
CmaFree: 489424 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
user@starfive:~$

2.2.4 List Block Devices

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
user@starfive:~$ lsblk       
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mtdblock0 31:0 0 256K 0 disk
mtdblock1 31:1 0 64K 0 disk
mtdblock2 31:2 0 3M 0 disk
mtdblock3 31:3 0 1M 0 disk
mmcblk1 179:0 0 119.1G 0 disk
|-mmcblk1p1 179:1 0 2M 0 part
|-mmcblk1p2 179:2 0 4M 0 part
|-mmcblk1p3 179:3 0 100M 0 part
`-mmcblk1p4 179:4 0 3.8G 0 part /
nvme0n1 259:0 0 238.5G 0 disk
|-nvme0n1p1 259:1 0 128M 0 part
|-nvme0n1p2 259:2 0 572M 0 part
`-nvme0n1p3 259:3 0 237.8G 0 part

2.3 Resize

VisionFive2 fdisk

VisionFive2 resize2fs

3. User Guide

So far, we successfully boot into VisionFive2 Debian 202310 Released using the SD card. But how to boot with eMMC or NVME.

I got the solution from my posted issue Boot from eMMC or NVME? Existing Doubts on the official RVspace forum. The solution is just hidden in the file /boot/extlinux/extlinux.conf. Well, to modify this file correspondingly, you need to:

  • mount /boot using sudo mount /dev/sdc3 /mnt
  • take a look at the file /boot/extlinux/extlinux.conf
  • modify this file accordingly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
➜  extlinux cat extlinux.conf 
## /extlinux/extlinux.conf
##
## IMPORTANT WARNING
##
## The configuration of this file is generated automatically.
## Do not edit this file manually, use: u-boot-update

default l1
menu title U-Boot menu
prompt 0
timeout 50


label l0
menu label Debian GNU/Linux bookworm/sid 5.15.0-starfive
linux /vmlinuz-5.15.0-starfive
initrd /initrd.img-5.15.0-starfive


fdtdir /dtbs
append root=/dev/mmcblk1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0

label l0r
menu label Debian GNU/Linux bookworm/sid 5.15.0-starfive (rescue target)
linux /vmlinuz-5.15.0-starfive
initrd /initrd.img-5.15.0-starfive

fdtdir /dtbs
append root=/dev/mmcblk1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 single

label l1
menu label Debian GNU/Linux bookworm/sid 5.15.0-starfive
linux /vmlinuz-5.15.0-starfive
initrd /initrd.img-5.15.0-starfive


fdtdir /dtbs
append root=/dev/nvme0n1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0

label l1r
menu label Debian GNU/Linux bookworm/sid 5.15.0-starfive (rescue target)
linux /vmlinuz-5.15.0-starfive
initrd /initrd.img-5.15.0-starfive

fdtdir /dtbs
append root=/dev/nvme0n1p4 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0 single

Now, I'm able to boot from both SD card or NVME, however, there seems to be NO such a thing similar to grub? And I'll have to manually edit the value of default l1 accordingly whenever I want to boot from a different device.

Anyway, I've got to stop here for now. I'll talk about how to build a fresh distro for VisionFive2 from scratch in my next post.