diff options
| author | Tom Rini <[email protected]> | 2023-01-24 14:04:14 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-01-24 14:04:14 -0500 |
| commit | 4e1ab2065e21e48a3087144ab826f12cfb797a65 (patch) | |
| tree | 1dc9e793258c5a4a1be4d5e6d554f7f1a82450f3 /include/vsprintf.h | |
| parent | dd31cd58b02729807934cb699b164b1f8736620f (diff) | |
| parent | 3891c68ef50eda38d78c95ecd03aed030aa6bb53 (diff) | |
Merge branch '2023-01-24-bootstd-allow-migration-from-distro_bootcmd-script'
To quote the author:
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
Diffstat (limited to 'include/vsprintf.h')
| -rw-r--r-- | include/vsprintf.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/vsprintf.h b/include/vsprintf.h index e006af200fd..ed8a060ee17 100644 --- a/include/vsprintf.h +++ b/include/vsprintf.h @@ -329,6 +329,30 @@ char *strmhz(char *buf, unsigned long hz); void str_to_upper(const char *in, char *out, size_t len); /** + * str_to_list() - Convert a string to a list of string pointers + * + * Splits a string containing space-delimited substrings into a number of + * separate strings, e.g. "this is" becomes {"this", "is", NULL}. If @instr is + * empty then this returns just {NULL}. The string should have only a single + * space between items, with no leading or trailing spaces. + * + * @instr: String to process (this is alloced by this function) + * Returns: List of string pointers, terminated by NULL. Each entry points to + * a string. If @instr is empty, the list consists just of a single NULL entry. + * Note that the first entry points to the alloced string. + * Returns NULL if out of memory + */ +const char **str_to_list(const char *instr); + +/** + * str_free_list() - Free a string list + * + * @ptr: String list to free, as created by str_to_list(). This can also be + * NULL, in which case the function does nothing + */ +void str_free_list(const char **ptr); + +/** * vsscanf - Unformat a buffer into a list of arguments * @inp: input buffer * @fmt0: format of buffer |
