summaryrefslogtreecommitdiff
path: root/boot/bootm.c
AgeCommit message (Collapse)Author
2023-04-05android: boot: support boot image header version 3 and 4Safae Ouajih
commit 636da2039aea4ea3a638b14da0a9ec258897a10c upstream. Enable the support for boot image header version 3 and 4 using abootimg command. In order to use version 3 or 4: 1- Vendor boot image address should be given to abootimg cmd. abootimg addr $1 $vendor_boot_load_addr 2- "ramdisk_addr_r" env variable (ramdisk address) should be set to host the ramdisk : generic ramdisk + vendor ramdisk Replace "struct andr_boot_img_hdr_v0*" by "void *" in some functions since v3 and v4 are now supported as well. Signed-off-by: Safae Ouajih <souajih@baylibre.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
2023-04-05android: boot: add vendor boot image to prepare for v3, v4 supportSafae Ouajih
commit e058176be32b09ca4f787442fd99d29e44079519 upstream. Introduce vendor boot image for version 3 and 4 of boot image header. The vendor boot image will hold extra information about kernel, dtb and ramdisk. This is done to prepare for boot image version 3 and 4 support. Signed-off-by: Safae Ouajih <souajih@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
2023-02-09Correct SPL uses of CMD_FDTSimon Glass
This converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_FDT defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL uses of CMD_BOOTM_PRE_LOADSimon Glass
This converts 2 usages of this option to the non-SPL form, since there is no SPL_CMD_BOOTM_PRE_LOAD defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2023-02-09Correct SPL use of CMD_BOOTISimon Glass
This converts 1 usage of this option to the non-SPL form, since there is no SPL_CMD_BOOTI defined in Kconfig Signed-off-by: Simon Glass <sjg@chromium.org>
2022-12-07net: Remove eth_legacy.cTom Rini
As there are no more non-DM_ETH cases for networking, remove this legacy file and update the Makefile to match current usage. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-10-17bootm: Change incorrect 'unsupported' errorSimon Glass
At present when bootm fails, it says: subcommand not supported and then prints help for the bootm command. This is not very useful, since generally the error is related to something else, such as fixups failing. It is quite confusing to see this in a test run. Change the error and show the error code. We could update the OS functions to return -ENOSYS when they do not support the bootm subcommand. But this involves some thought since this is arch-specific code and proper errno error codes are not always returned. Also, with the code as is, all required subcommands are of course supported - a problem would only come if someone added a new one or removed support for one from an existing OS. Therefore it seems better to leave that sort of effort for when our bootm tests are improved. Note: v1 of this patch generated a discussion[1] about printing error strings automatically using printf(). That is outside the scope of this patch but will be dealt with separately. [1] https://patchwork.ozlabs.org/project/uboot/patch/20220909151801.336551-3-sjg@chromium.org/ Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29treewide: Drop image_header_t typedefSimon Glass
This is not needed and we should avoid typedefs. Use the struct instead and rename it to indicate that it really is a legacy struct. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29treewide: Drop image_info_t typedefSimon Glass
This is not needed and we should avoid typedefs. Use the struct instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-29treewide: Drop bootm_headers_t typedefSimon Glass
This is not needed and we should avoid typedefs. Use the struct instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-31bootm: Fix upper bound of FDT overlap checksPali Rohár
FTD blob can be put immediately after the OS image. So use strict inequality for start address check. Fixes: fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image") Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-31image-fit: don't set compression if it can't be readDaniel Golle
fit_image_get_comp() should not set value -1 in case it can't read the compression node. Instead, leave the value untouched in that case as it can be absent and a default value previously defined by the caller of fit_image_get_comp() should be used. As a result the warning message WARNING: 'compression' nodes for ramdisks are deprecated, please fix your .its file! no longer shows if the compression node is actually absent. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-31bootm: fix typo imape_comp -> image_compDaniel Golle
Change variable name 'imape_comp' to the supposedly intended name 'image_comp'. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-07-07Convert CONFIG_SYS_BOOTM_LEN to KconfigTom Rini
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>
2022-06-06bootm: Fix Linux silent console on newer kernelsSean Anderson
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>
2022-03-31cmd: bootm: add a stage pre-loadPhilippe Reynes
Add a stage pre-load to the command bootm. Right now, this stage may be used to read a header and check the signature of the full image. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-11Create a new boot/ directorySimon Glass
Quite a lot of the code in common/relates to booting and images. Before adding more it seems like a good time to move the code into its own directory. Most files with 'boot' or 'image' in them are moved, except: - autoboot.c which relates to U-Boot automatically running a script - bootstage.c which relates to U-Boot timing Drop the removal of boot* files from the output directory, since this interfers with the symlinks created by tools and there does not appear to be any such file from my brief testing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com>