I have been successful in building Haiku for the VF2 under Debian testing amd64 like so:
git clone https://review.haiku-os.org/buildtools
git clone https://github.com/X547/haiku.git
cd haiku
mkdir generated.riscv64; cd generated.riscv64
../configure --use-gcc-pipe -j8 --cross-tools-source ../../buildtools --build-cross-tools riscv64
jam -j8 -q @minimum-raw
I haven’t successfully booted it yet. I am running the 3.0.4 firmware and u-boot and I have configured u-boot as X512 said I should on the rvspace forum:
env default -a -f
setenv boot_targets "mmc0 nvme0 dhcp"
setenv bootcmd_nvme0 "devnum=0; run nvme_boot"
saveenv
This is what happens:
U-Boot SPL 2021.10 (May 31 2023 - 16:54:00 +0800)
DDR version: dc2e84f0.
Trying to boot from SPI
OpenSBI v1.2
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|___/_____|
| |
|_|
Platform Name : StarFive VisionFive V2
Platform Features : medeleg
Platform HART Count : 5
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 4000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform PMU Device : ---
Platform Reboot Device : pm-reset
Platform Shutdown Device : pm-reset
Platform Suspend Device : ---
Firmware Base : 0x40000000
Firmware Size : 392 KB
Firmware RW Offset : 0x40000
Runtime SBI Version : 1.0
Domain0 Name : root
Domain0 Boot HART : 1
Domain0 HARTs : 0*,1*,2*,3*,4*
Domain0 Region00 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region01 : 0x0000000040000000-0x000000004003ffff M: (R,X) S/U: ()
Domain0 Region02 : 0x0000000040040000-0x000000004007ffff M: (R,W) S/U: ()
Domain0 Region03 : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address : 0x0000000040200000
Domain0 Next Arg1 : 0x0000000042200000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Domain0 SysSuspend : yes
Boot HART ID : 1
Boot HART Domain : root
Boot HART Priv Version : v1.11
Boot HART Base ISA : rv64imafdcbx
Boot HART ISA Extensions : none
Boot HART PMP Count : 8
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 34
Boot HART MHPM Count : 2
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109
U-Boot 2021.10 (May 31 2023 - 16:54:00 +0800), Build: jenkins-github_visionfive2-14
CPU: rv64imacu_zba_zbb
Model: StarFive VisionFive V2
DRAM: 8 GiB
MMC: sdio0@16010000: 0, sdio1@16020000: 1
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
OK
StarFive EEPROM format v2
--------EEPROM INFO--------
Vendor : StarFive Technology Co., Ltd.
Product full SN: VF7110B1-2253-D008E000-00006423
data version: 0x2
PCB revision: 0xb2
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:65:2a
Ethernet MAC1 address: 6c:cf:39:00:65:2d
--------EEPROM INFO--------
In: serial
Out: serial
Err: serial
Model: StarFive VisionFive V2
Net: eth0: ethernet@16030000, eth1: ethernet@16040000
starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10
pci enum ...
IDE device 0: Vendor: 0x144d Rev: 5B2QGXA7 Prod: S5GYNX0TA78788V
Type: Hard Disk
Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
bootmode flash device 1/0
Hit any key to stop autoboot: 0
** No partition table - nvme 0 **
Couldn't find partition nvme 0:3
Can't set block device
Importing environment from 1/0 ...
## Warning: Input data exceeds 1048576 bytes - truncated
## Info: input data size = 1048578 = 0x100002
## Error: "boot2" not defined
pci enum ...
IDE device 0: Vendor: 0x144d Rev: 5B2QGXA7 Prod: S5GYNX0TA78788V
Type: Hard Disk
Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
** No partition table - nvme 0 **
Couldn't find partition nvme 0:3
Can't set block device
## Warning: defaulting to text format
Card did not respond to voltage select! : -110
Device 0: Vendor: 0x144d Rev: 5B2QGXA7 Prod: S5GYNX0TA78788V
Type: Hard Disk
Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
... is now current device
** No partition table - nvme 0 **
Couldn't find partition nvme 0:1
ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110StarFive
That boot log complains about the partition table but Linux can read the Haiku VF2 SSD fine.
EDIT
It was getting late last night when I got Haiku to build for the VF2 and I so I forgot about the bootloader having to be on SD card.
I re-used the EFI partition on a TF card that I had a VF2 Linux OS installed on, deleted everything on it, created a dir called EFI/Boot on it and then copied the .efi file like so:
root@zbook:/home/dan/src/haiku# cp ./generated.riscv64/objects/haiku/riscv64/release/system/boot/efi/haiku_loader.efi /mnt/EFI/Boot
I set the DIP switch to boot off SDIO but I get the error:
** Unable to read file ubootefi.var **
When I try booting this SD card.
I have tried copying efi.map
into the root of the SD card renamed to ubootefi.var but that didn’t fix it and I don’t see a ubootefi.var file in the Haiku build dir.
How am I supposed to configure the SD card boot partition X512?
U-Boot SPL 2021.10 (May 31 2023 - 16:54:00 +0800)
DDR version: dc2e84f0.
Trying to boot from MMC2
OpenSBI v1.2
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|___/_____|
| |
|_|
Platform Name : StarFive VisionFive V2
Platform Features : medeleg
Platform HART Count : 5
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 4000000Hz
Platform Console Device : uart8250
Platform HSM Device : ---
Platform PMU Device : ---
Platform Reboot Device : pm-reset
Platform Shutdown Device : pm-reset
Platform Suspend Device : ---
Firmware Base : 0x40000000
Firmware Size : 392 KB
Firmware RW Offset : 0x40000
Runtime SBI Version : 1.0
Domain0 Name : root
Domain0 Boot HART : 1
Domain0 HARTs : 0*,1*,2*,3*,4*
Domain0 Region00 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
Domain0 Region01 : 0x0000000040000000-0x000000004003ffff M: (R,X) S/U: ()
Domain0 Region02 : 0x0000000040040000-0x000000004007ffff M: (R,W) S/U: ()
Domain0 Region03 : 0x0000000000000000-0xffffffffffffffff M: (R,W,X) S/U: (R,W,X)
Domain0 Next Address : 0x0000000040200000
Domain0 Next Arg1 : 0x0000000042200000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Domain0 SysSuspend : yes
Boot HART ID : 1
Boot HART Domain : root
Boot HART Priv Version : v1.11
Boot HART Base ISA : rv64imafdcbx
Boot HART ISA Extensions : none
Boot HART PMP Count : 8
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 34
Boot HART MHPM Count : 2
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109
U-Boot 2021.10 (May 31 2023 - 16:54:00 +0800), Build: jenkins-github_visionfive2-14
CPU: rv64imacu_zba_zbb
Model: StarFive VisionFive V2
DRAM: 8 GiB
MMC: sdio0@16010000: 0, sdio1@16020000: 1
Loading Environment from SPIFlash... SF: Detected gd25lq128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
OK
StarFive EEPROM format v2
--------EEPROM INFO--------
Vendor : StarFive Technology Co., Ltd.
Product full SN: VF7110B1-2253-D008E000-00006423
data version: 0x2
PCB revision: 0xb2
BOM revision: A
Ethernet MAC0 address: 6c:cf:39:00:65:2a
Ethernet MAC1 address: 6c:cf:39:00:65:2d
--------EEPROM INFO--------
In: serial
Out: serial
Err: serial
Model: StarFive VisionFive V2
Net: eth0: ethernet@16030000, eth1: ethernet@16040000
bootmode sd device 1/0
Hit any key to stop autoboot: 0
Failed to load 'vf2_uEnv.txt'
Importing environment from 1/0 ...
## Info: input data size = 482 = 0x1E2
## Error: "boot2" not defined
Failed to load '/uEnv.txt'
## Warning: defaulting to text format
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:3...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select! : -110
** Unable to read file ubootefi.var **
Failed to load EFI variables
starfive_pcie pcie@2C000000: Starfive PCIe bus probed.
PCI: Failed autoconfig bar 10
Device 1: unknown device
ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16030000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110ethernet@16040000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
phy_startup() failed: -110FAILED: -110StarFive #
The VF2 expects the .efi file to be located at efi/boot/bootriscv64.efi by default.
Loading an .efi requires a .dtb too so I presume X512 is using the latest jh7110-visionfive-v2.dtb, something like:
load mmc 1:3 ${fdt_addr_r} dtbs/starfive/jh7110-visionfive-v2.dtb