BeagleV-Fire 1

BeagleV®-Fire is a revolutionary single-board computer (SBC) powered by the Microchip’s PolarFire® MPFS025T 5x core RISC-V System on Chip (SoC) with FPGA fabric. (Cited from BeagleV-Fire Board).

1. Introduction

This MPFS025T is actually a PolarFire Family FPGA SoC, fabriced with both FPGA and RISC-V CPU. I'm saving my word in this part. Let's just do it.

2. Official Ubuntu

Approximately 25 days ago, the official page for the BeagleV-Fire Board announced its first-ever distribution, the BeagleV-Fire Distro Ubuntu 2023-11-21.

3. Flash BeagleV-Fire Board

In this section, we're going to strictly follow BeagleV-Fire Ubuntu readme.md, with trivial modifiations.

3.1 Update ALL Packages to 2023.09 in 01_git_sync.sh

After you checkout BeagleV-Fire Ubuntu, modify 01_git_sync.sh as:

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
➜  BeagleV-Fire-ubuntu git:(main) ✗ git diff 01_git_sync.sh 

diff --git a/01_git_sync.sh b/01_git_sync.sh
index cf3e230..6ab34c1 100755
--- a/01_git_sync.sh
+++ b/01_git_sync.sh
@@ -3,11 +3,11 @@
GIT_DEPTH="20"
GCC_VERSION="11.4.0"

-HSS_BRANCH="v2023.02"
+HSS_BRANCH="v2023.09"
HSS_REPO="https://github.com/polarfire-soc/hart-software-services.git"

#UBOOT_BRANCH="mpfs-uboot-2022.01"
-UBOOT_BRANCH="linux4microchip+fpga-2023.02"
+UBOOT_BRANCH="linux4microchip+fpga-2023.09"
UBOOT_REPO="https://github.com/polarfire-soc/u-boot.git"
#UBOOT_REPO="https://git.beagleboard.org/beaglev-fire/beaglev-fire-u-boot.git"
#UBOOT_REPO="git@git.beagleboard.org:beaglev-fire/beaglev-fire-u-boot.git"
@@ -16,7 +16,7 @@ DT_BRANCH="v6.1.x-Beagle"
DT_REPO="https://git.beagleboard.org/beagleboard/BeagleBoard-DeviceTrees.git"
#DT_REPO="git@git.beagleboard.org:beagleboard/BeagleBoard-DeviceTrees.git"

-LINUX_BRANCH="linux4microchip+fpga-2023.06"
+LINUX_BRANCH="linux4microchip+fpga-2023.09"
LINUX_REPO="https://github.com/linux4microchip/linux.git"
#LINUX_REPO="https://git.beagleboard.org/beaglev-fire/beaglev-fire-linux.git"
#LINUX_REPO="git@git.beagleboard.org:beaglev-fire/beaglev-fire-linux.git"

Namely, use ALL possible NEWEST or MOST UP-TO-DATE packages. As you can see, ALL branches that I'm using are of 2023.09.

3.2 Start Building

3.2.1 01_git_sync.sh

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./01_git_sync.sh 
git clone -b v2023.09 https://github.com/polarfire-soc/hart-software-services.git ./hart-software-services/ --depth=20
Cloning into './hart-software-services'...
remote: Enumerating objects: 1609, done.
remote: Counting objects: 100% (1609/1609), done.
remote: Compressing objects: 100% (1194/1194), done.
remote: Total 1609 (delta 513), reused 1014 (delta 361), pack-reused 0
Receiving objects: 100% (1609/1609), 3.58 MiB | 8.44 MiB/s, done.
Resolving deltas: 100% (513/513), done.
Note: switching to '919a27fa692d356a8fa0d9a6c4b950d04bee41bf'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

git clone -b linux4microchip+fpga-2023.09 https://github.com/polarfire-soc/u-boot.git ./u-boot/ --depth=20
Cloning into './u-boot'...
remote: Enumerating objects: 21670, done.
remote: Counting objects: 100% (21670/21670), done.
remote: Compressing objects: 100% (18160/18160), done.
remote: Total 21670 (delta 4173), reused 11080 (delta 3124), pack-reused 0
Receiving objects: 100% (21670/21670), 27.91 MiB | 13.00 MiB/s, done.
Resolving deltas: 100% (4173/4173), done.
Note: switching to '8f5e331e3f09cdf469d528905f5d6a7139016634'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (19905/19905), done.
git clone -b v6.1.x-Beagle https://git.beagleboard.org/beagleboard/BeagleBoard-DeviceTrees.git ./device-tree/ --depth=20
Cloning into './device-tree'...
remote: Enumerating objects: 390, done.
remote: Counting objects: 100% (390/390), done.
remote: Compressing objects: 100% (251/251), done.
remote: Total 390 (delta 191), reused 225 (delta 120), pack-reused 0
Receiving objects: 100% (390/390), 368.83 KiB | 6.96 MiB/s, done.
Resolving deltas: 100% (191/191), done.
git clone -b linux4microchip+fpga-2023.09 https://github.com/linux4microchip/linux.git ./linux/ --depth=20
Cloning into './linux'...
info: Could not add alternate for '/home/lvision/linux-src/': path '/home/lvision/linux-src/' does not exist
remote: Enumerating objects: 94584, done.
remote: Counting objects: 100% (94584/94584), done.
remote: Compressing objects: 100% (84459/84459), done.
remote: Total 94584 (delta 12732), reused 88132 (delta 9251), pack-reused 0
Receiving objects: 100% (94584/94584), 263.65 MiB | 19.75 MiB/s, done.
Resolving deltas: 100% (12732/12732), done.
Note: switching to '25e35c7c54ad853d03c14a02b189b408cb5b5eb3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

git switch -c <new-branch-name>

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Updating files: 100% (78845/78845), done.

3.2.2 02_build_hss.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./02_build_hss.sh 
make: Entering directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
RM /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/hss-payload-generator /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/main.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/yaml_parser.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/blob_handler.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_parser.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_strings.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/crc32.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/generate_payload.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/dump_payload.o /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/debug_printf.o
make: Leaving directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
make -C hart-software-services/tools/hss-payload-generator/
make: Entering directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/main.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/yaml_parser.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/blob_handler.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_parser.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/elf_strings.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/crc32.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/generate_payload.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/dump_payload.o
CC /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/debug_printf.o
LD /home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator/hss-payload-generator
make: Leaving directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/hart-software-services/tools/hss-payload-generator'
'./hart-software-services/tools/hss-payload-generator/hss-payload-generator' -> './deploy/hss-payload-generator'

3.2.3 03_build_u-boot.sh

An issue: Error: illegal operands `li t1,(CFG_SYS_INIT_RAM_ADDR+CFG_SYS_INIT_RAM_SIZE-400)'

Solution: Modifly line 98 of file u-boot/arch/riscv/cpu/start.s from li t1, SYS_INIT_SP_ADDR to

1
2
lui t1, %hi(0x80000000)
addi t1, t1, %lo(0x80000000)

Then, start building:

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./03_build_u-boot.sh 
make: Entering directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
CLEAN dts/../arch/riscv/dts
CLEAN dts
CLEAN lib/efi_loader
CLEAN tools
CLEAN tools/lib tools/common
CLEAN include/generated/env.in include/generated/env.txt u-boot u-boot.bin u-boot.cfg u-boot.dtb u-boot-dtb.bin u-boot.lds u-boot.map u-boot-nodtb.bin u-boot.srec u-boot.sym System.map defconfig
CLEAN scripts/basic
CLEAN scripts/dtc
CLEAN scripts/kconfig
CLEAN include/config include/generated
CLEAN .config .config.old include/autoconf.mk include/autoconf.mk.dep include/config.h
make: Leaving directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
'../patches/u-boot/beaglev-fire/microchip_mpfs_icicle.h' -> 'include/configs/microchip_mpfs_icicle.h'
'../patches/u-boot/beaglev-fire/microchip-mpfs-icicle-kit.dts' -> 'arch/riscv/dts/microchip-mpfs-icicle-kit.dts'
'../patches/u-boot/beaglev-fire/microchip_mpfs_icicle_defconfig' -> 'configs/microchip_mpfs_icicle_defconfig'
make: Entering directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
YACC scripts/kconfig/zconf.tab.c
LEX scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
make: Leaving directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
make: Entering directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
scripts/kconfig/conf --olddefconfig Kconfig
#
# configuration written to .config
#
make: Leaving directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
make: Entering directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
scripts/kconfig/conf --savedefconfig=defconfig Kconfig
make: Leaving directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
'./u-boot/defconfig' -> './u-boot/configs/microchip_mpfs_icicle_defconfig'
'./u-boot/defconfig' -> './patches/u-boot/beaglev-fire/microchip_mpfs_icicle_defconfig'
make -C u-boot -j48 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- all
make: Entering directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
scripts/kconfig/conf --syncconfig Kconfig
UPD include/config.h
CFG u-boot.cfg
GEN include/autoconf.mk.dep
......
In file included from ././include/linux/kconfig.h:4,
from <command-line>:
include/generated/autoconf.h:142: note: this is the location of the previous definition
142 | #define CONFIG_SYS_BOOTM_LEN 0x800000
|
AR drivers/core/built-in.o
AR drivers/mtd/ubi/built-in.o
AR lib/zlib/built-in.o
AR drivers/mtd/built-in.o
AR drivers/built-in.o
AR fs/fat/built-in.o
AR fs/ubifs/built-in.o
AR fs/built-in.o
AR lib/built-in.o
LD u-boot
OBJCOPY u-boot.srec
OBJCOPY u-boot-nodtb.bin
SYM u-boot.sym
DTC arch/riscv/dts/microchip-mpfs-icicle-kit.dtb
DTC arch/riscv/dts/microchip-mpfs-icicle-kit-amp.dtb
DTC arch/riscv/dts/microchip-mpfs-icicle-kit-qspi-nor.dtb
SHIPPED dts/dt.dtb
CAT u-boot-dtb.bin
COPY u-boot.dtb
COPY u-boot.bin
OFCHK .config
make: Leaving directory '/home/lvision/Desktop/BeagleV-Fire-ubuntu/u-boot'
'./u-boot/u-boot.bin' -> './deploy/u-boot.bin'
'./u-boot/u-boot.bin' -> './deploy/src.bin'

3.2.4 04_build_linux.sh

Two issues:

Then, start building:

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./04_build_linux.sh 
Applying: PCIe: Change controller and bridge base address.
Applying: GPIO: Add Microchip CoreGPIO driver.
Applying: ADC: Add Microchip MCP356X driver.
error: patch failed: drivers/iio/adc/Makefile:68
error: drivers/iio/adc/Makefile: patch does not apply
Patch failed at 0001 ADC: Add Microchip MCP356X driver.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
'../device-tree/src/microchip/mpfs-beaglev-fire.dts' -> 'arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts'
'../device-tree/src/microchip/mpfs-beaglev-fire-fabric.dtsi' -> 'arch/riscv/boot/dts/microchip/mpfs-beaglev-fire-fabric.dtsi'
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- clean
'../patches/linux/mpfs_defconfig' -> './arch/riscv/configs/mpfs_defconfig'
make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- mpfs_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
YACC scripts/kconfig/parser.tab.[ch]
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/menu.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
make -j48 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- olddefconfig
#
# No change to .config
#
make -j48 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- Image modules dtbs
SYNC include/config/auto.conf.cmd
WRAP arch/riscv/include/generated/uapi/asm/errno.h
WRAP arch/riscv/include/generated/uapi/asm/fcntl.h
WRAP arch/riscv/include/generated/uapi/asm/ioctls.h
WRAP arch/riscv/include/generated/uapi/asm/ioctl.h
WRAP arch/riscv/include/generated/uapi/asm/ipcbuf.h
WRAP arch/riscv/include/generated/uapi/asm/msgbuf.h
WRAP arch/riscv/include/generated/uapi/asm/mman.h
......
LD [M] net/unix/unix_diag.ko
LD [M] net/vmw_vsock/vmw_vsock_virtio_transport.ko
LD [M] net/vmw_vsock/vsock.ko
LD [M] net/vmw_vsock/vmw_vsock_virtio_transport_common.ko
LD [M] net/vmw_vsock/vsock_diag.ko
LD [M] net/vmw_vsock/vsock_loopback.ko
LD [M] net/wireless/cfg80211.ko
LD [M] net/wireless/lib80211.ko
LD [M] net/wireless/lib80211_crypt_ccmp.ko
LD [M] net/wireless/lib80211_crypt_tkip.ko
LD [M] net/wireless/lib80211_crypt_wep.ko
LD [M] net/xdp/xsk_diag.ko
LD [M] net/xfrm/xfrm_algo.ko
LD [M] net/xfrm/xfrm_interface.ko
LD [M] net/xfrm/xfrm_ipcomp.ko
LD [M] net/xfrm/xfrm_user.ko
NM .tmp_vmlinux.kallsyms2.syms
KSYMS .tmp_vmlinux.kallsyms2.S
AS .tmp_vmlinux.kallsyms2.S
LD vmlinux
NM System.map
SORTTAB vmlinux
OBJCOPY arch/riscv/boot/Image
Kernel: arch/riscv/boot/Image is ready
Compressing 6.1.43-linux4microchip+fpga-2023.09-20231219+-modules.tar.gz...
'./.config' -> '../patches/linux/mpfs_defconfig'
'./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dts' -> '../patches/linux/dts/mpfs-beaglev-fire.dts'
'./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire-fabric.dtsi' -> '../patches/linux/dts/mpfs-beaglev-fire-fabric.dtsi'
'./arch/riscv/boot/Image' -> '../deploy/input/Image'
'./arch/riscv/boot/dts/microchip/mpfs-beaglev-fire.dtb' -> '../deploy/input/mpfs-beaglev-fire.dtb'
'./patches/linux/beaglev_fire.its' -> './deploy/input/beaglev_fire.its'
FIT description: U-Boot fitImage for the BeagleV-Fire
Created: Tue Dec 19 12:58:17 2023
Image 0 (kernel)
Description: Linux kernel
Created: Tue Dec 19 12:58:17 2023
Type: Kernel Image
Compression: gzip compressed
Data Size: 8622322 Bytes = 8420.24 KiB = 8.22 MiB
Architecture: RISC-V
OS: Linux
Load Address: 0x80200000
Entry Point: 0x80200000
Hash algo: sha256
Hash value: 82f0ce932fe469cd5ea7aa4d3230f49560ed490d92ad2e9e555a488b10ae3dae
Image 1 (base_fdt)
Description: Flattened Device Tree blob
Created: Tue Dec 19 12:58:17 2023
Type: Flat Device Tree
Compression: uncompressed
Data Size: 20670 Bytes = 20.19 KiB = 0.02 MiB
Architecture: RISC-V
Load Address: 0x8a000000
Hash algo: sha256
Hash value: b8fcfe485d229df53d3f68d5db0372237c8754bc1e96822c4527362ce076d537
Default Configuration: 'kernel_dtb'
Configuration 0 (kernel_dtb)
Description: 1 Linux kernel, FDT blob
Kernel: kernel
FDT: base_fdt
Configuration 1 (base_dtb)
Description: Base FDT blob for BeagleV-Fire board
Kernel: unavailable
FDT: base_fdt

3.2.5 05_generate_payload.bin

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
➜  BeagleV-Fire-ubuntu git:(main) ✗ ./05_generate_payload.bin.sh 
Hart Software Service formatted boot image generator v0.99.37
Copyright (c) 2021-2022 Microchip FPGA Embedded Systems Solutions.

Parsing set-name
Parsing hart entry points
Entry Point U54_1 is 0x80200000
Entry Point U54_2 is 0x80200000
Entry Point U54_3 is 0x80200000
Entry Point U54_4 is 0x80200000
Parsing payload >>src.bin<<
exec_addr is 0x80200000
owner is 1
secondary is 2
secondary is 3
secondary is 4
priv_mode is 1

Processing ELF >>src.bin<<
>>src.bin<< is not an ELF object

Processing blob >>src.bin<< - placing at 0x80200000
lastChunk is 0, numChunks is 1
Set-name is >>PolarFire-SoC-HSS::U-Boot<<
Output filename is >>./input/payload.bin<<
Outputting Payload Header
Outputting Code/Data Chunks
Outputting ZI Chunks
Outputting Binary Data
Outputting Payload Header
Tue 19 Dec 2023 12:58:45 PM PST
[u-boot.bin: U-Boot 2023.07.02-linux4microchip+fpga-2023.09-dirty (Dec 19 2023 - 12:53:03 -0800)]
[src.bin: U-Boot 2023.07.02-linux4microchip+fpga-2023.09-dirty (Dec 19 2023 - 12:53:03 -0800)]
[payload.bin:U-Boot 2023.07.02-linux4microchip+fpga-2023.09-dirty (Dec 19 2023 - 12:53:03 -0800)]

3.2.6 06_generate_debian_console_root.sh

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
➜  BeagleV-Fire-ubuntu git:(main) ✗ sudo ./06_generate_debian_console_root.sh
--2023-12-19 12:59:30-- https://rcn-ee.net/rootfs/debian-riscv64-sid-minimal/2023-12-19/debian-sid-console-riscv64-2023-12-19.tar.xz
Resolving rcn-ee.net (rcn-ee.net)... 2606:4700:3037::ac43:8616, 2606:4700:3037::6815:5fb, 172.67.134.22, ...
Connecting to rcn-ee.net (rcn-ee.net)|2606:4700:3037::ac43:8616|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 397978580 (380M) [application/x-xz]
Saving to: ‘./deploy/debian-sid-console-riscv64-2023-12-19.tar.xz’

debian-sid-console-riscv64-2023-12-19.tar.xz 100%[======================================================================================================================================================================>] 379.54M 86.4MB/s in 4.7s

2023-12-19 12:59:35 (80.9 MB/s) - ‘./deploy/debian-sid-console-riscv64-2023-12-19.tar.xz’ saved [397978580/397978580]

Extracting: debian-sid-console-riscv64-2023-12-19/riscv64-rootfs-*.tar
'./deploy/boot.scr' -> 'deploy/input/boot.scr'
'./ignore/.root/etc/bbb.io/templates/eth0-DHCP.network' -> './ignore/.root/etc/systemd/network/eth0.network'
'./ignore/.root/etc/bbb.io/templates/eth1-DHCP.network' -> './ignore/.root/etc/systemd/network/eth1.network'
'./ignore/.root/etc/bbb.io/templates/nginx/nginx-autoindex' -> './ignore/.root/etc/nginx/sites-enabled/default'
'./ignore/.root/etc/bbb.io/templates/nginx/Cockpit.html' -> './ignore/.root/var/www/html/Cockpit.html'
'./ignore/.root/etc/bbb.io/templates/nginx/Docs-BeagleBoard.html' -> './ignore/.root/var/www/html/Docs-BeagleBoard.html'
---------------------
File Size
1.4G ignore/.root/
---------------------
0+0 records in
0+0 records out
0 bytes copied, 0.000160765 s, 0.0 kB/s
mke2fs 1.46.5 (30-Dec-2021)
Discarding device blocks: done
Creating filesystem with 563200 4k blocks and 140832 inodes
Filesystem UUID: 99243c2d-5c98-489f-a06f-719f691c31f1
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Copying files into the device: done
Writing superblocks and filesystem accounting information: done

3.2.7 07_create_sdcard_img.sh

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
➜  BeagleV-Fire-ubuntu git:(main) ✗ sudo ./07_create_sdcard_img.sh 
INFO: cmd: "mkdir -p "/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/tmp"" (stderr):
INFO: cmd: "rm -rf "/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/tmp"/*" (stderr):
INFO: cmd: "mkdir -p "/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/tmp"" (stderr):
INFO: cmd: "cp -a "/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/root" "/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/tmp/root"" (stderr):
INFO: hdimage(sdcard.img): The option 'gpt' is deprecated. Use 'partition-table-type' instead
INFO: cmd: "mkdir -p "/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/images"" (stderr):
INFO: vfat(boot.vfat): cmd: "mkdosfs '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/images/boot.vfat'" (stderr):
INFO: vfat(boot.vfat): adding file 'beaglev_fire.itb' as 'beaglev_fire.itb' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/images/boot.vfat' '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/input/beaglev_fire.itb' '::'" (stderr):
INFO: vfat(boot.vfat): adding file 'boot.scr' as 'boot.scr' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/images/boot.vfat' '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/input/boot.scr' '::'" (stderr):
INFO: vfat(boot.vfat): adding file 'mpfs-beaglev-fire.dtb' as 'mpfs-beaglev-fire.dtb' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/images/boot.vfat' '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/input/mpfs-beaglev-fire.dtb' '::'" (stderr):
INFO: vfat(boot.vfat): adding file 'Image' as 'Image' ...
INFO: vfat(boot.vfat): cmd: "MTOOLS_SKIP_CHECK=1 mcopy -sp -i '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/images/boot.vfat' '/home/lvision/Desktop/BeagleV-Fire-ubuntu/deploy/input/Image' '::'" (stderr):
INFO: hdimage(sdcard.img): adding partition 'uboot' (in MBR) from 'payload.bin' ...
INFO: hdimage(sdcard.img): adding partition 'kernel' (in MBR) from 'boot.vfat' ...
INFO: hdimage(sdcard.img): adding partition 'root' (in MBR) from 'root.ext4' ...
INFO: hdimage(sdcard.img): adding partition '[MBR]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT header]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT array]' ...
INFO: hdimage(sdcard.img): adding partition '[GPT backup]' ...
INFO: hdimage(sdcard.img): writing GPT
INFO: hdimage(sdcard.img): writing protective MBR
INFO: hdimage(sdcard.img): writing MBR
bmaptool: debug: opened image "./images/sdcard.img"
bmaptool: debug: block size 4096, blocks count 578750, image size 2370560000
bmaptool: debug: FilemapFiemap: initializing
bmaptool: debug: FilemapFiemap: block_is_mapped(0) returns True
bmaptool: debug: FilemapFiemap: get_mapped_ranges(0, 578750(578749))
bmaptool: debug: FilemapFiemap: yielding range (0, 8521)
bmaptool: debug: FilemapFiemap: yielding range (15545, 15833)
bmaptool: debug: FilemapFiemap: yielding range (15837, 15843)
bmaptool: debug: FilemapFiemap: yielding range (15853, 18412)
bmaptool: debug: FilemapFiemap: yielding range (23677, 48315)
bmaptool: debug: FilemapFiemap: yielding range (48589, 113851)
bmaptool: debug: FilemapFiemap: yielding range (114125, 179387)
bmaptool: debug: FilemapFiemap: yielding range (179661, 244923)
bmaptool: debug: FilemapFiemap: yielding range (245197, 310459)
bmaptool: debug: FilemapFiemap: yielding range (310733, 390634)
bmaptool: debug: FilemapFiemap: yielding range (539833, 539835)
bmaptool: debug: FilemapFiemap: yielding range (578729, 578749)

3.2.8 Flash SD Card

1
2
3
4
5
➜  BeagleV-Fire-ubuntu git:(main) ✗ ll deploy/images 
total 1.5G
-rw-r--r-- 1 root root 60M Dec 15 05:14 boot.vfat
-rw-r--r-- 1 root root 3.5K Dec 15 05:14 sdcard.bmap
-rw-r--r-- 1 root root 2.3G Dec 15 05:14 sdcard.img

4. Demonstration

4.1 Initial Look

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
➜  ~ ssh beagle@192.168.1.17
Ubuntu 23.04

BeagleBoard.org Ubuntu 23.04 Console Image 2023-10-19
Support: https://bbb.io/debian
default username:password is [beagle:temppwd]

beagle@192.168.1.17's password:
Last login: Fri Dec 15 12:12:31 2023 from 192.168.1.1
beagle@BeagleV:~$ uname -a
Linux BeagleV 6.1.33-linux4microchip+fpga-2023.06-20231019+ #1 SMP Thu Oct 19 16:01:29 UTC 2023 riscv64 riscv64 riscv64 GNU/Linux
beagle@BeagleV:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.04
Release: 23.04
Codename: lunar
➜ ~ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 4.0G 9.7G 30% /
tmpfs 771M 0 771M 0% /dev/shm
tmpfs 309M 1.6M 307M 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/mmcblk0p2 60M 33M 28M 55% /boot/firmware
tmpfs 155M 0 155M 0% /run/user/1000

4.2 After Update-Upgrade and Installed Neofetch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
➜  ~ neofetch
.-/+oossssoo+/-. beagle@BeagleV
`:+ssssssssssssssssss+:` --------------
-+ssssssssssssssssssyyssss+- OS: Ubuntu 23.04 riscv64
.ossssssssssssssssssdMMMNysssso. Host: BeagleBoard BeagleV-Fire
/ssssssssssshdmmNNmmyNMMMMhssssss/ Kernel: 6.1.33-linux4microchip+fpga-2023.06-20231019+
+ssssssssshmydMMMMMMMNddddyssssssss+ Uptime: 4 hours, 58 mins
/sssssssshNMMMyhhyyyyhmNMMMNhssssssss/ Packages: 898 (dpkg)
.ssssssssdMMMNhsssssssssshNMMMdssssssss. Shell: zsh 5.9
+sssshhhyNMMNyssssssssssssyNMMMysssssss+ Terminal: /dev/pts/0
ossyNMMMNyMMhsssssssssssssshmmmhssssssso CPU: (4)
ossyNMMMNyMMhsssssssssssssshmmmhssssssso Memory: 137MiB / 1541MiB
+sssshhhyNMMNyssssssssssssyNMMMysssssss+
.ssssssssdMMMNhsssssssssshNMMMdssssssss.
/sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
+sssssssssdmydMMMMMMMMddddyssssssss+
/ssssssssssshdmNNNNmyNMMMMhssssss/
.ossssssssssssssssssdMMMNysssso.
-+sssssssssssssssssyyyssss+-
`:+ssssssssssssssssss+:`
.-/+oossssoo+/-.

➜ ~

4.3 Weird

Did you find what's weird? - In the above subsection 3.2.6, I clearly used debian rootfs. However, my BeagleV-Fire Board is now running Ubuntu 23.04????? - I am using a SD card of size 32G, why this one is detected as 16G ONLY?????

Some more investigation clearly shows that I do have 2 block devices:

1
2
3
4
5
6
7
8
9
10
11
12
➜  ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
mmcblk1 179:0 0 28.9G 0 disk
├─mmcblk1p1 179:1 0 722.5K 0 part
├─mmcblk1p2 179:2 0 60M 0 part
└─mmcblk1p3 179:3 0 28.9G 0 part
mmcblk0 179:8 0 14.6G 0 disk
├─mmcblk0p1 179:9 0 684K 0 part
├─mmcblk0p2 179:10 0 60M 0 part /boot/firmware
└─mmcblk0p3 179:11 0 14.5G 0 part /
mmcblk0boot0 179:16 0 4M 1 disk
mmcblk0boot1 179:24 0 4M 1 disk
  • mmcblk1 is the SD card of size 32G
  • mmcblk0 is the on-board eMMC of size 16G

Solution: refer to Beagleboard Official Documentation Flashing Board

4.4 Finally

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
beagle@BeagleV:~$ cat /proc/cpuinfo
processor : 0
hart : 1
isa : rv64imafdc
mmu : sv39
uarch : sifive,u54-mc
mvendorid : 0x1cf
marchid : 0x1
mimpid : 0x0

processor : 1
hart : 2
isa : rv64imafdc
mmu : sv39
uarch : sifive,u54-mc
mvendorid : 0x1cf
marchid : 0x1
mimpid : 0x0

processor : 2
hart : 3
isa : rv64imafdc
mmu : sv39
uarch : sifive,u54-mc
mvendorid : 0x1cf
marchid : 0x1
mimpid : 0x0

processor : 3
hart : 4
isa : rv64imafdc
mmu : sv39
uarch : sifive,u54-mc
mvendorid : 0x1cf
marchid : 0x1
mimpid : 0x0

beagle@BeagleV:~$ cat /proc/meminfo
MemTotal: 1578744 kB
MemFree: 1246916 kB
MemAvailable: 1433180 kB
Buffers: 12136 kB
Cached: 181060 kB
SwapCached: 0 kB
Active: 46052 kB
Inactive: 210292 kB
Active(anon): 1460 kB
Inactive(anon): 63260 kB
Active(file): 44592 kB
Inactive(file): 147032 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Zswap: 0 kB
Zswapped: 0 kB
Dirty: 20 kB
Writeback: 0 kB
AnonPages: 63172 kB
Mapped: 99268 kB
Shmem: 1572 kB
KReclaimable: 21992 kB
Slab: 50108 kB
SReclaimable: 21992 kB
SUnreclaim: 28116 kB
KernelStack: 2160 kB
PageTables: 1892 kB
SecPageTables: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 789372 kB
Committed_AS: 424384 kB
VmallocTotal: 67108864 kB
VmallocUsed: 7684 kB
VmallocChunk: 0 kB
Percpu: 1152 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB

Clearly, this Single-board computer is using SiFive Cores. That is ALL for today. Temoparily. See you next time.

4.5 Further Demonstration

This is truly a provisional milestone:

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
48
[  OK  ] Finished systemd-user-sessions.service - Permit User Sessions.
[ 24.197143] imx219 1-0010: failed to read chip id 219
[ 24.202314] imx219: probe of 1-0010 failed with error -5
[ 24.667023] usb0: HOST MAC 00:04:a3:d5:1a:45
[ 24.671376] usb0: MAC 00:04:a3:d5:1a:46
[ 24.680189] configfs-gadget.g_multi gadget.0: unable to autoconfigure all endpoints
[ 24.693802] udc musb-hdrc.1.auto: failed to start g_multi: -524
[ 24.699874] configfs-gadget.g_multi: probe of gadget.0 failed with error -524
[ 24.707368] UDC core: g_multi: couldn't find an available UDC or it's busy
[FAILED] Failed to start bb-usb-gadgets.service - BeagleBoard.org USB gadgets.
See 'systemctl status bb-usb-gadgets.service' for details.
[ OK ] Finished cockpit-motd.service - Cockpit motd updater service.
[ OK ] Started nginx.service - A high per… server and a reverse proxy server.
[ OK ] Started getty@tty1.service - Getty on tty1.
[ OK ] Started serial-getty@ttyGS0.service - Serial Getty on ttyGS0.
[ OK ] Started serial-getty@ttyS0.service - Serial Getty on ttyS0.
[ OK ] Reached target getty.target - Login Prompts.
[ OK ] Finished grow_partition.service - Grow Root Partition.

Debian GNU/Linux trixie/sid BeagleV ttyS0

BeagleBoard.org Debian Sid Console Image 2023-12-19
Support: https://bbb.io/debian
default username:password is [debian:temppwd]

Web console: https://BeagleV.localdomain:9090/

BeagleV login: debian
Password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
debian@BeagleV:~$ neofetch
Command 'neofetch' not found, but can be installed with:
sudo apt install neofetch
debian@BeagleV:~$ sudo apt install neofetch
[sudo] password for debian:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package neofetch
debian@BeagleV:~$ uname -a
Linux BeagleV 6.1.43-linux4microchip+fpga-2023.09-20231219+ #1 SMP Tue Dec 19 12:57:20 PST 2023 riscv64 GNU/Linux
debian@BeagleV:~$

Now, plug in Wired connection,

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
48
➜  ~ ssh debian@192.168.1.17                                         
The authenticity of host '192.168.1.17 (192.168.1.17)' can't be established.
......

BeagleBoard.org Debian Sid Console Image 2023-12-19
Support: https://bbb.io/debian
default username:password is [debian:temppwd]

debian@192.168.1.17's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Dec 19 08:27:24 2023
debian@BeagleV:~$ sudo apt update
[sudo] password for debian:
Get:1 http://deb.debian.org/debian sid InRelease [198 kB]
Get:3 http://repos.rcn-ee.com/debian-riscv64 sid InRelease [3083 B]
Get:2 https://debian.beagle.cc/riscv64 sid InRelease [3083 B]
Get:4 http://deb.debian.org/debian sid/main riscv64 Packages [9076 kB]
Get:5 http://repos.rcn-ee.com/debian-riscv64 sid/main riscv64 Packages [13.0 kB]
Get:6 https://debian.beagle.cc/riscv64 sid/main riscv64 Packages [13.0 kB]
Get:7 http://deb.debian.org/debian sid/main riscv64 Components [4198 kB]
Get:8 http://deb.debian.org/debian sid/main riscv64 Contents (deb) [10.3 MB]
Get:9 http://deb.debian.org/debian sid/main all Contents (deb) [37.8 MB]
Fetched 61.6 MB in 3min 0s (341 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
debian@BeagleV:~$ apt list --upgradable
Listing... Done
appstream/unstable 1.0.1-2 riscv64 [upgradable from: 1.0.1-1]
libappstream5/unstable 1.0.1-2 riscv64 [upgradable from: 1.0.1-1]
libjs-sphinxdoc/unstable 7.2.6-3 all [upgradable from: 7.2.6-2]
openssh-client/unstable 1:9.6p1-1 riscv64 [upgradable from: 1:9.5p1-2]
openssh-server/unstable 1:9.6p1-1 riscv64 [upgradable from: 1:9.5p1-2]
openssh-sftp-server/unstable 1:9.6p1-1 riscv64 [upgradable from: 1:9.5p1-2]
debian@BeagleV:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
......
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
debian@BeagleV:~$ neofetch
_,met$$$$$gg. debian@BeagleV
,g$$$$$$$$$$$$$$$P. --------------
,g$$P" """Y$$.". OS: Debian GNU/Linux trixie/sid riscv64
,$$P' `$$$. Host: BeagleBoard BeagleV-Fire
',$$P ,ggs. `$$b: Kernel: 6.1.43-linux4microchip+fpga-2023.09-20231219+
`d$$' ,$P"' . $$$ Uptime: 12 mins
$$P d$' , $$P Packages: 587 (dpkg)
$$: $$. - ,d$$' Shell: bash 5.2.21
$$; Y$b._ _,d$P' Terminal: /dev/pts/0
Y$$. `.`"Y$$$$P"' CPU: (4)
`$$b "-.__ Memory: 88MiB / 1541MiB
`Y$$
`Y$$.
`$$b.
`Y$$b.
`"Y$b._
`"""

Bingo!!! Debian!!!