diff --git a/conf/machine/freedom-u540.conf b/conf/machine/freedom-u540.conf index bb117f8..18a3264 100644 --- a/conf/machine/freedom-u540.conf +++ b/conf/machine/freedom-u540.conf @@ -7,30 +7,28 @@ require conf/machine/include/tune-riscv.inc MACHINE_FEATURES = "screen keyboard ext2 ext3 serial" -KERNEL_IMAGETYPE = "vmlinux" +# This must be vmlinux for bbl to work and Image for openSBI +KERNEL_IMAGETYPE = "Image" PREFERRED_PROVIDER_virtual/kernel ?= "linux-riscv" PREFERRED_VERSION_linux-riscv ?= "5.0%" GDBVERSION = "riscv" -EXTRA_IMAGEDEPENDS += "riscv-pk" +EXTRA_IMAGEDEPENDS += "opensbi" +RISCV_SBI_PLAT = "sifive/fu540" +# When we have better openSBI -> u-boot -> kernel support in released +# versions of u-boot and Linux kernel swap to u-boot binary here. +# RISCV_SBI_PAYLOAD ?= "u-boot-${MACHINE}.bin" +RISCV_SBI_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin" +# Override the DTB from the firmware with this one from openSBI +# Use this to add Microsemi Expansion board support +# RISCV_SBI_FDT ?= "HiFiveUnleashed-MicroSemi-Expansion.dtb" SERIAL_CONSOLE = "115200 console" MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" -# The following options can be used to build images that use initramfs, -# since the SPI controller driver currently still has an issue, using this -# might speed up your boot process signifcantly -# -#RISCV_BBL_PAYLOAD ?= "${KERNEL_IMAGETYPE}${KERNEL_INITRAMFS}-${MACHINE}.bin" -#INITRAMFS_IMAGE_BUNDLE = "1" -#INITRAMFS_IMAGE = "riscv-initramfs-image" -#KERNEL_INITRAMFS = '-initramfs' - -RISCV_BBL_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin" - IMAGE_FSTYPES_append = " wic.gz ext4" # Do not update fstab file when using wic images @@ -40,12 +38,12 @@ IMAGE_BOOT_FILES = "" ### wic default support WKS_FILE_DEPENDS ?= " \ - riscv-pk \ + opensbi \ e2fsprogs-native \ bmap-tools-native \ " -WKS_FILE ?= "freedom-u540-bbl.wks" +WKS_FILE ?= "freedom-u540-opensbi.wks" BAD_RECOMMENDATIONS += "\ libcxx-dev \ diff --git a/wic/freedom-u540-opensbi.wks b/wic/freedom-u540-opensbi.wks new file mode 100644 index 0000000..54b846f --- /dev/null +++ b/wic/freedom-u540-opensbi.wks @@ -0,0 +1,6 @@ +# short-description: Create SD card image for HiFive Unleashed development board + +part opensbi --source rawcopy --sourceparams="file=fw_payload.bin" --ondisk mmcblk --align 1 --part-type 2e54b353-1271-4842-806f-e436d6af6985 +part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096 --size 5G + +bootloader --ptable gpt