board/visionfive2: enable u-boot

Enables U-Boot and required OpenSBI builds for the VisionFive2. Changes
the sdcard.img to use GPT and adds the SPL and U-Boot to partitions
specified in U-Boot's documentation for the board:

https://docs.u-boot.org/en/v2024.01/board/starfive/visionfive2.html

U-Boot config uses BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME with value
"u-boot.itb". Using BR2_TARGET_UBOOT_FORMAT_ITB fails, because the
build does not support u-boot.itb make target.

Signed-off-by: Lukasz Tekieli <tekieli.lukasz@gmail.com>
[Peter: document boot mode setting, add U-Boot documentation link]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Lukasz Tekieli 2024-02-08 22:15:17 +01:00 committed by Peter Korsgaard
parent 9d48748199
commit 6dfeb165ee
3 changed files with 32 additions and 7 deletions

View File

@ -2,20 +2,22 @@
image sdcard.img {
hdimage {
partition-table-type = "gpt"
}
# u-boot is hard coded to look at 3rd partition
partition dummy1 {
size = 512
partition spl {
partition-type-uuid = 2E54B353-1271-4842-806F-E436D6AF6985
image = "u-boot-spl.bin.normal.out"
}
partition dummy2 {
size = 512
partition uboot {
partition-type-uuid = BC13C2FF-59E6-4262-A352-B275FD6F7172
image = "u-boot.itb"
}
partition rootfs {
partition-type = 0x83
partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4
bootable = true
image = "rootfs.ext4"
bootable = "true"
}
}

View File

@ -27,6 +27,10 @@ Preparing the board
Connect a TTL UART cable to pin 6 (GND), 8 (TX) and 10 (RX).
Change the boot mode pins to SD card booting (RGPIO_0=1, GRPIO_1=0):
https://doc-en.rvspace.org/VisionFive2/Quick_Start_Guide/VisionFive2_SDK_QSG/boot_mode_settings.html
Insert your SD card.
Power-up the board using an USB-C cable.

View File

@ -15,4 +15,23 @@ BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
# BR2_TARGET_ROOTFS_TAR is not set
BR2_TARGET_OPENSBI=y
BR2_TARGET_OPENSBI_CUSTOM_VERSION=y
BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE="1.4"
BR2_TARGET_OPENSBI_PLAT="generic"
# BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG is not set
BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES="FW_TEXT_START=0x40000000 FW_OPTIONS=0"
BR2_TARGET_UBOOT=y
BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
BR2_TARGET_UBOOT_CUSTOM_VERSION=y
BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.01"
BR2_TARGET_UBOOT_BOARD_DEFCONFIG="starfive_visionfive2"
BR2_TARGET_UBOOT_NEEDS_DTC=y
BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
BR2_TARGET_UBOOT_NEEDS_OPENSBI=y
# BR2_TARGET_UBOOT_FORMAT_BIN is not set
BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
BR2_TARGET_UBOOT_SPL=y
BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin.normal.out"
BR2_PACKAGE_HOST_GENIMAGE=y