From ec3e5b14d52a26531f1a315e5cced326a8323ca9 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Thu, 25 Jun 2020 18:26:04 -0700 Subject: [PATCH] docs/platform: sifive_fu540: Update U-Boot instructions U-Boot v2020.07 release adds SPL support to SiFive HiFive Unleashed. Update the doc to mention that detailed build instructions are in the U-Boot doc. This also adds detailed command line description to show how to boot U-Boot v2020.07 S-mode payload in the QEMU chapter. Signed-off-by: Bin Meng Reviewed-by: Atish Patra --- docs/platform/sifive_fu540.md | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/platform/sifive_fu540.md b/docs/platform/sifive_fu540.md index 9342846..1008432 100644 --- a/docs/platform/sifive_fu540.md +++ b/docs/platform/sifive_fu540.md @@ -41,13 +41,14 @@ make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=/arch/riscv/bo **U-Boot Payload** The command-line example here assumes that U-Boot was compiled using the -sifive_fu540_defconfig configuration and with U-Boot v2020.01 (or higher). - -The detailed U-Boot booting guide is avaialble at [U-Boot]. +sifive_fu540_defconfig configuration and with U-Boot v2020.01, and up to +v2020.07-rc3. ``` make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=/u-boot-dtb.bin ``` +For U-Boot v2020.07-rc4 or later releases, SPL support was added in U-Boot. +Please refer to the detailed U-Boot booting guide available at [U-Boot]. Flashing the OpenSBI firmware binary to storage media: ------------------------------------------------------ @@ -155,13 +156,37 @@ Linux kernel. When U-Boot v2020.01 (or higher) is used as the payload, as the SiFive FU540 DTB for the real hardware is embedded in U-Boot binary itself, due to the same reason above, we need to switch the U-Boot sifive_fu540_defconfig configuration -from CONFIG_OF_SEPARATE to CONFIG_OF_PRIOR_STAGE so that U-Boot uses the DTB -generated by QEMU, and u-boot.bin should be used as the payload image, like: +from **CONFIG_OF_SEPARATE** to **CONFIG_OF_PRIOR_STAGE** so that U-Boot uses the +DTB generated by QEMU, and u-boot.bin should be used as the payload image, like: ``` make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=/u-boot.bin ``` +U-Boot v2020.07 release added SPL support to SiFive HiFive Unleashed board, +hence a build error will be seen after you switch to **CONFIG_OF_PRIOR_STAGE**. + +``` +./tools/mkimage: Can't open arch/riscv/dts/hifive-unleashed-a00.dtb: No such file or directory +./tools/mkimage: failed to build FIT +Makefile:1402: recipe for target 'u-boot.img' failed +make: *** [u-boot.img] Error 1 +``` + +The above errors can be safely ignored as we don't run U-Boot SPL under QEMU. + +Run: +``` +qemu-system-riscv64 -M sifive_u -m 256M -nographic \ + -bios build/platform/sifive/fu540/firmware/fw_payload.bin +``` +or +``` +qemu-system-riscv64 -M sifive_u -m 256M -nographic \ + -bios build/platform/sifive/fu540/firmware/fw_jump.bin \ + -kernel /u-boot.bin +``` + While the real hardware operates at the 64-bit mode, it's possible for QEMU to test the 32-bit OpenSBI firmware. This can be helpful for testing 32-bit SiFive specific drivers.