Skip to content

Where to add/fix boot targets? #51

@MichaIng

Description

@MichaIng

Generic boot, i.e. scanning through all defined boot targets for bootable partitions, is currently broken. The relevant part of the default/embedded U-Boot environment looks like this:

bootcmd=run load_vf2_env;run importbootenv;run boot2; run scan_boot_dev; run load_distro_uenv;run distro_bootcmd
distro_bootcmd=setenv nvme_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
boot_targets=mmc0 dhcp
devnum=1
bootcmd_mmc0=devnum=0; run mmc_boot

So as long as there is not uEnv.txt on a 3rd partition with a FAT filesystem, it tries the mmc0 target. It looks like it would set devnum to 0, but actually it doesn't, as the syntax is wrong. So it remains at default value 1, which is the SD card.

Since last U-Boot update, with NVMe support added, as fast as any NVMe card is attached, it sets devnum to 0 correctly, aiming to boot from NVMe device 0. However, there is no nvme0 boot target, so it again tries to boot from mmc0. As now devnum is 0, which is the eMMC slot, it does not boot from SD card anymore as it used to prior to the U-Boot update.

Basically what we want, for generic boot support, is this:

boot_targets=mmc1 mmc0 nvme0 dhcp
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_mmc1=setenv devnum 1; run mmc_boot
bootcmd_nvme0=setenv devnum 0; run nvme_boot
  • All boot targets added, in the order SD card > eMMC > NVMe > DHCP
  • The mmc0 boot command now does really set devnum to 0 with the correct setenv command (devnum=0 is incorrect syntax).
  • mmc1 SD card boot command added.
  • nvme0 NVMe boot command added.

I wanted to fix/add those environment variables, but I cannot find them. Neither boot_targets, nor bootcmd_mmc0 is defined here: https://github.com/MichaIng/u-boot/blob/JH7110_VisionFive2_devel/include/configs/starfive-visionfive2.h

Would if work if we add them here to the end of the CONFIG_EXTRA_ENV_SETTINGS variable, just in case BOOTENV or BOOTENV_SF sets them, where ever those are defined?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions