summaryrefslogtreecommitdiff
path: root/boot/bootmeth-uclass.c
AgeCommit message (Collapse)Author
2023-01-23bootstd: Add a new bootmeth method to set the bootflowSimon Glass
Normally the bootmeth driver reads the bootflow from the bootdev, since it knows the correct way to do it. However it is easier for some bootdevs to handle this themselves. For example, reading from SPI flash is quite different from other devices. Add a way for the bootdev to pass a bootflow to the bootmeth, so that this can be supported. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-16bootstd: Allow reading a logo for the OSSimon Glass
Some operating systems provide a logo in bmp format. Read this in if present so it can be displayed in the menu. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-31bootstd: Add a way to set up a bootflowSimon Glass
Add a function to init a bootflow, to reduce code duplication. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-12bootstd: Allow scanning for global bootmeths separatelySimon Glass
Typically we want to find and use global bootmeths first, since they have the best idea of how the system should boot. We then use normal bootmeths as a fallback. Add the logic for this, putting global bootmeths at the end of the ordering. We can then easily scan the global bootmeths first, then drop them from the list for subsequent bootdev-centric scans. This changes the ordering of global bootmeths, so update the bootflow_system() accordingly. Drop the comment from bootmeth_setup_iter_order() since this is an exported function and it should be in the header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-12bootstd: Allow bootmeths to be marked as globalSimon Glass
The current way of handling things like EFI bootmgr is a bit odd, since that bootmeth handles selection of the bootdev itself. VBE needs to work the same way, so we should support it properly. Add a flag that indicates that the bootmeth is global, rather than being invoked on each bootdev. Provide a helper to read a bootflow from the bootmeth. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-12bootstd: Provide a bootmeth method to obtain state infoSimon Glass
Some bootmeths can provide information about what is available to boot. For example, VBE simple provides access to the firmware state. Add a new method for this, along with a sandbox test. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-12bootstd: Detect empty bootmeth orderingSimon Glass
If the ordering produces no entries, this is an error. Report it, so that the caller doesn't try to continue with a NULL bootmeth. This fixes a crash in the bootflow_iter test when running with the sandbox 'default' device tree, instead of the required 'test' one. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25bootstd: Add the bootmeth uclass and helpersSimon Glass
A bootmeth is a method of locating an operating system. For now, just add the uclass itself. Drivers for particular bootmeths are added later. If no bootmeths devices are included in the devicetree, create them automatically. This avoids the need for boilerplate in the devicetree files. Signed-off-by: Simon Glass <sjg@chromium.org>