On Sat, Jan 07, 2023 at 07:49:36PM -0700, Simon Glass wrote: > So far, standard boot does not replicate all the of the functionality > of the distro_bootcmd scripts. In particular it lacks some bootdevs and > some of the bootmeths are incomplete. > > Also there is currently no internal mechanism to enumerate buses in order > to discover bootdevs, e.g. with USB. > > This series addresses these shortcomings: > > - Adds the concept of a 'bootdev hunter' to enumerate buses, etc. in an > effort to find bootdevs of a certain priority > - Adds bootdevs for SCSI, IDE, NVMe, virtio, SPI flash > - Handles PXE and DHCP properly > - Supports reading the device tree with EFI and reading scripts from the > network > > It also tidies up label processing, so it is possible to use: > > bootflow scan mmc2 > > to scan just one MMC device (with BOOTSTD_FULL). > > As before this implementation still relies on CONFIG_CMDLINE being > enabled, mostly for the network stack. Further work would be required to > disentangle that. > > Quite a few tests are added but there are some gaps: > > - SPI flash bootdev > - EFI FDT loading > > Note that SATA works via SCSI (CONFIG_SCSI_AHCI) and does not use > driver model. Only pogo_v4 seems to be affected. Probably all thats is > needed is to call bootdev_setup_sibling_blk() in the Marvell SATA driver. > > Also, while it would be possible to init MMC in a bootdev hunter, there is > no point since U-Boot always inits MMC on startup, if present. > > With this series it should be possible to migrate boards to standard boot > by removing the inclusion of config_distro_bootcmd.h and instead adding > a suitable value for boot_targets to the environment, e.g.: > > boot_targets=mmc1 mmc0 nvme scsi usb pxe dhcp spi > > Thus it is possible to boot automatically without scripts and boards can > use a text-based environment instead of the config.h files. > > To demonstrate this, rockpro64-rk3399 is migrated to standard boot in this > series. Full migration could probably be automated using a script, similar > in concept to moveconfig: > > - obtain the board environment via 'make u-boot-initial-env' > - get the value of "boot_targets" > - drop config_distro_bootcmd.h from the config.h file > - rebuild again to get the environment without distro scripts > - write the environment (adding boot_targets) to board.env > - remove CONFIG_EXTRA_ENV_SETTINGS from the config.h file > > This series is based on top of the boot menu series v3 [1]. > The tree is available at u-boot-dm/dis-working > > [1] https://patchwork.ozlabs.org/project/uboot/list/?series=335364 > > Changes in v2: > - Rebase to -next
A small problem is that patch 62 was missing, but I could rebase v1 easily enough. A number of other patches needed to be rebased on top of Sean's source command updates for confs in FIT images to be used. I thought I got this part done right as well, but most of the new tests then failed. Please rebase again on top of current master, sorry. -- Tom
signature.asc
Description: PGP signature