aboutsummaryrefslogtreecommitdiffstats
path: root/boot
Commit message (Collapse)AuthorAgeFilesLines
* image: Drop some other #ifdefs in image-board.cWIP/2022-09-14-refactor-ramdisk-code-againSimon Glass2022-09-141-31/+36
| | | | | | | | | Remove all but a few that are difficult, relying on legacy CONFIG options or optional global_data fields. Drop the duplicate function name in the comment for boot_get_cmdline(). Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Correct indentation in select_ramdisk()Simon Glass2022-09-141-71/+69
| | | | | | | Finish off the refactoring by correcting the indent levels. Note that this does not include any functional changes. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Drop remaining FIT #ifdefSimon Glass2022-09-141-8/+9
| | | | | | | | | Drop the last one of these, by using a done_select variable to control whether to fall back to using 'select' as a hex value. Note that the indentation is not adjusted, to make this easier to review. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Drop another #ifdef for FITSimon Glass2022-09-141-2/+3
| | | | | | Drop the prenultimate one of these from select_ramdisk(). Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Drop one #ifdef for FITSimon Glass2022-09-141-19/+20
| | | | | | | Drop the #ifdef from near the end of select_ramdisk(). Move some variables to the top of the function to make this work. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Drop #ifdefs for LEGACY_IMAGE_FORMATSimon Glass2022-09-141-17/+14
| | | | | | Use if() instead of the #ifdef in select_ramdisk(). Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Track when ramdisk processing is completedSimon Glass2022-09-141-14/+22
| | | | | | | | | The current switch default is tricky since it relies on #ifdefs to work. Use a bool instead. Also fix the comment on @select, since it has a dual purpose. Signed-off-by: Simon Glass <sjg@chromium.org>
* image: Fix up ANDROID_BOOT_IMAGE ramdisk codeSimon Glass2022-09-141-5/+12
| | | | | | | Convert this to an if(), fix the cast from an address to a pointer and make sure that any error is returned correctly. Signed-off-by: Simon Glass <sjg@chromium.org>
* Convert CONFIG_SYS_FDT_PAD to KconfigTom Rini2022-08-121-4/+0
| | | | | | | | This converts the following to Kconfig: CONFIG_SYS_FDT_PAD Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* vbe: Support VBE simpleSimon Glass2022-08-123-0/+328
| | | | | | | Add support for VBE simple, which permits firmware update of a single image stored in MMC or another block device. Signed-off-by: Simon Glass <sjg@chromium.org>
* vbe: Add initial support for VBESimon Glass2022-08-123-0/+131
| | | | | | | Create a new bootmeth for VBE along with a library to handle finding the VBE methods. Signed-off-by: Simon Glass <sjg@chromium.org>
* event: Add an event for device tree fixupsSimon Glass2022-08-121-0/+11
| | | | | | | | | | | | | | At present there is a confusing array of functions that handle the device tree fix-ups needed for booting an OS. We should be able to switch to using events to clean this up. As a first step, create a new event type and call it from the standard place. Note that this event uses the ofnode interface only, since this can support live tree which is more efficient when making lots of updates. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Drop the system bootdevSimon Glass2022-08-123-73/+1
| | | | | | | | | | | This was a work-around for the fact that global bootmeths such as EFI bootmgr and VBE don't use a particular bootdev, or at least select it themselves so that we don't need to scan all bootdevs when using that bootmeth. Drop the system bootdev entirely. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Always create the EFI bootmgr bootmethSimon Glass2022-08-121-6/+1
| | | | | | | | | | | Now that we can separate this out from the normal bootmeths, update the code to create it always. We cannot rely on the device tree to create this, since the EFI project is quite opposed to having anything in the device tree that helps U-Boot with its processing. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Allow scanning for global bootmeths separatelySimon Glass2022-08-122-23/+58
| | | | | | | | | | | | | | | | | | 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>
* bootstd: Support bootflows with global bootmethsSimon Glass2022-08-121-8/+50
| | | | | | | | Add support for handling this concept in bootflows. Update the 'bootflow' command to allow only the normal bootmeths to be used. This alllows skipping EFI bootmgr and VBE, for example. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Allow the bootdev to be optional in bootflowsSimon Glass2022-08-122-3/+7
| | | | | | | | | With global bootmeths we want to scan without a bootdev. Update the logic to allow this. Change the bootflow command to show the bootdev only when valid. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Allow EFI bootmgr to support an invalid bootflowSimon Glass2022-08-121-6/+26
| | | | | | | | | For most testing we don't want this bootmeth to actually do anything. For the one test where we do, add a test hook to obtain the correct behaviour. This will allow us to bind the device always, rather than just doing it for this test. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Allow bootmeths to be marked as globalSimon Glass2022-08-123-1/+23
| | | | | | | | | | | | 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>
* bootstd: Tidy up var naming in bootdev_setup_iter_order()Simon Glass2022-08-121-4/+4
| | | | | | | | | | Avoid using 'count' to mean either a count or an error, since this is confusing. In fact, the called function never return 0, since that is an error. Use 'ret' instead. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Provide a bootmeth method to obtain state infoSimon Glass2022-08-122-0/+24
| | | | | | | | | 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>
* bootstd: Detect empty bootmeth orderingSimon Glass2022-08-121-0/+2
| | | | | | | | | | 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>
* Merge tag 'dm-pull-9aug22-take2' of ↵Tom Rini2022-08-113-4/+10
|\ | | | | | | | | | | https://source.denx.de/u-boot/custodians/u-boot-dm dtoc fixes with pylint, tests
| * boot: allow bootmeth-distro without CONFIG_NETJohn Keeping2022-08-103-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove the dependency on CMD_PXE from BOOTMETH_DISTRO by introducing a new hidden kconfig symbol to control whether pxe_utils is compiled, allowing bootstd's distro method to be compiled without needing networking support enabled. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Correct build errors when CMD_BOOTM is not enabled: Signed-off-by: Simon Glass <sjg@chromium.org>
* | common: Drop display_options.h from common headerSimon Glass2022-08-102-0/+2
|/ | | | | | Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* Revert "Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support""Simon Glass2022-08-051-13/+0
| | | | | | | | | | | This is not needed now that CONFIG_SYS_TARGET_NAME is correctly determined when scanning Kconfig. This reverts commit 25b8acee2ea11a9edc100c42a61f5d6187eb6167. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* flash: Remove pic32_flash.cTom Rini2022-08-041-1/+1
| | | | | | | | As the only pic32 platform does not enable flash, this is dead code. Remove it. Cc: Purna Chandra Mandal <purna.mandal@microchip.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* fpga: zynqmp: support loading authenticated imagesOleksandr Suvorov2022-07-261-2/+2
| | | | | | | | | | | | Add supporting new compatible string "u-boot,zynqmp-fpga-ddrauth" to handle loading authenticated images (DDR). Based on solution by Jorge Ramirez-Ortiz <jorge@foundries.io> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io> Tested-by: Ricardo Salveti <ricardo@foundries.io> Link: https://lore.kernel.org/r/20220722141614.297383-13-oleksandr.suvorov@foundries.io Signed-off-by: Michal Simek <michal.simek@amd.com>
* fpga: pass compatible flags to fpga_load()Oleksandr Suvorov2022-07-261-2/+2
| | | | | | | | | | | These flags may be used to check whether an FPGA driver is able to load a particular FPGA bitstream image. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io> Tested-by: Ricardo Salveti <ricardo@foundries.io> Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com> Link: https://lore.kernel.org/r/20220722141614.297383-7-oleksandr.suvorov@foundries.io Signed-off-by: Michal Simek <michal.simek@amd.com>
* zynqmp: Run board_get_usable_ram_top() only on main U-BootAshok Reddy Soma2022-07-261-0/+4
| | | | | | | | | | | | | | | | With commit ce39ee28ec31 ("zynqmp: Do not place u-boot to reserved memory location"), the function board_get_usable_ram_top() is allocating MMU_SECTION_SIZE of about 2MB using lmb_alloc(). But we dont have this much memory in case of mini U-Boot. Keep these functions which use lmb under CONFIG_LMB so that they are compiled and used only when LMB is enabled. Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/75e52def75f573e554a6b177a78504c128cb0c4a.1657183534.git.michal.simek@amd.com
* pxe: simplify label_boot()Heinrich Schuchardt2022-07-181-5/+4
| | | | | | | | | | | | Coverity CID 131256 indicates a possible buffer overflow in label_boot(). This would only occur if the size of the downloaded file would exceed 4 GiB. But anyway we can simplify the code by using snprintf() and checking the return value. Addresses-Coverity-ID: 131256 ("Security best practices violations (STRING_OVERFLOW)") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Artem Lapkin <email2tema@gmail.com>
* Merge branch 'next'WIP/11Jul2022Tom Rini2022-07-114-31/+49
|\
| * Convert CONFIG_SYS_BOOTM_LEN to KconfigWIP/2022-07-07-Kconfig-migrations-dead-code-removalTom Rini2022-07-071-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_SYS_BOOTM_LEN As part of this, rework error handling in boot/bootm.c so that we pass the buffer size to handle_decomp_error as CONFIG_SYS_BOOTM_LEN will not be available to host tools but we do know the size that we passed to malloc(). Cc: Soeren Moch <smoch@web.de> Signed-off-by: Tom Rini <trini@konsulko.com>
| * Convert CONFIG_SYS_BOOT_RAMDISK_HIGH to KconfigTom Rini2022-07-071-0/+8
| | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_SYS_BOOT_RAMDISK_HIGH Signed-off-by: Tom Rini <trini@konsulko.com>
| * Convert CONFIG_SYS_RAMBOOT to KconfigTom Rini2022-07-071-0/+4
| | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_SYS_RAMBOOT Signed-off-by: Tom Rini <trini@konsulko.com>
| * spl: Ensure all SPL symbols in Kconfig have some SPL dependencyTom Rini2022-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | Tighten up symbol dependencies in a number of places. Ensure that a SPL specific option has at least a direct dependency on SPL. In places where it's clear that we depend on something more specific, use that dependency instead. This means in a very small number of places we can drop redundant dependencies. Reported-by: Pali Rohár <pali@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com>
| * Convert CONFIG_FSL_FIXED_MMC_LOCATION et al to KconfigTom Rini2022-07-051-0/+13
| | | | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_FSL_FIXED_MMC_LOCATION CONFIG_ESDHC_HC_BLK_ADDR Signed-off-by: Tom Rini <trini@konsulko.com>
| * tpl: Ensure all TPL symbols in Kconfig have some TPL dependencyTom Rini2022-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | Tighten up symbol dependencies in a number of places. Ensure that a TPL specific option has at least a direct dependency on TPL. In places where it's clear that we depend on something more specific, use that dependency instead. Reported-by: Pali Rohár <pali@kernel.org> Signed-off-by: Tom Rini <trini@konsulko.com>
| * bootm: Fix Linux silent console on newer kernelsSean Anderson2022-06-061-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux determines its console based on several sources: 1. the console command line parameter 2. device tree (e.g. /chosen/stdout-path) 3. various other board- and arch-specific sources If the console parameter specifies a real console (e.g. ttyS0) then that is used as /dev/console. However, if it does not specify a real console (e.g. ttyDoesntExist) then *nothing* will be used as /dev/console. Reading/writing it will return ENODEV. Additionally, no other source will be used as a console source. Linux commit ab4af56ae250 ("printk/console: Allow to disable console output by using console="" or console=null") recently changed the semantics of the parameter. Previously, specifying console="" would be treated like specifying some other bad console. This commit changed things so that it added /dev/ttynull as a console (if available). However, it also allows for other console sources. If the device tree specifies a console (such as if U-Boot and Linux share a device tree), then it will be used in addition to /dev/ttynull. This can result in a non-silent console. To avoid this, explicitly set ttynull as the console. This will disable other console sources. If CONFIG_NULL_TTY is disabled, then this will have the same behavior as in the past (no output, and writing /dev/console returns ENODEV). [1] and [2] have additional background on this kernel change. [1] https://lore.kernel.org/all/20201006025935.GA597@jagdpanzerIV.localdomain/ [2] https://lore.kernel.org/all/20201111135450.11214-1-pmladek@suse.com/ Signed-off-by: Sean Anderson <sean.anderson@seco.com>
| * boot: image-pre-load: drop unused CONFIG_SYS_BOOTM_LENPeng Fan2022-06-061-5/+0
| | | | | | | | | | | | | | CONFIG_SYS_BOOTM_LEN is not used in this file, drop it. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
| * Convert CONFIG_SYS_BARGSIZE to KconfigTom Rini2022-06-061-4/+2
| | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_SYS_BARGSIZE Signed-off-by: Tom Rini <trini@konsulko.com>
* | image: fit: Use stack allocation macroJoel Stanley2022-07-011-2/+1
|/ | | | | | | | | | | | | The documentation above the DEFINE_ALIGN_BUFFER says it's for use outside functions, but we're inside one. Instead use ALLOC_CACHE_ALIGN_BUFFER, the stack based macro, which also includes the cache alignment. Fixes: b583348ca8c8 ("image: fit: Align hash output buffers") Signed-off-by: Joel Stanley <joel@jms.id.au> Tested-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
* bootmenu: U-Boot console is enabled as defaultMasahisa Kojima2022-05-281-0/+7
| | | | | | | | | | | | | | | | | | | The commit 2158b0da220c ("bootmenu: add Kconfig option not to enter U-Boot console") disables to enter U-Boot console from bootmenu as default, this change affects the existing bootmenu users. This commit reverts the default behavior, the bootmenu can enter U-Boot console same as before. CMD_BOOTMENU_ENTER_UBOOT_CONSOLE is renamed BOOTMENU_DISABLE_UBOOT_CONSOLE and depends on AUTOBOOT_MENU_SHOW. Fixes: 2158b0da220c ("bootmenu: add Kconfig option not to enter U-Boot console") Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Tested-by: Pali Rohar <pali@kernel.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* boot: Kconfig: Enable FIT processing by default on TI secure devicesAndrew Davis2022-05-111-0/+2
| | | | | | | | | TI secure devices chain-of-trust depends on FIT image processing, enable it by default on these devices. This also reduces the delta between the secure and non-secure defconfig files. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* boot: Kconfig: Disable non-FIT loading for TI secure devicesAndrew Davis2022-05-111-1/+1
| | | | | | | | | Non-FIT image loading support should be disabled for TI secure devices as the image handlers for those image types do not follow our secure boot checks. Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* bootstd: Provide a default commandSimon Glass2022-04-251-1/+16
| | | | | | | | We would like to use bootstd by default when EFI boot manager is not enabled. But so far bootstd does not support all the of distro-boot fetures. So for now, add an option to select this. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Add an implementation of script bootSimon Glass2022-04-253-0/+151
| | | | | | | | Add a bootmeth driver which handles distro boot from a disk via a U-Boot script, so we can boot a bootflow using this commonly used mechanism. This is required by Armbian, for example. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Add a sandbox bootmeth driverSimon Glass2022-04-253-0/+77
| | | | | | Add a bootmeth driver for sandbox, used for testing. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Add an implementation of EFI bootmgrSimon Glass2022-04-252-0/+89
| | | | | | | | | | | | | Add a bootmeth driver which handles EFI boot manager, using EFI_LOADER. In effect, this provides the same functionality as the 'bootefi bootmgr' command and shares the same code. But the interface into it is via a bootmeth, so it does not require any special scripts, etc. For now this requires the 'bootefi' command be enabled. Future work may tidy this up so that it can be used without CONFIG_CMDLINE being enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
* bootstd: Add a system bootdev for strange boot methodsSimon Glass2022-04-253-1/+73
| | | | | | | | Some boot methods don't act on a single bootdev but instead do their own thing. An example is EFI bootmgr which scan various devices using its own logic. Add a bootdev to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>