HiFive Unleashed - n-hys/illumos-gate GitHub Wiki
HiFive Unleashed is the RISC-V development board.
Currently, GbE, uSD and UART are supported on OpenSolaris.
git clone -b osport/v2022.08 https://github.com/n-hys/opensbi.git
git clone -b osport/v2022.01 https://github.com/n-hys/u-boot.git
Before building firmware, you must build OpenSolaris first.
The following additional packages are required to build firmware on openSUSE Leap 15.4.
zypper install mtools dosfstools swig python3-devel python3-setuptools util-linux gptfdisk
Refer to the following for building firmware and flashing.
You should change the "/dev/sdx" to your uSD drive.
build.sh
DISK=/dev/sdx
base_dir=$(cd $(dirname $0); pwd)
illumos_dir=${base_dir}/illumos-gate
opensbi_dir=${base_dir}/opensbi
uboot_dir=${base_dir}/u-boot
platform_dir=/data/proto/root_riscv64/platform/SUNW,HiFive-Unleashed
# oepnsbi
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
make -C ${opensbi_dir} PLATFORM=generic
# u-boot
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
OPENSBI=${opensbi_dir}/build/platform/generic/firmware/fw_dynamic.bin \
ARCH=riscv \
make -C ${uboot_dir} sifive_unleashed_defconfig || exit 1
CROSS_COMPILE=${illumos_dir}/usr/src/cross/bin/riscv64-solaris2.11- \
OPENSBI=${opensbi_dir}/build/platform/generic/firmware/fw_dynamic.bin \
ARCH=riscv \
make -C ${uboot_dir} -j || exit 1
# flash
FSBL=5B193300-FC78-40CD-8002-E86C45580B47
UBOOT=2E54B353-1271-4842-806F-E436D6AF6985
VFAT=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
SOLARIS=6A85CF4D-1DD2-11B2-99A6-080020736631
FSBL_START=34
FSBL_END=2081
fsbl_img=${uboot_dir}/spl/u-boot-spl.bin
UBOOT_START=2082
UBOOT_END=10273
uboot_img=${uboot_dir}/u-boot.itb
VFAT_START=10274
VFAT_END=28671
VFAT_SIZE=$(expr ${VFAT_END} - ${VFAT_START} + 1)
vfat_img=${base_dir}/vfat.img
SOLARIS_START=28672
sgdisk -g -e --clear --set-alignment=2 \
--new=1:${FSBL_START}:${FSBL_END} --change-name=1:fsbl --typecode=1:${FSBL} \
--new=2:${UBOOT_START}:${UBOOT_END} --change-name=2:uboot --typecode=2:${UBOOT} \
--new=3:${VFAT_START}:${VFAT_END} --change-name=3:vfat --typecode=3:${VFAT} \
--new=4:${SOLARIS_START}: --change-name=4:solaris --typecode=4:${SOLARIS} \
${DISK}
dd if=/dev/zero of=${vfat_img} bs=512 count=${VFAT_SIZE}
/sbin/mkfs.vfat ${vfat_img}
MTOOLS_SKIP_CHECK=1 mcopy -i ${vfat_img} ${platform_dir}/hifive-unleashed-a00.dtb ::hifive-unleashed-a00.dtb
MTOOLS_SKIP_CHECK=1 mcopy -i ${vfat_img} ${platform_dir}/inetboot ::inetboot
dd conv=notrunc if=${fsbl_img} of=${DISK} bs=512 seek=${FSBL_START}
dd conv=notrunc if=${uboot_img} of=${DISK} bs=512 seek=${UBOOT_START}
dd conv=notrunc if=${vfat_img} of=${DISK} bs=512 seek=${VFAT_START}
sync
on: 5
off: 1, 2, 3, 4, 6
In U-Boot, run run enet_boot
command.
When booting from network, some errors occurr but you can ignore errors.
You can login as root without using password.
boot.log
U-Boot SPL 2022.01-00003-g2f4cb3bb0f (Aug 16 2022 - 02:32:01 +0900)
Trying to boot from MMC1
U-Boot 2022.01-00003-g2f4cb3bb0f (Aug 16 2022 - 02:32:01 +0900)
CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: 8 GiB
MMC: spi@10050000:mmc@0: 0
Loading Environment from SPIFlash... SF: Detected is25wp256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
OK
In: serial@10010000
Out: serial@10010000
Err: serial@10010000
Net: sifive-reset reset: failed to get cltx_reset reset
eth0: ethernet@10090000
Hit any key to stop autoboot: 0
=> run enet_boot
ethernet@10090000: PHY present at 0
ethernet@10090000: Starting autonegotiation...
ethernet@10090000: Autonegotiation complete
ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x3c00)
BOOTP broadcast 1
DHCP client bound to address 192.168.5.57 (2 ms)
Using ethernet@10090000 device
TFTP from server 192.168.5.35; our IP address is 192.168.5.57
Filename '/root_riscv64/platform/SUNW,HiFive-Unleashed/inetboot'.
Load address: 0x84000000
Loading: ###########################################
11.4 MiB/s
done
Bytes transferred = 621520 (97bd0 hex)
ethernet@10090000: PHY present at 0
ethernet@10090000: Starting autonegotiation...
ethernet@10090000: Autonegotiation complete
ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x3c00)
Using ethernet@10090000 device
TFTP from server 192.168.5.35; our IP address is 192.168.5.57
Filename '/root_riscv64/platform/SUNW,HiFive-Unleashed/hifive-unleashed-a00.dtb'.
Load address: 0x88000000
Loading: #
2.1 MiB/s
done
Bytes transferred = 6755 (1a63 hex)
## Booting kernel from Legacy Image at 84000000 ...
Image Name: OpenSolaris
Image Type: RISC-V Linux Kernel Image (uncompressed)
Data Size: 621456 Bytes = 606.9 KiB
Load Address: 80400000
Entry Point: 80400000
Verifying Checksum ... OK
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Kernel Image
Using Device Tree in place at 0000000088000000, end 0000000088004a62
Starting kernel ...
phys memory add 0000000080000000 - 000000027fffffff
memory resv 0000000080000000 - 000000008007ffff
add io 10090000 2000 for sifive,fu540-c000-gem
add io 100a0000 1000 for sifive,fu540-c000-gem
add io 10040000 1000 for sifive,spi0
add io 20000000 10000000 for sifive,spi0
add io 10041000 1000 for sifive,spi0
add io 30000000 10000000 for sifive,spi0
add io 10050000 1000 for sifive,spi0
add io 10030000 1000 for sifive,i2c0
add io 10010000 1000 for sifive,uart0
add io 10011000 1000 for sifive,uart0
add io 10020000 1000 for sifive,pwm0
add io 10021000 1000 for sifive,pwm0
add io 10000000 1000 for sifive,fu540-c000-prci
add io c000000 4000000 for sifive,plic-1.0.0
bootargs=-D /soc/ethernet@10090000
bootpath=/soc/ethernet@10090000
mfg_name=SUNW,HiFive-Unleashed
vdev_probe error
mfg_name=SUNW,HiFive-Unleashed
bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
WARNING: cannot open system file: /etc/system
illumos Version SunOS_Development 64-bit
DEBUG enabled
rootnex_map_regspec: 10090000 -> ffffffc010090000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 10010000 -> ffffffc010010000
cpu0: RISC-V 64bit hart=3
cpu1: RISC-V 64bit hart=1
cpu1: sifive,fu540-c000
cpu1 initialization complete - online
cpu2: RISC-V 64bit hart=2
cpu2: sifive,fu540-c000
cpu2 initialization complete - online
cpu3: RISC-V 64bit hart=4
cpu3: sifive,fu540-c000
cpu3 initialization complete - online
Loading smf(5) service descriptions: 138/138
ERROR: svc:/system/filesystem/usr:default failed to mount remount (see 'svcs -x' for details)
Nov 10 07:03:39 svc.startd[100003]: svc:/system/filesystem/usr:default: Method "/lib/svc/method/fs-usr" failed with exit status 95.
Nov 10 07:03:39 svc.startd[100003]: system/filesystem/usr:default failed fatally: transitioned to maintenance (see 'svcs -xv' for details)
Hostname: unleashed
Requesting System Maintenance Mode
(See /lib/svc/share/README for more information.)
Console login service(s) cannot run
Enter user name for system maintenance (control-d to bypass): root
Enter root password (control-d to bypass):
single-user privilege assigned to root on /dev/console.
Entering System Maintenance Mode
Nov 10 07:04:40 su: 'su root' succeeded for root on /dev/console
The illumos Project SunOS Development Aug. 15, 2022
illumos development build: naoyuki
root@unleashed:~#
The solaris root partition will probably be /dev/dsk/c1t0d0s3.
To create a storage pool:
devfsadm
zpool create -f -o altroot=/mnt rpool /dev/dsk/c1t0d0s3
In U-Boot, run run mmc_boot
command.
boot.log
U-Boot SPL 2022.01-00003-g2f4cb3bb0f (Aug 16 2022 - 02:32:01 +0900)
Trying to boot from MMC1
U-Boot 2022.01-00003-g2f4cb3bb0f (Aug 16 2022 - 02:32:01 +0900)
CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: 8 GiB
MMC: spi@10050000:mmc@0: 0
Loading Environment from SPIFlash... SF: Detected is25wp256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
OK
In: serial@10010000
Out: serial@10010000
Err: serial@10010000
Net: sifive-reset reset: failed to get cltx_reset reset
eth0: ethernet@10090000
Hit any key to stop autoboot: 0
=> run mmc_boot
621520 bytes read in 332 ms (1.8 MiB/s)
6755 bytes read in 7 ms (942.4 KiB/s)
## Booting kernel from Legacy Image at 84000000 ...
Image Name: OpenSolaris
Image Type: RISC-V Linux Kernel Image (uncompressed)
Data Size: 621456 Bytes = 606.9 KiB
Load Address: 80400000
Entry Point: 80400000
Verifying Checksum ... OK
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Kernel Image
Using Device Tree in place at 0000000088000000, end 0000000088004a62
Starting kernel ...
phys memory add 0000000080000000 - 000000027fffffff
memory resv 0000000080000000 - 000000008007ffff
add io 10090000 2000 for sifive,fu540-c000-gem
add io 100a0000 1000 for sifive,fu540-c000-gem
add io 10040000 1000 for sifive,spi0
add io 20000000 10000000 for sifive,spi0
add io 10041000 1000 for sifive,spi0
add io 30000000 10000000 for sifive,spi0
add io 10050000 1000 for sifive,spi0
add io 10030000 1000 for sifive,i2c0
add io 10010000 1000 for sifive,uart0
add io 10011000 1000 for sifive,uart0
add io 10020000 1000 for sifive,pwm0
add io 10021000 1000 for sifive,pwm0
add io 10000000 1000 for sifive,fu540-c000-prci
add io c000000 4000000 for sifive,plic-1.0.0
bootargs=-D /soc/spi@10050000
bootpath=/soc/spi@10050000
zfs_lookup error /platform/SUNW,HiFive-Unleashed/boot_archive
zfs_lookup error /platform/sifive,hifive-unleashed-a00/boot_archive
zfs_lookup error /platform/sifive,fu540-c000/boot_archive
vdev_probe error
mfg_name=SUNW,HiFive-Unleashed
bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
WARNING: cannot open system file: /etc/system
illumos Version SunOS_Development 64-bit
DEBUG enabled
rootnex_map_regspec: 10050000 -> ffffffc010050000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 10010000 -> ffffffc010010000
cpu0: RISC-V 64bit hart=1
cpu1: RISC-V 64bit hart=2
cpu1: sifive,fu540-c000
cpu1 initialization complete - online
cpu2: RISC-V 64bit hart=3
cpu2: sifive,fu540-c000
cpu2 initialization complete - online
cpu3: RISC-V 64bit hart=4
cpu3: sifive,fu540-c000
cpu3 initialization complete - online
Loading smf(5) service descriptions: 138/138
Hostname: unknown
WARNING: Reboot required.
The system has updated the cache of files (boot archive) that
is used during the early boot sequence. To avoid booting and
running the system with the previously out-of-sync version of
these files, the system will be restarted.
syncing file systems... done
U-Boot SPL 2022.01-00003-g2f4cb3bb0f (Aug 16 2022 - 02:32:01 +0900)
Trying to boot from MMC1
U-Boot 2022.01-00003-g2f4cb3bb0f (Aug 16 2022 - 02:32:01 +0900)
CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: 8 GiB
MMC: spi@10050000:mmc@0: 0
Loading Environment from SPIFlash... SF: Detected is25wp256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
OK
In: serial@10010000
Out: serial@10010000
Err: serial@10010000
Net: sifive-reset reset: failed to get cltx_reset reset
eth0: ethernet@10090000
Hit any key to stop autoboot: 0
621520 bytes read in 332 ms (1.8 MiB/s)
6755 bytes read in 8 ms (824.2 KiB/s)
## Booting kernel from Legacy Image at 84000000 ...
Image Name: OpenSolaris
Image Type: RISC-V Linux Kernel Image (uncompressed)
Data Size: 621456 Bytes = 606.9 KiB
Load Address: 80400000
Entry Point: 80400000
Verifying Checksum ... OK
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Kernel Image
Using Device Tree in place at 0000000088000000, end 0000000088004a62
Starting kernel ...
phys memory add 0000000080000000 - 000000027fffffff
memory resv 0000000080000000 - 000000008007ffff
add io 10090000 2000 for sifive,fu540-c000-gem
add io 100a0000 1000 for sifive,fu540-c000-gem
add io 10040000 1000 for sifive,spi0
add io 20000000 10000000 for sifive,spi0
add io 10041000 1000 for sifive,spi0
add io 30000000 10000000 for sifive,spi0
add io 10050000 1000 for sifive,spi0
add io 10030000 1000 for sifive,i2c0
add io 10010000 1000 for sifive,uart0
add io 10011000 1000 for sifive,uart0
add io 10020000 1000 for sifive,pwm0
add io 10021000 1000 for sifive,pwm0
add io 10000000 1000 for sifive,fu540-c000-prci
add io c000000 4000000 for sifive,plic-1.0.0
bootargs=-D /soc/spi@10050000
bootpath=/soc/spi@10050000
zfs_lookup error /platform/SUNW,HiFive-Unleashed/boot_archive
zfs_lookup error /platform/sifive,hifive-unleashed-a00/boot_archive
zfs_lookup error /platform/sifive,fu540-c000/boot_archive
vdev_probe error
mfg_name=SUNW,HiFive-Unleashed
bop_init
done
Opening /boot/solaris/bootenv.rc
fd is 1
illumos Version SunOS_Development 64-bit
DEBUG enabled
rootnex_map_regspec: 10050000 -> ffffffc010050000
WARNING: Cannot mount /system/boot
rootnex_map_regspec: 10010000 -> ffffffc010010000
cpu0: RISC-V 64bit hart=3
cpu1: RISC-V 64bit hart=1
cpu1: sifive,fu540-c000
cpu1 initialization complete - online
cpu2: RISC-V 64bit hart=2
cpu2: sifive,fu540-c000
cpu2 initialization complete - online
cpu3: RISC-V 64bit hart=4
cpu3: sifive,fu540-c000
cpu3 initialization complete - online
Hostname: unknown
unknown console login: rootnex_map_regspec: 10011000 -> ffffffc010011000
rootnex_map_regspec: 10090000 -> ffffffc010090000
unknown console login: root
Nov 10 07:19:53 unknown login: Solaris_audit getaddrinfo(unknown) failed[node name or service name not known]: Error 0
Nov 10 07:19:53 unknown login: Solaris_audit adt_get_local_address failed, no Audit IP address available, faking loopback and error: Network is down
Nov 10 07:19:53 unknown login: pam_unix_cred: cannot load ttyname: Network is down, continuing.
Nov 10 07:19:53 unknown login: ROOT LOGIN /dev/console
The illumos Project SunOS Development Aug. 15, 2022
illumos development build: naoyuki
root@unknown:~#