P550 buggy/unreliable u-boot only able to execute EFI from usb/sdmmc a percentage of the time

106 views
Skip to first unread message

Matthew Croughan

unread,
Dec 12, 2024, 9:14:11 AM12/12/24
to devboard-community
Has anybody else encountered that the bootchain that ships with the board, or a bootchain using the u-boot able to be compiled from https://github.com/eswincomputing/u-boot/tree/u-boot-2024.01-EIC7X is unable to load EFI binaries such as systemd-boot or edk2 efi shell reliably? Below are some of the error types I've managed to catch, output from systemd-boot and edk2 efi shell.

Unknown Relocation off 106f7f type f
Error loading \EFI\EDK2-UEFI-SHELL\SHELL.EFI: Load error
## Application failed, r = 1
Boot failed (err=-22)

EFI stub: Decompressing Linux Kernel...
EFI stub: EFI_RNG_PROTOCOL unavaEFI stub: ERROR: EFI decompressor: ZSTD-compressed data is corrupt
EFI stub: ERROR: EFI decompressor: Decompression failed
Error starting kernel image: Device error
Failed to execute NixOS 25.05 (Warbler) (\EFI\Linux\nixos.efi): Device error
I'd say something like 1 in 10 tries, I am able to boot Linux and everything works fine. And I have never been able to get it working via USB, only via SDMMC.

Is there a u-boot patch to fix this? Or am I misguided in believing it be a bug in u-boot?

Cheers,

Matt

Matthew Croughan

unread,
Dec 12, 2024, 10:11:57 AM12/12/24
to Heinrich Schuchardt, devboard-community
I just noticed that a newer bootchain is available at https://github.com/sifive/freedom-u-sdk/releases/download/2024.11.00-HFP550/bootloader_ddr5_secboot.bin and noticed some newer som-firmware squirreled away in a wip branch here, https://github.com/sifive/hifive-premier-p550-tools/tree/hf-prem-wip/som-firmware

I haven't tried the som-firmware in my own bootchain, but I can confirm that I see the same behavior with the newer bootchain from the freedom-u-sdk releases page.

Cheers,

Matt

On Thursday, December 12th, 2024 at 3:00 PM, Matthew Croughan <ma...@croughan.sh> wrote:
When I was given the board, it shipped with:

U-Boot 2024.01 (Aug 30 2024 - 10:46:19 +0000)

I should also note that the Ubuntu build it shipped with is unable to see the SD MMC even once Linux is loaded. There is never an issue loading from the EMMC from u-boot, though it uses Image.gz direct kernel boot, so it is a different flow.

Whether using on-board Ubuntu, or another distribution (NixOS in my case), the kernel responds like this to the SD MMC

[    2.577872] mmc1: error -84 reading general info of SD ext reg
[    2.583832] mmc1: error -84 whilst initialising SD card

So I built and uploaded my own bootchain using the following revisions, though it did not change the behavior I describe.

Additionally, it is worth noting that my upgrade to OpenSBI 1.5.1 (shipped with 1.4) with the meta-sifive patches works fine, though doesn't change any behavior.

https://github.com/eswincomputing/Esbd-77serial-nsign @ 74e7c69b812923f68ef3eeb0c1cbbee90f80b566
https://github.com/eswincomputing/u-boot/tree/u-boot-2024.01-EIC7X @ eab538b697011b866aba64938ef045e67fa08dc2 (u-boot-2024.01-EIC7X) with patches from meta-sifive
https://github.com/riscv-software-src/opensbi/tree/v1.5.1 @ 43cace6c3671e5172d0df0a8963e552bb04b7b20 with patches from meta-sifive

https://github.com/sifive/hifive-premier-p550-tools/ @ a53157562a6df2cee64aff8b49be13c42d900192
  providing:
    second_boot_fw.bin
    ddr_fw.bin
 

The list of patches I'm using are:


OpenSBI:

    "0001-platform-Add-ESWIN-EIC770x-platform.patch"
    "0002-EIC770X-Added-changes-to-write-Fractional-register.patch"
    "0003-platform-eswin-Add-eic770X-UART-driver.patch"
    "0004-platform-eswin-Add-shutdown-and-reset-function.patch"
    "0005-lib-sbi-Configure-CSR-registers.patch"
    "0006-lib-sbi-eic770x-Add-PMP-for-TOR-region.patch"
    "0007-sbi-init-Modify-CSR-values.patch"
    "0008-lib-sbi-Add-new-PMP-region.patch"

U-Boot:
    "0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch"
    "0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch"
    "0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch"
    "0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch"
    "0005-riscv-dts-Add-few-PMU-events.patch"
    "0006-riscv-sifive-fu740-reduce-DDR-speed-from-1866MT-s-to.patch"

Since I'm using Nix, my build timestamps are now 1980, and so not very useful anymore. But it at least proves my es_burn worked, and that my custom bootchain works.

Cheers,

Matt

On Thursday, December 12th, 2024 at 2:42 PM, Heinrich Schuchardt <heinrich....@canonical.com> wrote:


I have been using eMMC, SD-Card, and SATA as boot devices. These work fine for me booting Ubuntu.

This is the U-Boot build on my board:
U-Boot 2024.01 (Nov 06 2024 - 05:26:46 +0000)

What is the build date of your vendor U-Boot?
Which tags have you been using to build your own firmware?

Best regards

Heinrich


Rahul Moorkoth

unread,
Dec 20, 2024, 9:17:27 AM12/20/24
to RISC-V Developer Board Community, Matthew Croughan, devboard-community, Heinrich Schuchardt
Hi Matthew,

Could you try flashing the latest release and share the complete boot logs here if the issue persists?  

Matthew Croughan

unread,
Jan 4, 2025, 10:08:23 PMJan 4
to devboard-...@riscv.org

I still get "Not a PE-COFF File" errors when and UEFI application load failures on the p550 when using the bootchain from the release you linked. Below is all I get.

=> ls usb 0
            EFI/
            loader/
       88   ubootefi.var

Not a PE-COFF file


Error loading \EFI\EDK2-UEFI-SHELL\SHELL.EFI: Load error
## Application failed, r = 1
Boot failed (err=-22)

To unsubscribe from this group and stop receiving emails from it, send an email to devboard-commun...@riscv.org.

Matthew Croughan

unread,
Jan 5, 2025, 2:30:23 PMJan 5
to devboard-...@riscv.org

Using the latest commits from https://github.com/eswincomputing/u-boot/tree/u-boot-2024.01-EIC7X fixed this for me. Now UEFI USB Boot works fine.

Reply all
Reply to author
Forward
0 new messages