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 /doc/usage/cmd | |
| 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 'doc/usage/cmd')
| -rw-r--r-- | doc/usage/cmd/bootdev.rst | 48 | ||||
| -rw-r--r-- | doc/usage/cmd/bootflow.rst | 17 | ||||
| -rw-r--r-- | doc/usage/cmd/dm.rst | 5 |
3 files changed, 64 insertions, 6 deletions
diff --git a/doc/usage/cmd/bootdev.rst b/doc/usage/cmd/bootdev.rst index 5e02e32c514..6c68d0bf840 100644 --- a/doc/usage/cmd/bootdev.rst +++ b/doc/usage/cmd/bootdev.rst @@ -8,9 +8,10 @@ Synopis :: - bootdev list [-p] - list all available bootdevs (-p to probe)\n" - bootdev select <bm> - select a bootdev by name\n" - bootdev info [-p] - show information about a bootdev"; + bootdev list [-p] - list all available bootdevs (-p to probe) + bootdev hunt [-l|<spec>] - use hunt drivers to find bootdevs + bootdev select <bm> - select a bootdev by name + bootdev info [-p] - show information about a bootdev Description ----------- @@ -63,6 +64,17 @@ Name: with `.bootdev` +bootdev hunt +~~~~~~~~~~~~ + +This hunts for new bootdevs, or shows a list of hunters. + +Use `-l` to list the available bootdev hunters. + +To run hunters, specify the name of the hunter to run, e.g. "mmc". If no +name is provided, all hunters are run. + + bootdev select ~~~~~~~~~~~~~~~~~ @@ -83,7 +95,7 @@ This shows information on the current bootdev, with the format looking like this: ========= ======================= -Name [email protected] +Name `[email protected]` Sequence 0 Status Probed Uclass mmc @@ -128,6 +140,34 @@ one of them:: Uclass: mmc Bootflows: 1 (1 valid) +This shows using one of the available hunters, then listing them:: + + => bootdev hunt usb + Hunting with: usb + Bus usb@1: scanning bus usb@1 for devices... + 3 USB Device(s) found + => bootdev hunt -l + Prio Used Uclass Hunter + ---- ---- --------------- --------------- + 6 ethernet eth_bootdev + 1 simple_bus (none) + 5 ide ide_bootdev + 2 mmc mmc_bootdev + 4 nvme nvme_bootdev + 4 scsi scsi_bootdev + 4 spi_flash sf_bootdev + 5 * usb usb_bootdev + 4 virtio virtio_bootdev + (total hunters: 9) + => usb stor + Device 0: Vendor: sandbox Rev: 1.0 Prod: flash + Type: Hard Disk + Capacity: 4.0 MB = 0.0 GB (8192 x 512) + Device 1: Vendor: sandbox Rev: 1.0 Prod: flash + Type: Hard Disk + Capacity: 0.0 MB = 0.0 GB (1 x 512) + => + Return value ------------ diff --git a/doc/usage/cmd/bootflow.rst b/doc/usage/cmd/bootflow.rst index aa12dc2e3ab..cad09bbec9a 100644 --- a/doc/usage/cmd/bootflow.rst +++ b/doc/usage/cmd/bootflow.rst @@ -8,7 +8,7 @@ Synopis :: - bootflow scan [-abel] [bootdev] + bootflow scan [-abelGH] [bootdev] bootflow list [-e] bootflow select [<num|name>] bootflow info [-d] @@ -57,6 +57,16 @@ Flags are: is happening during scanning. Use it with the `-b` flag to see which bootdev and bootflows are being tried. +-G + Skip global bootmeths when scanning. By default these are tried first, but + this flag disables them. + +-H + Don't use bootdev hunters. By default these are used before each boot + priority or label is tried, to see if more bootdevs can be discovered, but + this flag disables that process. + + The optional argument specifies a particular bootdev to scan. This can either be the name of a bootdev or its sequence number (both shown with `bootdev list`). Alternatively a convenience label can be used, like `mmc0`, which is the type of @@ -145,6 +155,7 @@ Subdir (none) Filename /extlinux/extlinux.conf Buffer 3db7ad48 Size 232 (562 bytes) +FDT: <NULL> Error 0 ========= =============================== @@ -169,6 +180,10 @@ Buffer Size Size of the bootflow file +FDT: + Filename of the device tree, if supported. The EFI bootmeth uses this to + remember the filename to load. If `<NULL>` then there is none. + Error Error number returned from scanning for the bootflow. This is 0 if the bootflow is in the 'loaded' state, or a negative error value on error. You diff --git a/doc/usage/cmd/dm.rst b/doc/usage/cmd/dm.rst index 7bc1962a754..236cd02bd62 100644 --- a/doc/usage/cmd/dm.rst +++ b/doc/usage/cmd/dm.rst @@ -12,7 +12,7 @@ Synopis dm devres dm drivers dm static - dm tree + dm tree [-s] dm uclass Description @@ -123,6 +123,9 @@ Name Shows the device name as well as the tree structure, since child devices are shown attached to their parent. +If -s is given, the top-level devices (those which are children of the root +device) are shown sorted in order of uclass ID, so it is easier to find a +particular device type. dm uclass ~~~~~~~~~ |
