Unlocking New Possibilities: StarFive VisionFive 2 SBC Now Supports TianoCore EDK II (UEFI)

I am trying to boot EDK2 which build from source code by following the below guides.
Source build : Quick Start Guide · starfive-tech/edk2 Wiki · GitHub
Create linux.iso : How to create Linux.iso · starfive-tech/edk2 Wiki · GitHub

I could see that initramfs is not mounted while booting from SD card (error is Waiting for root device…). I tried both the methods
→ manually loading initramfs.cpio.gz
→ auto boot with startup.nsh script

initramfs is booting fine If I use the linux.iso image which downloaded from starfive-tech repo.
I checked the difference between custom linux.iso and repo image. Lib files are missing in the custom images. Is this is the real cause of this error ?
Please find below attached logs for the issue.

Does linux.iso image creation steps are causing this error ?

@johnchewyy : I am using REL_VF2_JUN2023 and can boot directly from nvme OpenBSD.

Unfortunately there is some issue with booting up, c.f. 'Re: JH7110 - VF2' - MARC

Any suggestions? Thanks!

1 Like

Those problem are probably related to this (search for “delay”):
https://lore.kernel.org/lkml/be30446c-f350-471d-bfac-b4b8dc0a75a2@starfivetech.com/
(The M.2 SSD 970 EVO Plus mentioned in the OpenBSD mailing list is a 250GB/500GB/1TB or 2TB SSD with 2GB of LPDDR4 SDRAM which supports PCIe 3.0 x4 - Idle (ASPT on) 30 mW ; Active (Avg.) Read 5.5W ; Active (Avg.) Write 6.0W - so under average usage it could potentially require 11.5 watts or at 3.3 volts nearly 3.5 amps of current, I can not find any information about peak power requirements, but that could be very high indeed for a few microseconds to milliseconds)

At a guess the very large and very fast (very higher power) NVMe devices draw so much current that they are glitching the power and clocks of the VF2, and it needs an extra delay beyond what the specification suggests for them to both stabilise before the NVMe can be accessed.

1 Like

Thanks again @mzs

So basically what you are saying is that this needs to get fixed in OpenBSD ?

1 Like

I’d call it a software compatibility workaround, instead of an actual fix, because every time a NVMe device changes from idle to active there would be a small extra delay before being able to access data simply because there is not enough power available for the device to jump from idle to maximum power usage nearly instantaneously.

I’m not even sure if a hardware bodge like a high value electric capacitor (Think of it as a temporary power reservoir, that would slowly refill when idle) placed very close to the NVMe socket would fix the problem since the highend NVMe devices just require so much power.

EDIT A better option might be to update the NVME_QUIRKS with new problematic devices. And only add the longer delays for devices that actually need it. That way all the smaller lower power devices will still achieve optimal performance. But then the assumption would be that they had QUIRKS on all systems not just the VF2, which is probably an invalid assumption.

1 Like

Hi I am an openkylin community developer, I am trying to make the openkylin image support edk2 UEFI boot, please do you know how to modify the VF2 release image to make it boot with edk2 UEFI, and then repackage as an image

hi,
I tried to build “JH7110 VF2 JUNE 2023”, it build successfully. But when i tried it with SD card on visionfive2 board it stuck in DTBFV section as follows:
U-Boot SPL 2021.10-00002-gac0ac69625-dirty (Jun 23 2023 - 12:26:55 +0800)
DDR version: dc2e84f0.
Trying to boot from MMC2
Use DBT FV
FindFfsFileAndSection: DBT FV at 0x40840000
FindFfsFileAndSection: Get firmware file section
FsUeUU ssseeDeB DDTD BBBTTFTV FF
FVVV

i
0 FFnFiidiFnnnddfdsFFFffFfisssFFlFeiiillAlneeeAAdASnnnddedcSSSeeteicccttotniiioo:o nnn::D:B DDTD BBBTTFTV FF FaVVV t aaatt0tx 00400xxx44844000880804440000000000
i000

oFFnFdiiinnFnfdddFFsFFfffssislFFFiieiAllleenedAAAnnSnedddSScSteeeccicotttiini:ooonn nG::: e tGGGee efttt i rfffiimiwrrrmmamrwwwaaea rrreefei fflfeiiill lseee e cssseeteicccttotniiioo
ennn

vice Tree at 0x40840064
HART number: 0x4
HART index to HART ID:
Index: 0 → Hard ID: 1
Index: 1 → Hard ID: 2
Index: 2 → Hard ID: 3
Index: 3 → Hard ID: 4

Any solution for this problem? please help me on this topic.

1 Like

hi john,
I was trying to build UEFI and along with above problem, one more problem is there which is as follows:

U-Boot SPL 2021.10 (Jul 18 2024 - 05:59:15 -0400)
LPDDR4: 8G version: g8ad50857.
Trying to boot from MMC2
Use DBT FV
FindFfsFileAndSection: DBT FV at 0x403A0000
FindFfsFileAndSection: FV at 403A0000 does not have FV header signature
VsUUUses see eD B DDBDTB BTT TF V FFVF
FV
F
i
0 FniFnidiFndnFdfdsFfFsfFfisFsiFlFeilielAlneAenAdASndnSdedcSeSceteictcitotnioino:o n:n :D:B D BDTD BTB 0
00
FFi

r nFiFnidiFndnFdfdsFfFsfFfisFsiFlFeilielAlneAenAdASndnSdedcSeSceteictcitotnioino:o n:n :F:V F VF FaV Vr
Pe
latform Device Tree is not found on boot hart
ASSERT /home/riscv/UEFI_apr2023/edk2-platforms/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c(6)

please help me to solve this, I really want solution?

U-Boot SPL加载固件的时候,有个size限制,好像是200K,所以换成UEFI的固件,只能加载fd文件的前200K。可以改下uboot spl代码,把size改成8M以上试试

hi edenzhang,
Thanks for reply. I tried this solution by updating the CONFIG_SPL_MAX_SIZEmacro from include/configs/starfive-visionfive2.h but still same problem is there.

Any other solution?

Thaks,
Rushikesh

不是改这块,我当时改的是这个文件common\spl\spl.c中的CONFIG_SYS_MONITOR_LEN 这个宏,默认的是200*1024,改成0x900000(不一定是这个数值,需要根据你编译出来的UEFI固件文件的大小修改),然后重新编译,重新烧录SPL

I tried this solution also, but still it is not working.

  1. 你确认UEFI 的fdf和dsc文件已经添加DeviceTree模块?
  2. 那你把 0x403A0000 ~0x403A0000+0x2000内存里面的数据打印出来。然后和你UEFI fd文件中的这个地址(fdf.inc或fdf定义的Device Tree的地址)进行比较,以此来确认下SPL是否已经读取flash中的fd文件并加载到内存中执行

I am using EDK-II source from starfive-tech · GitHub this site. They already added the DeviceTree modules in that files.

  1. 这样的话,就不是UEFI固件的问题,还是UBOOT SPL的问题。还是确认下,SPL是否已经将完整的UEFI固件加载到内存中
  2. DEBUG信息打印的是DBT FV at 0x403A0000,但是JH7110.fdf.inc里面显示DTB的offset和size是这个数值。你修改过代码?
    image

追溯了下我之前的调试记录,之前也是报过这样的问题。更新Uboot-SPL后就可以了,但是更新的哪个版本,我忘记了 :joy:。建议SPL和UEFI直接用官网的二进制,先别自己编译

Hi edenzhang,
I tried all ways but still it was stucked at same point any other solution is there please let me know.

hi johnchewyy,
I tried the “JH7110 VF2 APR 2023” edk-II source code to build the JH7110.fd file. But this also stuck at same point as “JH7110 VF2 JUNE 2023” and i am using the u-boot-spl.bin.normal.out from released, Please share your opinion why it was stuck at that point? and also please provide if any solution is there.

Thanks.

1 Like

Hi Rushi,

Have you try the sdcard.img ?

Currently our latest EDK2 no longer booting with OpenSBI payload method.
We have moved to dynamic. The code is not available in StarFive official github yet.

We will push the code to our official page once it is ready.

Please stay tune. :blush:

3 Likes

yeah, I tried with sdcard.img. There is also not working.

2 Likes