aboutsummaryrefslogtreecommitdiff
path: root/test/boot
AgeCommit message (Collapse)Author
2023-10-23bootstd: Scan all bootdevs in a boot_targets entry (take 2)Simon Glass
When the boot_targets environment variable is used with the distro-boot scripts, each device is included individually. For example, if there are three mmc devices, then we will have something like: boot_targets="mmc0 mmc1 mmc2" In contrast, standard boot supports specifying just the uclass, i.e.: boot_targets="mmc" The intention is that this should scan all MMC devices, but in fact it currently only scans the first. Update the logic to handle this case, without required BOOTSTD_FULL to be enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Date Huang <tjjh89017@hotmail.com> Reported-by: Vincent Stehlé <vincent.stehle@arm.com> Reported-by: Ivan Ivanov <ivan.ivanov@suse.com> Tested-by: Ivan T.Ivanov <iivanov@suse.de>
2023-10-23bootstd: Correct logic for single uclassSimon Glass
The current logic for "bootflow mmc" is flawed since it checks the uclass of the bootdev instead of its parent, the media device. Correct this and add a test that covers this scenario. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ivan T.Ivanov <iivanov@suse.de>
2023-10-23bootstd: Expand boot-ordering test to include USBSimon Glass
Scan the USB bus as well, so we can check that different uclasses work correctly in boot_targets update the function comment with more detail. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ivan T.Ivanov <iivanov@suse.de>
2023-10-23Revert "bootstd: Scan all bootdevs in a boot_targets entry"Simon Glass
This commit was intended to allow all bootdevs in each boot_targets entry to be scanned. However it causes bad ordering with bootdevs, e.g. scanning Ethernet bootdevs when it should be keeping to mmc. Revert it so we can try another approach. This reverts commit e824d0d0c219bc6da767f13f90c5b00eefe929f0. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ivan T.Ivanov <iivanov@suse.de>
2023-10-13bootstd: Scan all bootdevs in a boot_targets entrySimon Glass
When the boot_targets environment variable is used with the distro-boot scripts, each device is included individually. For example, if there are three mmc devices, then we will have something like: boot_targets="mmc0 mmc1 mmc2" In contrast, standard boot supports specifying just the uclass, i.e.: boot_targets="mmc" The intention is that this should scan all MMC devices, but in fact it currently only scans the first. Update the logic to handle this case, without required BOOTSTD_FULL to be enabled. I believe at least three people reported this, but I found two. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Date Huang <tjjh89017@hotmail.com> Reported-by: Vincent Stehlé <vincent.stehle@arm.com>
2023-10-11expo: Update tests to include textlineSimon Glass
Provide test coverage for the new expo object type, including building and reading/writing settings. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-04Merge tag 'v2023.10-rc4' into nextTom Rini
Prepare v2023.10-rc4
2023-08-28bootstd: Adjust the default bootmeth orderSimon Glass
The existing distro scripts check extlinux and scripts before EFI. Adjust the default ordering to do the same, to avoid breaking existing flows. Add some documentation, mentioning that this order will likely change in future. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Da Xue <da@libre.computer>
2023-08-26bootstd: cros: Allow detection of any kernel partitionSimon Glass
The existing ChromiumOS bootmeth only supports reading a single kernel partition, either 2 or 4. In fact there are normally two options available. Use the GUID to detect kernel partitions, with the BOOTMETHF_ANY_PART flag, so that bootstd does not require a valid filesystem before calling the bootmeth. Tidy up and improve the logging while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> [trini: Add missing select of PARTITION_TYPE_GUID] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-25bootstd: Add a test for bootmeth_crosSimon Glass
The ChromiumOS bootmeth has no tests at present. Before adding more features. add a basic test. This creates a disk which can be scanned by the bootmeth, so make sure things work. It is quite rudimentary, since the kernel is faked, the root disk is missing and there is no cmdline stored. Enable the bootmeth for snow so it can build the unit test. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25bootstd: test: Allow binding and using any mmc deviceSimon Glass
We currently use mmc4 for tests. Update the function which sets this up so that it can handle any device. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25bootflow: Show an empty filename when there is noneSimon Glass
At present 'bootflow list' shows <NULL> for the filename when it is not present. Show an empty string instead, since that is more user-friendly. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: cedit: Support reading settings from CMOS RAMSimon Glass
Add a command to read edit settings from CMOS RAM, using the cedit definition to indicate which registers and bits are used. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: cedit: Support writing settings to CMOS RAMSimon Glass
Add a command to write cedit settings to CMOS RAM so that it can be preserved across a reboot. This uses a simple bit-encoding, where each field has a 'bit position' and a 'bit length' in the schema. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: cedit: Support reading settings from environment varsSimon Glass
Add a command to read cedit settings from environment variables so that they can be restored as part of the environment. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: cedit: Support writing settings to environment varsSimon Glass
Add a command to write cedit settings to environment variables so that they can be stored with 'saveenv'. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: cedit: Support reading settings from a fileSimon Glass
Add a command to read cedit settings from a devicetree file. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: cedit: Support writing settings to a fileSimon Glass
Support writing settings from an expo into a file in FDT format. It consists of a single node with a two properties for each sceneitem, one with tag ID chosen by the user and another for its text value. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: Tidy up the expo.py tool and usageSimon Glass
Tidy up this tool a little: - define which arguments are needed - split the enum values out into a header file - warn if no enum values are found - display the dtc error if something goes wrong - avoid a Python traceback on error Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: Move cedit test into its own file and tidySimon Glass
Move this test out so it can have its own file. Rename the test to use a cedit_ prefix. This allows us to drop the check for CONFIG_CMD_CEDIT in the test. Also we don't need driver model objects for this test, so drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25expo: Provide a way to iterate through all scene objectsSimon Glass
For some operations it is necessary to process all objects in an expo. Provide an iterator to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-17bootstd: Add support for updating elements of the cmdlineSimon Glass
Add a bootflow command to update the command line more easily. This allows changing a particular parameter rather than editing a very long strings. It is also easier to handle with scripting. The new 'bootflow cmdline' command allows getting and setting single parameters. Fix up the example output while we are here, since there are a few new items. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bootstd: Add a function to update a command lineSimon Glass
The Linux command line consists of a number of words with optional values. At present U-Boot allows this to be changed using the bootargs environment variable. But this is quite painful, since the command line can be very long. Add a function which can adjust a single field in the command line, so that it is easier to make changes before booting. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Allow storing the OS command line in the bootflowSimon Glass
Some operating systems have a command line which can be adjusted before booting. Store this in the bootflow so it can be controlled within U-Boot. Fix up the example output while we are here, since there are a few new items. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-14expo: Add tests for the configuration editorSimon Glass
Add some simple tests and a helpful script to make the configuration editor easier to set up. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Support building an expo from a description fileSimon Glass
The only way to create an expo at present is by calling the functions to create each object. It is useful to have more data-driven approach, where the objects can be specified in a suitable file format and created from that. This makes testing easier as well. Add support for describing an expo in a devicetree node. This allows more complex tests to be set up, as well as providing an easier format for users. It also provides a better basis for the upcoming configuration editor. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Rename EXPOACT_POINT to EXPOACT_POINT_ITEMSimon Glass
At present we only support a single menu, so all that can be pointed to is the current menu item. Rename this action so that we can also add an action for pointing to an object. This will allow cycling through the objects in a scene. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Move menu-item selection into a functionSimon Glass
The current implementation supports a 'pointer' object which points to the currently highlighted menu item. We want to support highlighting the label of the menu item instead, e.g. with inverse video. In this case we will need to 'unhighlight' the old item and highlight the new one. As a first step, move the pointer logic into a function. This fixes a bug where the item is hidden when it should not be. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Support simple themesSimon Glass
It is a pain to manually set the fonts of all objects to be consistent. Some spacing settings are also better set globally than by manually positioning each object. Add a 'theme' to the expo, to hold this information. For now it includes only the font size. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Set up the width and height of objectsSimon Glass
Provide a way to set the full dimensions of objects, i.e. including the width and height. For menus, calculate the bounding box of all objects in the menu. Set all labels to be the same size, so that highlighting works correct, once implemented. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Use flags for objectsSimon Glass
We currently have just a 'hide' property for each object. In preparation for adding more properties, convert the struct to use a flags value, instead of individual booleans. This is more extensible. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Add width and height to objectsSimon Glass
At present objects only have a position so it is not possible to determine the amount of space they take up on the display. Add width and height properties, using a struct to keep all the dimensions together. For now this is not used. Future work will set up these new properties. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Rename exp_set_text_mode()Simon Glass
Rename this function to match its peers, using the full "expo' prefix. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Avoid automatically arranging the sceneSimon Glass
This should ideally be done once after all scene changes have been made. Require an explicit call when everything is ready. Always arrange after a key it sent, just for convenience. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Convert to using a string ID for the scene titleSimon Glass
This is easier to deal with if it uses the existing string handling, since we will be able to use translations, etc. in the future. Update it to use an ID instead of a string. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-13bootstd: Rename distro and syslinux to extlinuxSimon Glass
We use the terms 'distro' to mean extlinux but they are not really the same. 'Distro' could refer to any method of booting a distribution, whereas extlinux is a particular method. Also we sometimes use syslinux, but it is better to use the same term in all cases. Rename distro to syslinux and also update bootstd uses of syslinux to use extlinux instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-13bootstd: Tidy up reporting of errorsSimon Glass
In a few cases the error handling is not quite right. Make sure we return the actual error in distro_efi_read_bootflow_file() rather than -EINVAL. Return -IO when a file cannot be read. Also show the error name if available. This does not change operation, but does make it easier to diagnose problems. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-13bootstd: usb: Avoid initing USB twiceSimon Glass
This causes crashes on some boards, e.g. rockpro64. In any case, we should not do it. Check the usb_started flag to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Jonas Karlman <jonas@kwiboo.se> Tested-by: Tom Rini <trini@konsulko.com>
2023-05-13usb: Tidy up the usb_start flagSimon Glass
This should be declared in a header file so that type-checking works correctly. Add a single declaration to usb.h and remove the others. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2023-04-27ide: Move ide_init() into probingSimon Glass
At present the code does ide_init() as a separate operation, then calls device_probe() to copy over the information. We can call ide_init() from probe just as easily. The only difference is that using 'ide init' twice will do nothing. However it already fails to copy over the new data in that case, so the effect is the same. For now, unbind the block devices and remove the IDE device, which causes the bus to be probed again. Later patches will fix this up fully, so that all blk_desc data is copied across. Since ide_reset() is only called from ide_init(), there is no need to init the ide_dev_desc[] array. This is already done at the end of ide_init() so drop this code. The call to uclass_first_device() is now within the probe() function of the same device, so does nothing. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-04-26bootstd: Report missing labels only when askedSimon Glass
Use the -l flag to indicate whether to report missing uclasses. Also try to be more helpful when no devices are found. For example, when we see something 'scsi0' requested and nothing was found, this indicates that there are no SCSI devices, so show a suitable message. Move messages out of the low-level functions so that silent operation is possible. This means they are never reported unless BOOTSTD_FULL is enabled, since the -l flag cannot otherwise be set. Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08bootflow: Rename bootflow_flags_tSimon Glass
These flags actually relate to the iterator, not the bootflow struct itself. Rename them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06arm: qemu: Move GUIDs to the C fileSimon Glass
These are only used in one place, so move them there. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-06test: bootdev: Do not require USB to compile testLinus Walleij
This test will block compilation of the entire test suite on platforms without USB support. Make the extern "usb_started" conditional on USB host or gadget and define a dummy flag if neither is enabled. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Record the bootdevs used during scanningSimon Glass
Add a way to record the bootdevs used when scanning for bootflows. This is useful for testing. Enable this only with BOOTSTD_FULL and do the same for the progress reporting. Re-enable and update the affected tests now that we have this feature. For bootdev_test_order_default() there is no-longer any support for using the bootdev aliases to specify an ordering, so drop that part of the test. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Drop the old bootflow_scan_first()Simon Glass
This function is not used outside tests. Drop it and rename bootflow_scan_dev() since it is how we start a scan now. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Allow scanning a single bootdev labelSimon Glass
We want to support scanning a single label, like 'mmc' or 'usb0'. Add this feature by plumbing the label through to the iterator, setting a flag to indicate that only siblings of the initial device should be used. This means that scanning a bootdev by its name is not supported anymore. That feature doesn't seem very useful in practice, so it is no great loss. Add a test for bootdev_find_by_any() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Switch bootdev scanning to use labelsSimon Glass
At present we set up the bootdev order at the start, then scan the bootdevs one by one. However this approach cannot be used with hunters, since the bootdevs may not exist until the hunter is used. Nor can we just run all the hunters at the start, since that violate's U-Boot's 'lazy init' requirement. It also increases boot time. So we need to adjust the algorithm to scan by labels instead. As a first step, drop the dev_order[] array in favour of a list of labels. Update the name of bootdev_setup_iter_order() to better reflect what it does. Update some related comments and log messages. Also disable a few tests until a later commit where we can use them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Add a hunter for the extension featureSimon Glass
This needs to run before any bootdev is used, so add a hunter for it. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23bootstd: Allow iterating to the next bootdev priortiySimon Glass
Add a function which moves to the next priority to be processed. This works by storing the current priority in the bootflow iterator. The logic to set this up is included in a subsequent commit. Signed-off-by: Simon Glass <sjg@chromium.org>