summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-06-17arm64: zynqmp: Align #address/size-cells with nodeMichal Simek
zynqmp-mini-nand wasn't aligned with dt binding that's why fix it. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/3916fde2e896b8be8863505305118903e0644ab0.1717684544.git.michal.simek@amd.com
2024-06-17xilinx: zynqmp: Enable reset_cpu() in SPLLukas Funke
This commit enables SPL to reset the CPU via PMU-firmware. The usual reset mechanism requires bl31 to be loaded which may not be the case in SPL. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Link: https://lore.kernel.org/r/20240607092608.712996-2-lukas.funke-oss@weidmueller.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-17arm64: zynqmp: Enable usb3 for k24 somNeal Frager
This patch corrects the mio and pll configuration registers for using usb3 on the kd240 starter kit. Without this patch, the usb3 to sd card bridge does not initialize correctly and u-boot is unable to find the OS located on the kd240 starter kit sd card. In addition, this patch correctly configures mio76 and mio77 as gpio pins which are used as reset gpio pins on the kd240 starter kit. Signed-off-by: Neal Frager <neal.frager@amd.com> Link: https://lore.kernel.org/r/20240604083854.2033917-1-neal.frager@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-17arm64: zynqmp: Setup multiboot register to 0Michal Simek
On Kria when board starts from Image A or Image B partition multiboot register is already setup to that location. When reset command is called board is issuing soft reset which start SW at already used location (offset of multiboot * 32k). But board should continue to run from multiboot offset 0 (start of QSPI) and call early bootloader every reboot that's why clear multiboot register to 0 by default to go that route all the time. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/edaf714a778bdd7447533a77b3455e4fd623f9da.1717420131.git.michal.simek@amd.com
2024-06-17spi: versal2: Enable spi drivers for Versal Gen 2Michal Simek
Enable and update OSPI/QSPI/GQSPI drivers to support Versal Gen 2 SoCs. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/691782470f56f7d49a3204f6757296f2752d4156.1716994063.git.michal.simek@amd.com
2024-06-17mmc: versal2: Update zynq_sdhci driver to support AMD Versal Gen 2Michal Simek
Enable tap delay programming for new SoC and also enable it via defconfig. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/f07daded9704cbc393657b65a28933c34a8cec25.1716994063.git.michal.simek@amd.com
2024-06-17soc: versal2: Add SoC driver for AMD Versal Gen 2Michal Simek
Communication is happening via firmware interface (SMC) or via direct register reading if firmware driver is not available. Also enable it via defconfig. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/22cf9c765e47ab03dbf2b8363e6626e809113432.1716994063.git.michal.simek@amd.com
2024-06-17arm64: versal2: Add support for AMD Versal Gen 2Michal Simek
Add support for AMD Versal Gen 2. SoC is based on Cortex-a78ae 4 cluster/2 cpu core each. A lot of IPs are shared with previous families. There are couple of new IP blocks where the most interesting from user point of view is UFS. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/bc2b70831ce1031bd0fac32357bff84936e1310f.1716994063.git.michal.simek@amd.com
2024-06-17arm64: zynqmp: Update rproc nodeMichal Simek
remoteproc node should be updated to be aligned with the latest dt-schema. Reviewed-by: Tanmay Shah <tanmay.shah@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/d8247a46f486a612f85767de9b832ad33fa980fe.1717065556.git.michal.simek@amd.com
2024-06-17xilinx: versal: Do not prioritize boot device if driver is not enabledVenkatesh Yadav Abbarapu
SOC can boot out of the device which is not accessible from APU and running this is detected as a warning, as the device is not accessible.For example getting below warning when the boot mode is OSPI and OSPI is not enabled in device tree. Invalid bus 0 (err=-19) Failed to initialize SPI flash at 0:0 (error -19) Ignoring the prioritization of the boot device which driver is not enabled and continue with the default boot_targets. Recommendation is to use custom boot_targets via environment file as is done for example for Kria via zynqmp_kria.env file. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/8b7cca5c7b84cb4854104e0c48f8aa63c4ec5ace.1715322156.git.michal.simek@amd.com
2024-06-17mtd: spi-nor: Add SPI_NOR_OCTAL_READ flag for mx66uw2g345gx0 flash partPrasad Kummari
Added SPI_NOR_OCTAL_READ flag for Macronix mx66uw2g345gx0 2Gb(256MB) NOR Flash memory. Initial testing was conducted on the Versal NET board using SDR mode, which included basic erase, write, and read-back operations. Signed-off-by: Prasad Kummari <prasad.kummari@amd.com> Link: https://lore.kernel.org/r/20240508052749.214286-1-prasad.kummari@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-17arm64: zynq(mp): Rename spl_board_init() to spl_soc_init()Lukas Funke
Rename spl_board_init() to spl_soc_init(). SoC specific implementation should be separated from board specific implementation in order to be extended by board developers. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Acked-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/20240327121153.2455126-3-lukas.funke-oss@weidmueller.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-17spl: Introduce SoC specific init functionLukas Funke
Some architectures use spl_board_init() in their SoC specific implementation. Board developers should be able to add board specific implementation via spl_board_init(). Hence, introduce a spl_soc_init() method which is called right before spl_board_init() for SoC specific implementation. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Link: https://lore.kernel.org/r/20240327121153.2455126-2-lukas.funke-oss@weidmueller.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-17xilinx: zynqmp: Allow multiboot environment write even in saved environmentKory Maincent
Once the environment was saved, the current multiboot image information became unreachable. When dealing with firmware updates, this information is necessary alongside the saved environment to know the booted image. Move the multiboot environment set operation before the saved environment check to ensure this information is always available. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com> Link: https://lore.kernel.org/r/20240529100107.137159-1-kory.maincent@bootlin.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-17sdhci: zynq: Fix tap delay for SD on Versal NETSimek, Michal
I can't see any way how tap delays are setup on Versal NET platform because xlnx,versal-8.9a compatible string is also used there but driver is not letting to setup tap delays. Not sure if versal_iclk_phases[] is also valid for Versal NET but the patch is made to investigate it. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/e535cfc1a59b5146a5c9a3ab389dc770de80440c.1713427490.git.michal.simek@amd.com
2024-06-17board: zynqmp: Move zynqmp commands from board/ to arch/Charlie Johnston
The zynqmp cmds.c is currently tied to the board but the commands contained within are more closely tied to the architecture. To allow usage of those commands when the architecture is ZynqMP but the board is not, this change moves the cmds into the arch/ tree. The source file is renamed to zynqmp.c to reflect the command name as well. Signed-off-by: Charlie Johnston <charlie.johnston@loftorbital.com> Link: https://lore.kernel.org/r/20240410195008.405061-2-charlie.johnston@loftorbital.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-17xilinx: Enable NVMEM framework for all platformsMichal Simek
Boards which have for example MAC address in eeprom but not in Xilinx format (legacy or FRU) could reference it via nvmem cells. For example: &gem0 { nvmem-cells = <&mac>; nvmem-cell-names = "mac-address"; }; &eeprom { #address-cells = <1>; #size-cells = <1>; mac: mac-address@f0 { reg = <0xf0 6>; }; }; For getting it work above DT changes are required but also CONFIG_NVMEM should be enabled. That's why enable it by default in generic defconfigs to be able to use it directly by changing DT only. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/9c8ee7a4c7a16367438a92a4c9581bac9d968f84.1712815454.git.michal.simek@amd.com
2024-06-17xilinx: zynqmp: Clean up xilinx_zynqmp.hMichal Simek
Options are moving to Kconfig by running sed and comments are staying in that's why do clean up and remove useless comments. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/fa117ac482591d3d5957af54fe99e6acc89972e3.1713167731.git.michal.simek@amd.com
2024-06-13test/py: net_boot: Add test cases for net bootLove Kumar
Add tests for booting image using tftpboot/pxe boot commands, tftpboot boot case loads the FIT image into DDR and boots using bootm command whereas pxe boot cases downloads the pxe configuration file from the TFTP server and interprets it to boot the images mentioned in the pxe configurations file. This test relies on boardenv_* containing configuration values including the parameter 'pattern'. tftpboot/pxe boot cases boots the Linux till the boot log pattern value is matched. For example, if the parameter 'pattern' is defined as 'login:', it will boot till login prompt. Signed-off-by: Love Kumar <love.kumar@amd.com> Tested-by: Tom Rini <trini@konsulko.com>
2024-06-13test/py: Add support to enable check for bad patternLove Kumar
Executing a u-boot command may raise an error or extra bad pattern, beyond the default bad patterns. Providing a way to enable the console output error check in test. For example, description for OS boot test: import re check_type = 'kernel_boot_error' check_pattern = re.compile('ERROR -2: can't get kernel image!') with u_boot_console.enable_check(check_type, check_pattern): u_boot_console.run_command('<boot command>') Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-06-13cmd: bcb: Fix bcb compilation when CONFIG_CMD_BCB=nMattijs Korpershoek
commit dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields") introduced the bcb_get() function. When CONFIG_CMD_BCB=n, that function is stubbed. The stubbed function has a wrong prototype: value_size arg is missing. Add the missing argument to fix build when CONFIG_CMD_BCB=n. Fixes: dfeb4f0d7935 ("cmd: bcb: extend BCB C API to allow read/write the fields") Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Guillaume La Roque <glaroque@baylibre.com> Reviewed-by: Dmitrii Merkurev <dimorinny@google.com> Reviewed-by: Julien Masson <jmasson@baylibre.com>
2024-06-13imxtract: add support for zstd-compressed imagesDmitry Gerasimov
Allow extraction of zstd-compressed images from FIT using imxtract command. This is especially useful when one has to load an image via some interface (e.g. SPI) rather that just to the memory. Signed-off-by: Dmitry Gerasimov <di.gerasimov@gmail.com>
2024-06-13bcmgenet: fix Rx buffer corruption caused by lack of cache flushYasuharu Shibata
When bcmgenet complete to write Rx buffer with the DMA, some U-Boot commands write data to the buffer directly. Those write data will become dirty in CPU cache. After this driver calls free_pkt to the buffer, the buffer is assigned as the future Rx buffer. At some point, if bcmgenet writes to a buffer with DMA and CPU cache flushes dirty data to the buffer, the buffer is corrupted. This patch calls flush_dcache_range in free_pkt to immediately flush the data written by U-Boot command and prevent data corruption. This issue can be reproduced using wget on Raspberry Pi4. If wget receives data larger than RX_BUF_LENGTH * RX_DESCS = 2048 * 256 bytes, it will timeout due to data corruption. In addition, if LOG_DEBUG is enabled in net/tcp.c, the following error log is output. TCP RX TCP xSum Error Signed-off-by: Yasuharu Shibata <yasuharu.shibata@gmail.com>
2024-06-13configs: j784s4: Enable OSPI NOR bootJonathan Humphreys
Set necessary configs to enable the j784s4 device to boot from OSPI NOR flash. Signed-off-by: Jonathan Humphreys <j-humphreys@ti.com>
2024-06-13spl: Kconfig: ARCH_K3: Set default SPL_STACK_R_MALLOC_SIMPLE_LEN for R5 buildVignesh Raghavendra
All ARCH_K3 platforms need about of 2MB of malloc space post reallocation. Since, this space is allocated from SDRAM, provide a generous 2MB space by default. Platforms requiring more than 2MB can override in defconfig as needed. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2024-06-13arm: dts: k3-*-binman: Make default DM file optionalNeha Malcom Francis
The default DM firmware path is non-optional as of now. Make it optional so that users that choose to provide DM via TI_DM argument instead of BINMAN_INDIRS can do so without build errors. Signed-off-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Kamlesh Gurudasani <kamlesh@ti.com>
2024-06-13env: ti: k3_dfu: Drup mmcpart for rootfsNeha Malcom Francis
According to [0], raw access to mmc should not have mmcpart in the entry. This was fixed in k3_dfu_combined.env but k3_dfu.env had been overlooked. [0] doc/usage/dfu.rst Fixes: 53b406369e9d ("DFU: Check the number of arguments and argument string strictly") Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2024-06-13arm: dts: k3-j721s2-r5: Change GTC clock parentNeha Malcom Francis
MAIN_PLL0 has a flag set in DM (Device Manager) that removes its capability to re-initialise clock frequencies. A72 CPU clock (GTC) and RGMII has MAIN_PLL3 as their parent which does not have this flag. While RGMII needs re-initialization to default frequency to be able to get 250MHz with its divider, GTC can not get its required 200MHz with its dividers. Thus move GTC clock parent on J721S2 from MAIN_PLL3_HSDIV1 to MAIN_PLL0_HSDIV6. This was already done on CPTS node in kernel which was similarly affected (linked). Link: https://lore.kernel.org/all/20230605110443.84568-1-n-francis@ti.com/ Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2024-06-13net: phy: Replace PHY_ANEG_TIMEOUT with Kconfig symbolMarek Vasut
Switch PHY_ANEG_TIMEOUT to CONFIG_PHY_ANEG_TIMEOUT Kconfig symbol. This removes one more configuration headers option finalizes its Kconfig symbol conversion. No functional change expected. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-06-13net: phy: Turn default auto-negotiation timeout into Kconfig symbolMarek Vasut
Let users configure default auto-negotiation timeout via Kconfig instead of specifying it in board configuration headers. This is the first step toward converting this to Kconfig fully, so far the legacy PHY_ANEG_TIMEOUT in configuration headers takes precedence. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-06-13Merge patch series "Enable OSPI boot for j721s2"Tom Rini
Manorit Chawdhry <m-chawdhry@ti.com> says: The series enables ospi boot for j721s2. Test logs: https://gist.github.com/manorit2001/6bb91885c608e3a8cb0267ab2c614781
2024-06-12configs: j721s2_evm_*_defconfig: Enable OSPI configsManorit Chawdhry
Enable OSPI related configs to boot using OSPI Reviewed-by: Apurva Nandan <a-nandan@ti.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2024-06-12arch: arm: dts: k3-j721s2-*-u-boot.dtsi: Enable the ospi0 nodeManorit Chawdhry
Enable ospi0 node for all boot stages Reviewed-by: Apurva Nandan <a-nandan@ti.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2024-06-12arch: arm: dts: k3-j721s2-r5: Override ospi and fss for 32-bit modeManorit Chawdhry
R5 being a 32-bit processor can't understand the 64-bit mapping being done in ospi node. Override the ospi node for 32-bit register ranges and the fss node ( the parent node of ospi ) to map the ranges for the updated child node correctly. Reviewed-by: Apurva Nandan <a-nandan@ti.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2024-06-12mtd: spi-nor-core: Do not start or end writes at odd address in DTR modePratyush Yadav
On DTR capable flashes like Micron Xcella the writes cannot start or end at an odd address in DTR mode. Extra 0xff bytes need to be prepended or appended respectively to make sure both the start and end addresses are even. Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Signed-off-by: Apurva Nandan <a-nandan@ti.com> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Tested-by: Jonathan Humphreys <j-humphreys@ti.com> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2024-06-11Merge tag 'efi-next-20240611' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi into next Pull request efi-next-20240611 UEFI: * Allow specifying a device-tree in an EFI load option using the efidebug or eficonfig command. * Let the EFI boot manager fall back to an OS provided device-tree if no device-tree is specified.
2024-06-10efi_loader: rename struct efi_initrd_dp to efi_lo_dp_prefixHeinrich Schuchardt
As we now also store device-tree device-paths in load options rename struct efi_initrd_dp to efi_lo_dp_prefix. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-06-10efi_loader: load distro dtb in bootmgrHeinrich Schuchardt
If no device-tree is specified, try to load a device-tree from the boot device use the $fdtfile concatenated to either of the paths '/dtb/', '/', '/dtb/current/'. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-10efi_loader: export efi_load_image_from_pathHeinrich Schuchardt
We can reuse this function to load the device-tree. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-10efi_loader: return binary from efi_dp_from_lo()Heinrich Schuchardt
For finding distro supplied device-trees we need to know from which device we are booting. This can be identified via the device-path of the binary. Up to now efi_dp_from_lo() only could return the initrd or fdt device-path. Allow returning the binary device-path, too. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-10efi_loader: move distro_efi_get_fdt_name()Heinrich Schuchardt
Move distro_efi_get_fdt_name() to a separate C module and rename it to efi_get_distro_fdt_name(). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-10efi_loader: load device-tree specified in boot optionHeinrich Schuchardt
We allow to specify the triple of binary, initrd, and device-tree in boot options. Add the code to actually load the specified device-tree. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-10cmd: efidebug: add support for setting fdtHeinrich Schuchardt
We already support creating a load option where the device-path field contains the concatenation of the binary device-path and optionally the device path of the initrd which we expose via the EFI_LOAD_FILE2_PROTOCOL. Allow to append another device-path pointing to the device-tree identified by the device-tree GUID. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-10cmd: eficonfig: add support for setting fdtHeinrich Schuchardt
We already support creating a load option where the device-path field contains the concatenation of the binary device-path and optionally the device path of the initrd which we expose via the EFI_LOAD_FILE2_PROTOCOL. Allow to append another device-path pointing to the device-tree identified by the device-tree GUID. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-10efi_loader: allow concatenation with contained end nodeHeinrich Schuchardt
Allow appending a device-path to a device-path that contains an end node as separator. We need this feature for creating boot options specifying kernel, initrd, and dtb. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-07Added arm64 assembly for examples/api crt0Brunham, Kalen
I've encountered a problem when compiling the 'examples/api' directory for ARM64 in U-boot. The problem lies in the assembly code in 'examples/api/crt0.S' where the current CONFIG_ARM code is only 32-bit. When targeting ARM64, a 64-bit version is necessary. I have proposed a fix by including a 'CONFIG_ARM64' section in the assembly code as shown below. These changes have been check via https://github.com/u-boot/u-boot/pull/538. Feedback is welcome. Signed-off-by: Kalen Brunham <kalen.brunham@intel.com>
2024-06-07abootimg: Add init_boot image supportRoman Stratiienko
Quote from [1]: "For devices launching with Android 13, the generic ramdisk is removed from the boot image and placed in a separate init_boot image. This change leaves the boot image with only the GKI kernel." While at it, update wrong error handling message when vendor_boot cannot be loaded. [1]: https://source.android.com/docs/core/architecture/partitions/generic-boot Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-06-07android: Fix ramdisk loading for bootimage v3+Roman Stratiienko
The boot_ramdisk and vendor_ramdisk must be both concatenated together. Without this change, Android root is missing some of the necessary tools to complete virtual AB OTA. Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-06-07arm: move _end to linker symbolsIlias Apalodimas
commit 6e2228fb052b ("Merge patch series "Clean up arm linker scripts") was cleaning up linker scripts for armv7 and v8 but was leaving _end and __secure_stack_start/end. commit d0b5d9da5de2 ("arm: make _end compiler-generated") was moving _end to be compiler generated. _end is defined as c variable in its own section to force the compiler emit relative a reference. However, defining those in the linker script will do the same thing since [0]. So let's remove the special sections from the linker scripts, the variable definitions from sections.c and define them as a symbols. It's worth noting that _image_binary_end symbol is now redundant and can be removed in the future. - SPL The .end section has been removed from the new binary [ 5] .end PROGBITS 00000000fffdf488 000000000002f488 0 0000000000000000 0000000000000000 0 1 [0000000000000003]: WRITE, ALLOC $~ bloat-o-meter kria_old/spl/u-boot-spl krina_new/spl/u-boot-spl add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) Function old new delta Total: Before=115980, After=115980, chg +0.00% $~ readelf -sW kria_old/u-boot kria_new/u-boot | grep -w _end 12047: 000000000813a0f0 0 OBJECT GLOBAL DEFAULT 11 _end 12047: 000000000813a118 0 NOTYPE GLOBAL DEFAULT 11 _end $~ readelf -sW kria_old/spl/u-boot-spl kria_new/spl/u-boot-spl | grep -w _end 1605: 00000000fffdf488 0 OBJECT GLOBAL DEFAULT 5 _end 1603: 00000000fffdf498 0 NOTYPE GLOBAL DEFAULT 4 _end $~ readelf -sW old/u-boot new/u-boot | grep -w _end 8847: 0000000000103710 0 OBJECT GLOBAL DEFAULT 11 _end 8847: 0000000000103738 0 NOTYPE GLOBAL DEFAULT 11 _end $~ readelf -sW old_v7/u-boot new_v7/u-boot | grep -w _end 10638: 000da824 0 OBJECT GLOBAL DEFAULT 10 _end 10637: 000da84c 0 NOTYPE GLOBAL DEFAULT 10 _end - For both QEMU instances $~ bloat-o-meter old/u-boot new/u-boot add/remove: 0/0 grow/shrink: 1/0 up/down: 20/0 (20) Function old new delta version_string 50 70 +20 Total: Before=656915, After=656935, chg +0.00% [0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-06-07image: Set load_end on partial loadsMattijs Korpershoek
When decompressing, it's possible that the algorithm only performs a partial decompression. This usually happens when CONFIG_SYS_BOOTM_LEN is too small for the uncompressed image. When that happens, image_decomp() returns an error and *load_end == load. The error is then handled by handle_decomp_error(). handle_decomp_error() expects the number of uncompressed bytes in uncomp_size but receives *load_end - load == load - load == 0. Because of this, handle_decomp_error does not report the expected "Image too large: increase CONFIG_SYS_BOOTM_LEN" error message. Modify the image_decomp() logic to always report the decompressed size, even when a partial decompression happened. Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>