summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2023-11-29common: board_r: Enable set_pmic()Hal Feng1-0/+3
The code is ported from tag JH7110_DVK_515_v3.9.3 of Devkits repo. Signed-off-by: ziv.xu <ziv.xu@starfive.com> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
2023-10-18usb: fix TRB_TRANSFER return null pointer issueMinda Chen1-6/+18
xhci_wait_for_event() wait TRB_TRANSFER may return null pointer, shoud checkit avoid crash. Read usb device info maybe failed, should check it and do not register usb device. uboot should rescan usb device and register. Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
2023-10-10usb: hub: Do NOT add device if portchanged over current bit is setMinda Chen1-0/+3
USB hub should not add the usb devices if over current bit is set in portchange. For later usb_scan_port will still return with error and rescan and add device again. it will generate dulplicated device and cause crash issue. Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
2023-09-07common: autoboot: Add auto-fastboot on StarFive SoCXingyu Wu3-1/+74
Add auto-fastboot function before autoboot on StarFive SoC and add a config to enable or disable this. In the auto-fastboot, it check a environment flag of 'fb_sf_completed' first. The flag is NULL and then the fastboot will work. The flag will be set from USB tool to indicate done after flashing the image. Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
2021-09-15image: Avoid erroneous double byte-swap in CRC valueAlexandru Gagniuc1-9/+0
The hash algorithm selection was streamlined in commit 92055e138f28 ("image: Drop if/elseif hash selection in calculate_hash()"). Said commit kept the call to cpu_to_uimage() to convert the CRC to big endian format. This would have been correct when calling crc32_wd(). However, the ->hash_func_ws member of crc32 points to crc32_wd_buf(), which already converts the CRC to big endian. On a little endian host, doing both conversions results in a little-endian CRC. This is incorrect. To remedy this, simply drop the call to cpu_to_uimage(), thus only doing the byte-order conversion once. Fixes: 92055e138f28 ("image: Drop if/elseif hash selection in calculate_hash()") Tested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-09-14image: rsa: Move padding_algos to linker listsAlexandru Gagniuc1-17/+6
We are not guaranteed to have the padding_pkcs_15_verify symbol since commit 92c960bc1d ("lib: rsa: Remove #ifdefs from rsa.h"), and commit 61416fe9df ("Kconfig: FIT_SIGNATURE should not select RSA_VERIFY") The padding_algos only make sense with RSA verification, which can now be disabled in lieu of ECDSA. In fact this will lead to build failures because of the missing symbol mentioned earlier. To resolve this, move the padding_algos to a linker list, with declarations moved to rsa_verify.c. This is consistent with commit 6909edb4ce ("image: rsa: Move verification algorithm to a linker list") One could argue that the added #ifdef USE_HOSTCC is ugly, and should be hidden within the U_BOOT_PADDING_ALGO() macro. However, this would be inconsistent with the "cryptos" list. This logic for was not previously explored: Without knowledge of the U_BOOT_PADDING_ALGO() macro, its use is similar to something being declared. However, should #ifndef USE_HOSTCC be part of the macro, it would not be obvious that it behaves differently on host code and target code. Having the #ifndef outside the macro makes this obvious. Also, the #ifdef is not always necessary. For example ecda-verify makes use of U_BOOT_CRYPTO_ALGO() without any accompanying #ifdefs. The fundamental issue is a lack of separation of host and target code in rsa_verify. Therefore, the declaration of a padding algo with the external #ifdef is more readable and consistent. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2021-09-14pci: Drop DM_PCISimon Glass1-1/+0
This option has not effect now. Drop it, using PCI instead where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-08image: Drop if/elseif hash selection in calculate_hash()Alexandru Gagniuc2-26/+21
calculate_hash() would try to select the appropriate hashing function by a if/elseif contruct. But that is exactly why hash_lookup_algo() exists, so use it instead. This does mean that we now have to 'select HASH' to make sure we get the hash_lookup_algo() symbol. However, the change makes sense because even basic FITs will have to deal with "hash" nodes. My only concern is that the 'select SPL_HASH' might cause some platform to grow above its SPL size allowance Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> [trini: Make FSL_CAAM be implied only on ARM && SPL] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-08common: Move MD5 hash to hash_algo[] array.Alexandru Gagniuc1-0/+13
MD5 is being called directly in some places, but it is not available via hash_lookup_algo("md5"). This is inconsistent with other hasing routines. To resolve this, add an "md5" entry to hash_algos[]. The #ifdef clause looks funnier than those for other entries. This is because both MD5 and SPL_MD5 configs exist, whereas the other hashes do not have "SPL_" entries. The long term plan is to get rid of the ifdefs, so those should not be expected to survive much longer. The md5 entry does not have .hash_init/update/finish members. That's okay because hash_progressive_lookup_algo() will catch that, and return -EPROTONOSUPPORT, while hash_lookup_algo() will return the correct pointer. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> [trini: Use CONFIG_IS_ENABLED not IS_ENABLED for MD5 check] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-08common/spl: Drop [ST]PL_HASH_SUPPORT in favor of [ST]PL_HASHAlexandru Gagniuc3-26/+3
All of these configs exist. Stick to using CONFIG_[ST]PL_HASH, and drop all references to CONFIG_[ST]PL_HASH_SUPPORT. This means we need for CHAIN_OF_TRUST to select SPL_HASH now. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> [trini: Add TPL case, fix CHAIN_OF_TRUST, other tweaks] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-08common: Remove unused CONFIG_FIT_SHAxxx selectorsAlexandru Gagniuc2-70/+1
Originally CONFIG_FIT_SHAxxx enabled specific SHA algos for and only for hash_calculate() in common/image-fit.c. However, since commit 14f061dcb1 ("image: Drop IMAGE_ENABLE_SHAxxx"), the correct selector was changed to CONFIG_SHAxxx. The extra "_FIT_" variants are neither used, nor needed. Remove them. One defconfig disables FIT_SHA256, which is now changed to 'SHA256'. CMD_MVEBU_BUBT needs to select select SHA256 to avoid undefined references to "sha256_*()". bubt.c needs sha256, so this selection is correct. It is not clear why this problem did not manifest before. Note that SHA selection in SPL is broken for this exact reason. There is no corresponding SPL_SHAxxx. Fixing this is is beyond the scope of this change. Also note that we make CONFIG_FIT now imply SHA256, to make up for FIT_SHA256 previously being a default y option. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> [trini: Add imply SHA256 to FIT] Signed-off-by: Tom Rini <trini@konsulko.com>
2021-09-07common: board_r: support enable_caches for RISC-VZong Li1-2/+2
The enable_caches is a generic hook for architecture-implemented, we leverage this function to enable caches for RISC-V Signed-off-by: Zong Li <zong.li@sifive.com> Reviewed-by: Rick Chen <rick@andestech.com>
2021-08-27Merge tag 'xilinx-for-v2021.10-rc3' of ↵Tom Rini1-0/+18
https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze Xilinx changes for v2021.10-rc3 xilinx: - Disable CONFIG_ARCH_FIXUP_FDT_MEMORY - Print information about cpu via soc drivers and enable DISPLAY_CPUINFO - Wire infrastructure for DTB_RESELECT and MULTI_DTB_FIT zynq: - Wire single QSPI - Use power-source instead of io-standard properties - Enable nor on zc770-xm012 zynqmp: - Change handling around multi_boot() - Setup offset for u-boot.itb in spi - Generate run time dfu_alt_info for capsule update - Use explicit values for enums (zynqmp_firmware.h) - Enable RTC/SHA1/BUTTON/BUTTON_GPIO command - Disable WDT driver by default - Bind usb/scsi via preboot because of EFI - DT updates/fixes - Add soc driver - Fix SPL SPI boot mode versal: - Add soc driver sdhci: - Update tap delay programming for zynq_sdhci driver cmd: - Fix RTC uclass handling in date command - Update pwm help message - Update reset help message watchdog: - Fix wwdt compilation rtc: - Deal with seq alias in rtc uclass - Add zynqmp RTC driver fdt: - Add kernel-doc for fdt_fixup_memory_banks()
2021-08-26fdt_support: Add kernel-doc for fdt_fixup_memory_banks()Michal Simek1-0/+18
Add kernel-doc description for fdt_fixup_memory_banks() because it is implemented in one specific way and this information should be available for others to decide if their SoC conforms to it. If you don't want U-Boot to update your memory DT layout please disable CONFIG_ARCH_FIXUP_FDT_MEMORY. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-08-16Kconfig: FIT_SIGNATURE should not select RSA_VERIFYAlexandru Gagniuc1-4/+4
FIT signatures can now be implemented with ECDSA. The assumption that all FIT images are signed with RSA is no longer valid. Thus, instead of 'select'ing RSA, only 'imply' it. This doesn't change the defaults, but allows one to explicitly disable RSA support. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-08-04fit: Fix verification of images with external dataJohn Keeping1-1/+7
The "-E" option to mkimage generates a FIT with external data using the data-size and data-offset properties which must both be ignored when verifying a signature. Add "data-offset" to the list of excluded properties for signature verification; since the line is now too long, re-format the list to one-per-line and make it static since the data is constant. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-08-02global: Convert simple_strtoul() with decimal to dectoul()Simon Glass2-3/+3
It is a pain to have to specify the value 10 in each call. Add a new dectoul() function and update the code to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-08-02global: Convert simple_strtoul() with hex to hextoul()Simon Glass12-27/+26
It is a pain to have to specify the value 16 in each call. Add a new hextoul() function and update the code to use it. Add a proper comment to simple_strtoul() while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-08-02hash: Ensure verification hex pairs are terminatedSimon Glass1-1/+1
This function seems to assume that the chr[] variable contains zeros at the start, which is not always true. Use strlcpy() to be safe. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-08-01sandbox: Reduce keyed autoboot delaySimon Glass1-3/+3
The autoboot tests are a recent addition to U-Boot, providing much-needed coverage in this area. A side effect of the keyed autoboot test is that this feature is enabled in sandbox always. This changes the autoboot prompt and confuses the pytests. Some tests become slower, for example the vboot tests take about 27s now instead of 3s. We don't actually need this feature enabled to be able to run the tests. Add a switch to allow sandbox to turn it on and off as needed. Use this in the one test that needs it. Add a command-line flag in case this is desired in normal use. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 25c8b9f298e ("test: add first autoboot unit tests") Reviewed-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
2021-08-01common: board_r: print error if binman_init failsTim Harvey1-1/+7
Display an error if binman_init fails. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2021-07-31arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage headerPali Rohár1-1/+3
Now that proper load and execution addresses are set in v1 kwbimage we can use it for loading and booting U-Boot proper. Use the new spl_parse_board_header() function to implement parsing the kwbimage v1 header. Use information from this header to locate offset and size of the U-Boot proper binary, instead of using the legacy U-Boot header which is prepended to the U-Boot proper binary stored at fixed offset. This has the advantage that we do not need to relay on legacy U-Boot header anymore and therefore U-Boot proper binary can be stored at any offset, as is the case when loading & booting U-Boot proper by BootROM. The CONFIG_SYS_U_BOOT_OFFS option is therefore not used by SPL code anymore. Also allow to compile U-Boot SPL without CONFIG_SPL_SPI_FLASH_SUPPORT, CONFIG_SPL_MMC_SUPPORT or CONFIG_SPL_SATA_SUPPORT set. In this case BootROM is used for loading and executing U-Boot proper. This reduces the size of U-Boot's SPL image. By default these config options are enabled and so BootROM loading is not used. In some cases BootROM reads from SPI NOR at lower speed than U-Boot SPL. So people can decide whether they want to have smaller SPL binary at the cost of slower boot. Therefore dependency on CONFIG_SPL_DM_SPI, CONFIG_SPL_SPI_FLASH_SUPPORT, CONFIG_SPL_SPI_LOAD, CONFIG_SPL_SPI_SUPPORT, CONFIG_SPL_DM_GPIO, CONFIG_SPL_DM_MMC, CONFIG_SPL_GPIO_SUPPORT, CONFIG_SPL_LIBDISK_SUPPORT, CONFIG_SPL_MMC_SUPPORT, CONFIG_SPL_SATA_SUPPORT and CONFIG_SPL_LIBDISK_SUPPORT is changed from strict to related "imply" (which can be selectivelly turned off and causes booting via BootROM). Options CONFIG_SYS_SPI_U_BOOT_OFFS, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR and CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET have to to be set to zero as they define the location where kwbimage header starts. It is the location where BootROM expects start of the kwbimage from which it reads, parses and executes SPL part. The same applies to option CONFIG_SPL_SATA_RAW_U_BOOT_SECTOR, which has to be set to one. Update all config files to set correct values of these options and set CONFIG_SYS_U_BOOT_OFFS to the correct value - the offset where U-Boot proper starts. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-31SPL: Add support for parsing board / BootROM specific image typesPali Rohár1-0/+9
Platform specific BootROM may use its own image type for loading SPL or U-Boot proper. In some cases it makes sense to not use BootROM supplied code for booting U-Boot proper but rather to use U-Boot SPL for this, e.g. when U-Boot SPL can load U-Boot proper faster than BootROM. In this case it is required for platform board code to parse and load U-Boot in BootROM specific image type. This change adds support for parsing platform / board / BootROM specific image types via weak function spl_parse_board_header() which is called before marking boot image as a raw. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-31SPL: Add support for specifying offset between header and imagePali Rohár3-3/+27
Some image types (e.g. kwbimage v1) store the offset to SPL binary and offset to U-Boot proper binary in their headers. To avoid reading SPL binary when loading U-Boot proper, add support for specifying offset in struct spl_image_info, which defines the offset from the beginning of the header and the beginning of the executable data. Initial support is added only for SPI, MMC and SATA code. We can extend it later if needed. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-28i2c: Rename SPL/TPL_I2C_SUPPORT to I2CSimon Glass1-3/+3
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2021-07-28i2c: Rename CONFIG_SYS_I2C to CONFIG_SYS_I2C_LEGACYSimon Glass2-3/+3
It is quite confusing that CONFIG_SYS_I2C selects the legacy I2C and CONFIG_DM_I2C selects the current I2C. The deadline to migrate I2C is less than a year away. Also we want to have a CONFIG_I2C for U-Boot proper just like we have CONFIG_SPL_I2C for SPL, so we can simplify the Makefile rules. Rename this symbol so it is clear it is going away. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2021-07-28Rename DRIVERS_MISC_SUPPORT to DRIVERS_MISCSimon Glass1-2/+2
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-28Rename GPIO_SUPPORT to GPIOSimon Glass1-2/+2
Rename these options so that CONFIG_IS_ENABLED can be used with them. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-28Rename SPL_USB_HOST_SUPPORT to SPL_USB_HOSTSimon Glass2-3/+3
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-28Rename SPL_WATCHDOG_SUPPORT to SPL_WATCHDOGSimon Glass2-2/+2
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-28Rename SPL_MUSB_NEW_SUPPORT to SPL_MUSB_NEWSimon Glass1-1/+1
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-28Rename SPL_ETH_SUPPORT to SPL_ETHSimon Glass2-5/+5
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-28Rename SPL_CRYPTO_SUPPORT to SPL_CRYPTOSimon Glass2-2/+2
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-28Rename SPL_POWER_SUPPORT to SPL_POWERSimon Glass1-1/+1
Rename this option so that CONFIG_IS_ENABLED can be used with it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2021-07-27spl: Introduce spl_board_prepare_for_optee() hookAlexandru Gagniuc1-0/+5
OP-TEE requires some particular setup, which is not needed for linux or other payloads. Add a hook for platform-specific code to perform any OP-TEE related configuration and initialization. A weak function is used because it is symmetrical to other spl_board_prepare_for_*() implementations. A solution to avoid the use of weak functions would trivially apply to all these implementations. However, re-designing this is beyond the scope of this patch. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-27spl: mmc: Support OP-TEE payloads in Falcon modeAlexandru Gagniuc1-2/+2
In general, Falcon mode means we're booting a linux kernel directly. With FIT images, however, an OP-TEE secure kernel can be booted before linux. Thus, if the next stage is an IH_OS_TEE, this isn't necessarily a problem. Of course, a general solution would involve mmc_load_image_raw_os() only loading the binary, and leaving the decision of suitability to someone else. However, a rework of the boot flow is beyond the scope of this patch. Accept IH_OS_TEE as a valid OS value. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2021-07-23test: add first autoboot unit testsSteffen Jaeckel2-1/+6
This adds tests for the crypt-based and plain SHA256-based password hashing algorithms in the autoboot flow. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23common: add support to fallback to plain SHA256Steffen Jaeckel2-1/+29
In case crypt-based hashing is enabled this will be the default mechanism that is used. If a user wants to have support for both, the environment variable `bootstopusesha256` can be set to `true` to allow plain SHA256 based hashing of the password. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23common: add AUTOBOOT_FLUSH_STDIN optionSteffen Jaeckel2-0/+20
The key-sequence based unlock mechanisms are sensitive to junk symbols that could have been sent to stdin and are still waiting to be retrieved. Enabling this option will read all symbols off stdin before displaying the autoboot prompt (and starting to read the password from stdin). Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23common: allow disabling of timeout for password entrySteffen Jaeckel2-1/+19
In case a user has to enter a complicated password it is sometimes desireable to give the user more time than the default timeout. Enabling this feature will disable the timeout entirely in case the user presses the <Enter> key before entering any other character. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23common: Rename macro appropriatelySteffen Jaeckel1-8/+8
While doing code-review internally this got nitpicked by 2 reviewers, so I decided to include this here. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2021-07-23common: integrate crypt-based passwordsSteffen Jaeckel2-14/+105
Hook into the autoboot flow as an alternative to the existing mechanisms. Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2021-07-23Kconfig.boot: Make 0x0 the default SYS_TEXT_BASE for POSITION_INDEPENDENTTom Rini1-0/+1
When we build U-Boot with POSITION_INDEPENDENT we must have SYS_TEXT_BASE be set to zero. Make this the default in that case. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2021-07-23fit: Allow external data for FDTsJohn Keeping1-1/+2
Switch to fit_image_get_data_and_size() for consistency with all other data loaded from FIT. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-23spl: use CONFIG_IS_ENABLED(LOAD_FIT_FULL)John Keeping1-2/+2
It's possible that LOAD_FIT_FULL will have different values for TPL and SPL, in which case just checking CONFIG_SPL_LOAD_FIT_FULL causes this to be compiled in to the TPL even though functions and struct members it depends on are not. Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked. Signed-off-by: John Keeping <john@metanate.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-21log: Allow padding of the function nameSimon Glass2-1/+9
At present when function names are logged, the output is a little hard to read since every function is a different length. Add a way to pad the names so that the log messages line up vertically. This doesn't work if the function name is very long, but it makes a big difference in most cases. Use 20 characters as a default since this covers the vast majority of functions. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21spl: Provide more information on boot failureSimon Glass2-16/+42
If SPL fails to boot, try to provide an error code to indicate what is wrong. For example, if a uclass is missing, this can return -EPFNOSUPPORT (-96) which provides useful information. Add a helper for accessing the image-loader name so we can drop the use of #ifdefs in this code. Put this feature behind a CONFIG_SHOW_ERRORS option to avoid increasing the code size. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21image: Allow @ in node names when not using signaturesSimon Glass1-1/+1
If signature verification is not in use we don't need to worry about the risk of using @ in node names. Update fit_image_verify() to allow it if the function is not enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21bloblist: Correct condition in bloblist_addrec()Simon Glass1-1/+1
It is possible to add a blob that ends at the end of the bloblist, but at present this is not supported. Fix it and add a regression test for this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-07-21bloblist: Support resizing a blobSimon Glass1-2/+69
Sometimes a blob needs to expand, e.g. because it needs to hold more log data. Add support for this. Note that the bloblist must have sufficient spare space for this to work. Signed-off-by: Simon Glass <sjg@chromium.org>