summaryrefslogtreecommitdiff
path: root/boot
AgeCommit message (Collapse)AuthorFilesLines
2023-07-22Kconfig: Enable FIT_SIGNATURE if ARM64Manorit Chawdhry1-2/+1
Enabling FIT_SIGNATURE required the old authentication method to be disabled so disable this for K3 SOCs and enable FIT_SIGNATURE for K3 Platforms. Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com> [ cleanup the patch ] Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2023-07-20bootstd: USB devtype detection for script bootJohn Clark1-1/+4
Change the device type from "usb_mass_storage" to "usb" when booting a script. Before this change: => printenv devtype devtype=usb_mass_storage After this change: => printenv devtype devtype=usb Signed-off-by: John Clark <inindev@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17android_ab: Try backup booloader_messageJoshua Watt1-12/+65
Some devices keep 2 copies of the bootloader_message in the misc partition and write each in sequence when updating. This ensures that there is always one valid copy of the bootloader_message. Teach u-boot to optionally try a backup bootloader_message from a specified offset if the primary one fails its CRC check. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-07-17android_ab: Add option to skip decrementing triesJoshua Watt1-3/+6
It is is sometimes desired to be able to skip decrementing the number of tries remaining in an Android A/B boot, and instead just check which slot will be tried later. This can commonly be be the case for platforms that want to A/B u-boot itself, but are required to boot from a FAT MBR partition. In these cases, u-boot must do an early check that the MBR points to the correct A/B boot partition, and if not rewrite the MBR to point to the correct one and reboot. Decrementing the try count in this case is not desired because it means that each u-boot might constantly ping-pong overwriting the MBR and rebooting until all the retries are used up. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-07-17bootstd: Add a simple bootmeth for ChromiumOSSimon Glass3-0/+224
It is possible to boot x86-based ChromeOS machines by parsing a table and locating the kernel and command line. Add a bootmeth for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bootstd: Support automatically setting Linux parametersSimon Glass1-0/+33
Some Linux parameters can be set automatically by U-Boot, if it knows the device being used. For example, since U-Boot knows the serial console being used, it can add parameters for earlycon and console. Add support for this. Note that this is an experimental feature and we will see how useful it turns out to be. It is very handy for ChromeOS, since otherwise it is very difficult to manually determine the UART address or port number, particularly in a script. Provide an example of how this is used with ChromeOS. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-17bootstd: Add support for updating elements of the cmdlineSimon Glass1-0/+53
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 Glass1-0/+191
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: Use the bootargs env var for changing the cmdlineSimon Glass1-0/+58
The "bootargs" environment variable is used to set the command-line arguments to pass to the OS. Use this same mechanism with bootstd as well. When the variable is updated, it is written to the current bootflow. When the current bootflow is updated, the environment variable is updated too. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Correct baudrate typoSimon Glass1-1/+1
This is a copy error. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Use bootdev instead of bootdeviceSimon Glass1-2/+2
It seems better to call this a 'bootdev' since this is name used in the documentation. The older 'Bootdevice' name is no-longer used and may cause confusion with the 'bootdevice' environment variable. Update throughout to use bootdev. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-16bootstd: Correct the name of the QEMU bootmethSimon Glass1-1/+1
This does not relate to sandbox. Correct the name. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2023-07-14expo: Add a configuration editorSimon Glass6-1/+200
Add a new 'cedit' command which allows editing configuration using an expo. The configuration items appear as menus on the display. This is extremely basic, only supporting menus and not providing any way to load or save the configuration. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Support building an expo from a description fileSimon Glass3-1/+402
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: Add spacing around menus and itemsSimon Glass3-15/+30
It looks better if menus have a bit of an inset, rather than be drawn hard up against the background. Also, menu items look better if they have a bit of spacing between them. Add theme options for these and implement the required changes. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Implement the keypress logic for popup menusSimon Glass2-2/+88
In 'popup' mode, the expo allows moving around the objects in a scene. When 'enter' is pressed on a menu, it opens and the user can move around the items in the menu. Implement this using keypress handles and actions. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Draw the current opened menu on topSimon Glass4-0/+80
When a menu is opened, it must be displayed over all other objects in the scene, so that all its items are visible. Handle this by drawing the menu object a second time, after all other objects have been drawn. Draw all of the objects which are dependent on the menu object. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Draw popup menus in both opened and closed statesSimon Glass3-2/+100
When a popup menu is closed it shows only the selected item. When it is open it shows a background and all items, with a highlight that can be moved between the items. Add the drawing logic for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Rename EXPOACT_POINT to EXPOACT_POINT_ITEMSimon Glass1-2/+2
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: Support drawing of popup menusSimon Glass1-21/+37
At present only a single menu is supported. All items are shown and a pointer object points to the current item. Add support for multiple menus, one of which is highlighted, indicated by the highlight_id property in the scene. The highlighted menu item has a SCENEOF_POINT flag, indicating that it is currently pointed to. The popup menu is normally closed, in which case it shows only the current menu item. When it is opened, it shows all items, allowing the user to select one. Rather than requiring the menu item to have a description, require it to have a label. Use the label (only) for the popup menu. With this, most of the drawing and layout logic is complete. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Move menu-item selection into a functionSimon Glass1-13/+54
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 Glass3-0/+57
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 Glass4-0/+176
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: Calculate text bounding-box correctlySimon Glass1-8/+22
Rather than estimating, measure the text accurately, using the new vidconsole feature. This allows accurate placement of objects. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Use flags for objectsSimon Glass2-2/+26
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 Glass2-10/+10
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: Allow setting the start of the dynamic-ID rangeSimon Glass2-10/+15
Provide a way to set this value so that it is easy to separate the statically allocated IDs (generated by the caller) from those generated dynamically by expo itself. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14bootstd: Add a separate log category for expoSimon Glass3-1/+5
This feature is different enough from bootstd that it probably deserves its own log category. It cannot use a uclass since it is not a device. Add a new category. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14fs: Create functions to load and allocate a fileSimon Glass1-28/+2
This functionality current sits in bootstd, but it is more generally useful. Add a function to load a file into memory, allocating it as needed. Adjust bootstd to use this version. Note: Tests are added in the subsequent patch which converts the 'cat' command to use this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Rename exp_set_text_mode()Simon Glass2-2/+2
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 Glass4-17/+18
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: Store the console in the expoSimon Glass2-8/+11
Rather than finding this each time, keep a pointer to it. This simplifies the code a little. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-14expo: Convert to using a string ID for the scene titleSimon Glass1-6/+2
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-07-14expo: Correct some header-file commentsSimon Glass1-3/+5
The use of Returns instead of @return still confuses me. Fix some problems that have crept in. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-07-05Merge tag 'v2023.07-rc6' into nextTom Rini3-15/+16
Prepare v2023.07-rc6
2023-06-16bootm: don't call booti_setup for EFI imagesHeinrich Schuchardt1-1/+2
On the arm64 architecture booti_setup() is called for EFI FIT images. This function call fails because EFI images typically do not have a kernel signature. Check that the operating system property "os" of the image is "linux" before invoking booti_setup(). Fixes: 487b5fa6deb1 ("bootm: Handle kernel_noload on arm64") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-06-14bootstd: Fix relative path use in extlinux bootmethJonas Karlman1-1/+1
Using relative path in a /boot/extlinux/extlinux.conf file fails to load linux kernel. Using a /boot/extlinux/extlinux.conf file: LABEL test LINUX ../linux/Image Result in following error: Retrieving file: ../linux/Image Skipping test for failure retrieving kernel Boot failed (err=-14) However, using sysboot cmd successfully load kernel using same file: sysboot mmc 1:1 any ${scriptaddr} /boot/extlinux/extlinux.conf Retrieving file: /boot/extlinux/../linux/Image Fix relative path using bootmeth extlinux by supplying bootfile path instead of subdir path in the call to pxe_setup_ctx, same as done in the sysboot command. Fixes: 31aefaf89a5b ("bootstd: Add an implementation of distro boot") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-06-14bootstd: Make BOOTSTD_FULL depend on BOOTSTDSimon Glass1-13/+13
Move BOOTSTD_FULL down in the file so that it can be enabled only when BOOTSTD is enabled. This prevents a build error if BOOTSTD is disabled but BOOTSTD_FULL is enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-06-12global: Use proper project name U-BootMichal Simek1-1/+1
Use proper project name in comments, Kconfig, readmes. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/0dbdf0432405c1c38ffca55703b6737a48219e79.1684307818.git.michal.simek@amd.com
2023-05-14Merge branch 'master_rzn1/rzn1' of ↵Tom Rini1-0/+1
https://source.denx.de/u-boot/custodians/u-boot-sh - R-Car RZN1 support
2023-05-13bootstd: Create a new BOOTMETH_DISTROSimon Glass1-1/+9
We cannot be sure what bootmeth a distro will need to use. Add a new BOOTMETH_DISTRO option which collects these together. Select this from BOOTSTD_DEFAULTS so that it is clear what is needed. Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Make BOOTMETH_EFILOADER depend on EFI_LOADER, select if EFI_LOADER] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-05-13bootstd: Rename distro and syslinux to extlinuxSimon Glass6-63/+73
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 Glass2-2/+2
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: Correct default boot commandSimon Glass1-2/+2
The patch to relax flag requirements was not accepted[1], so we still have to have separate bootcommands depending on CMD_BOOTFLOW_FULL. The previous attempt at this did not work, since it used the wrong name for the options. Fix this and change the message to mention BOOTSTD_FULL since this affects not just the flags, but all functionality, so is more likely what the user wants. Drop the useless condition on CMD_BOOTFLOW_FULL while we are here. [1] https://patchwork.ozlabs.org/project/uboot/patch/20230329071655.1959513-2-sjg@chromium.org/ Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: a91492b6e9c ("bootstd: Provide a default command")
2023-05-13bootstd: Require HUSH_PARSER for script bootingSimon Glass1-0/+1
Armbian uses a script which needs the HUSH parser. It is likely that other distros will do the same. Enable it by default, just in case. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Jonas Karlman <jonas@kwiboo.se>
2023-05-13bootstd: Work around missing partition 1Simon Glass1-1/+8
If there is no partition numbered 1, we decide that there are no partitions at all. That may not be correct, since at least one Debian installed has just a single partition numbered 2. Continue searching up to partition 3, just in case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-13tools: spkgimage: add Renesas SPKG formatRalph Siemsen1-0/+1
Renesas RZ/N1 devices contain BootROM code that loads a custom SPKG image from QSPI, NAND or USB DFU. Support this format in mkimage tool. SPKGs can optionally be signed, however creation of signed SPKG is not currently supported. Example of how to use it: tools/mkimage -n board/schneider/rzn1-snarc/spkgimage.cfg \ -T spkgimage -a 0x20040000 -e 0x20040000 \ -d u-boot.bin u-boot.bin.spkg The config file (spkgimage.cfg in this example) contains additional parameters such as NAND ECC settings. Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-05-06net: dhcp6: pxe: Add DHCP/PXE commands for IPv6Sean Edmond3-4/+5
Adds commands to support DHCP and PXE with IPv6. New configs added: - CMD_DHCP6 - DHCP6_PXE_CLIENTARCH - DHCP6_PXE_DHCP_OPTION - DHCP6_ENTERPRISE_ID New commands added (when IPv6 is enabled): - dhcp6 - pxe get -ipv6 - pxe boot -ipv6 Signed-off-by: Sean Edmond <seanedmond@microsoft.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-05-04boot/Kconfig: fix comments syntax errorHugo Villeneuve1-1/+1
Fix comments syntax error in SPL_LOAD_FIT_APPLY_OVERLAY description. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-04-28boot: vbe_simple: Fix vbe_simple_read_bootflow() dependencyBin Meng1-5/+7
vbe_simple_read_bootflow() calls vbe_simple_read_bootflow_fw() which is only available when BOOTMETH_VBE_SIMPLE_FW is on. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>