Conversation

Jarkko Sakkinen

Edited 1 year ago
Nice, with the DIP switches Starfive VisionFive 2 SBC can be made to boot the full chain from SD card. Initially booting from SPI flash for any possible use for this never really makes sense. It is a badly chosen default for this sort of maker and/or developer product :-) #riscv #opensbi #uboot #starfive #visionfive2 #keystone
2
0
1

@jarkko sorry, can you explain your solution a bit more? I am very interested.

1
0
0

@jarkko I'm not saying you are wrong, I'm just trying to understand. Where is the bootloader that loads from SDcard? In other words, what is the full stack and what did you think it should be?

1
0
0
@tommythorn there's first stage loader, which loads either from internal flash or SD card with specific partition structure. I've based my experiments on U-boot documentation: https://docs.u-boot.org/en/latest/board/starfive/visionfive2.html.
2
0
0
@tommythorn Legit question but yeah for stuff that I'm doing with it being able to supply U-boot and OpenSBI is great.
0
0
0
@adingbatponder I just went to U-boot homepage to see what they have on the board. See the link in the previous comment.
1
0
0

@jarkko But where is the first stage loader? IOW, is there a level 0 bootloader in ROM in the SOC that knows how to load from SDcard? That would seem like an awful lot of policy to commit to ROM. Normally the level 0 bootloader can only load the next loader from something like SPI ROM, which can then load from wherever (and can be updated to fix bugs, add features).

I looked at the document, but it's unclear to me. AFAICT, all the bootloaders they talk about can be updated.

1
0
0

@jarkko AFAICT, it works like I expected: the 1st level boot loader is the U-Boot SPL which lives in the SPI Flash "ROM". However *it* is loaded by an unnamed level zero bootloader. From there everything proceeds as per SPL, which can load from many places and presumably is the one reading the MSEL dip switches.

1
0
0
@tommythorn Yeah, I have no idea at this point what is the early boot code in this board. Even if you completely brick the SPI flashed firmware you can boot the board in "UART mode" and flash it. So there's something below with quite a bit of functionality.
1
0
0

@jarkko As it happens I just hosed my Ubuntu installation on the VF2; after `do-release-upgrade -d` it doesn't appear to be able to see the SDcard:

[ 3.116941] /dev/root: Can't open blockdev
[ 3.121104] VFS: Cannot open root device "UUID=a9631c0e-efc4-4d89-8fb6-b71837b37c62" or unknown-block(0,0): error -6
[ 3.131673] Please append a correct "root=" boot option; here are the available partitions:
[ 3.140073] List of all bdev filesystems:

I suspect I should start over

1
0
0
@adingbatponder search for "iu-boot documentation visionfive 2" if there is problem with the link :-) it is just official u-boot dociumentation.
0
0
0
@tommythorn yeah, my usage model for SBC"s is such that I most of the time have a new image per boot because I use the image just to test e.g. a code change to kernel or sometimes firmware. like e.g. with this one i have not ever even tried to connect it to a network or display, all comms through TTL-USB. if you test e.g. kernel on many different SBC's, then a workflow is required where you do not need to connect many cables. surviving with just USB power and TTL-USB with the whole range is optimal because all SBC's I know follow the same GPIO layout as RPi.
0
0
0