- Mar 28, 2022
-
-
Jérôme Carretero authored
The code was mistakenly initializing the input buffer twice. Tested to be working on BeagleBone by adjusting CONFIG_SYS_BOOTM_LEN to 64MiB (probably works with less) and preparing uImage with: cat arch/arm/boot/Image \ | zstd --ultra -22 --zstd=windowLog=22 \ > linux.bin.zst mkimage -A arm -T kernel uImage -C zstd -d linux.bin.zst \ -a 0x80008000 -e 0x80008000 Without the windowLog restriction, bootm fails with a zstd decompression error 7 (window too large), which I haven't troubleshooted. There should be a bit more documentation on the feature... Reviewed-by:
Simon Glass <sjg@chromium.org> Fixes: 458b30af image: Update image_decomp() to avoid ifdefs
-
- Jan 19, 2022
-
-
Heinrich Schuchardt authored
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>
-
- Jan 13, 2022
-
-
Thomas Huth authored
LynxOS needed the do_bootm_lynxkdi() function that got removed in 7e713067 ("Remove LYNX KDI remainders") - and that function needed a lynxkdi_boot() function, where the last implementation had been removed in 98f705c9 ("powerpc: remove 4xx support") already. Looks like this OS is definitely not supported anymore, so remove it from the corresponding lists. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Stefan Roese <sr@denx.de>
-
- Nov 15, 2021
-
-
Andy Shevchenko authored
Compiler is not happy: common/image-board.c: In function ‘boot_get_kbd’: common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration] 902 | do_bdinfo(NULL, 0, 0, NULL); | ^~~~~~~~~ Move the forward declaration to a header. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Nov 12, 2021
-
-
Thomas Huth authored
The last board that used to set CONFIG_LYNXKDI has been removed in commit 242836a8 ("powerpc: ppc4xx: remove pcs440ep support"), doc/README.lynxkdi only talks about a MPC8260 board being supported, and the mpc8260 support has been removed four years ago in commit 2eb48ff7 ("powerpc, 8260: remove support for mpc8260") already, and common/lynxkdi.c only consists of an "#error" statement these days, so it seems like the LYNX KDI code is dead code nowadays. Let's remove it now. Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Simon Glass authored
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>
-
- Oct 09, 2021
-
-
Simon Glass authored
At present U-Boot has a header file called lz4.h for its own use. If the host has its own lz4 header file installed (e.g. from the 'liblz4-dev' package) then host builds will use that instead. Move the U-Boot file into its own directory, as is done with various other headers with the same problem. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Oct 08, 2021
-
-
Simon Glass authored
Add a host Kconfig for OF_LIBFDT. With this we can use CONFIG_IS_ENABLED(OF_LIBFDT) directly in the tools build, so drop the unnecessary indirection. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Alexandru Gagniuc <mr.nuke.me@gmail.com>
-
Simon Glass authored
Make use of the host Kconfig for FIT. With this we can use CONFIG_IS_ENABLED(FIT) directly in the host build, so drop the unnecessary indirection. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Alexandru Gagniuc <mr.nuke.me@gmail.com>
-
Simon Glass authored
With the new TOOLS_LIBCRYPTO and some other changes, it seems that we are heading towards calling this a tools build rather than a host build, although of course it does happen on the host. I cannot think of anything built by the host which cannot be described as a tool, so rename this function. Signed-off-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Alexandru Gagniuc <mr.nuke.me@gmail.com>
-
Simon Glass authored
Rather than adding an #ifdef and open-coding this calculation, add a helper function to handle it. Use this in the image code. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
To avoid having #ifdefs in a few functions which are completely different in the board and host code, create a new image-host.c file. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
To avoid a large #ifdef in the image.c file, move the affected code into a separate file. Avoid any style fix-ups for easier review. Those are in the next patch. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Adjust this function so that preprocessor macros are not needed. With this, the host build uses more of the same header files as the target build. Rather than definining CONFIG_SYS_MALLOC_LEN, add a CONSERVE_MEMORY define, since that is the purpose of the value. This appears to have no impact on code size from a spot check of a few boards (snow, firefly-rk3288, boston32r2el, m53menlo). Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The zstd implementation prints the error in image_decomp() which is incorrect and does not match other algorithms. Drop this and let the caller report the error. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
At present this function is full of preprocessor macros. Adjust it to check for an unsupported algorithm after the switch(). This will allow us to drop the macros. Fix up the return-value path and an extra blank line while we are here. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
The existing zstd API requires the same sequence of calls to perform its task. Create a helper for U-Boot, to avoid code duplication, as is done with other compression algorithms. Make use of of this from the image code. Note that the zstd code lacks a test in test/compression.c and this should be added by the maintainer. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Oct 07, 2021
-
-
Samuel Holland authored
bootm_low is used as a base address is used to allocate space for the FDT blob, initrd, cmdline, etc. when booting Linux. Set the default value for RISC-V to the start of the first DRAM bank, so platforms can get their DRAM layout from the device tree, and do not need to define CONFIG_SYS_SDRAM_BASE. Signed-off-by:
Samuel Holland <samuel@sholland.org> Reviewed-by:
Leo Yu-Chi Liang <ycliang@andestech.com>
-
- Sep 23, 2021
-
-
Artem Lapkin authored
Add lz4 and zstd compression magic map. Already can decompress images with lz4 and zstd compression type. Signed-off-by:
Artem Lapkin <art@khadas.com>
-
- Aug 02, 2021
-
-
Simon Glass authored
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>
-
- Mar 01, 2021
-
-
Frieder Schrempf authored
Some compression algorithms currently can be enabled for SPL and U-Boot proper separately. Therefore take into account USE_HOSTCC is well as CONFIG_IS_ENABLED() in these cases to prevent compiling these functions in case of a host tool build. Signed-off-by:
Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by:
Tim Harvey <tharvey@gateworks.com>
-
- Feb 02, 2021
-
-
Simon Glass authored
Move this out of the common header and include it only where needed. In a number of cases this requires adding "struct udevice;" to avoid adding another large header or in other cases replacing / adding missing header files that had been pulled in, very indirectly. Finally, we have a few cases where we did not need to include <asm/global_data.h> at all, so remove that include. Signed-off-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Tom Rini <trini@konsulko.com>
-
- Jan 12, 2021
-
-
Andre Przywara authored
So far we used the separate mksunxiboot tool for generating a bootable image for Allwinner SPLs, probably just for historical reasons. Use the mkimage framework to generate a so called eGON image the Allwinner BROM expects. The new image type is called "sunxi_egon", to differentiate it from the (still to be implemented) secure boot TOC0 image. Signed-off-by:
Andre Przywara <andre.przywara@arm.com> Reviewed-by:
Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by:
Samuel Holland <samuel@sholland.org> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Oct 22, 2020
-
-
Naoki Hayama authored
Fix some comments about functions. Move genimg_get_comp_name() above genimg_get_short_name() because genimg_get_comp_name() is related to get_table_entry_name(). Signed-off-by:
Naoki Hayama <naoki.hayama@lineo.co.jp> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Naoki Hayama authored
Add a generic function which can check whether a category has an entry ID. Signed-off-by:
Naoki Hayama <naoki.hayama@lineo.co.jp> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
- Aug 27, 2020
-
-
Baruch Siach authored
When board_get_usable_ram_top() limits gd->ram_top, env_get_bootm_size() must not exceed that limit. Otherwise, boot_relocate_fdt() might put fdt out of the allowed RAM range. The similar commit 8ce1f10c ("ARM: bootm: take into account gd->ram_top") exposed this bug. This fixes boot on Armada 8040 based Clearfog GT-8K where ram_top is set to 0x80000000 (2GB), but bi_dram[0].size might be up to 0xc0000000 (3GB). Note the relocated fdt address (0xbfff4000) in the console output listed below: Found /extlinux/extlinux.conf Retrieving file: /extlinux/extlinux.conf 62 bytes read in 21 ms (2 KiB/s) 1: linux Retrieving file: /extlinux/Image 13740544 bytes read in 1266 ms (10.4 MiB/s) Retrieving file: /extlinux/armada-8040-clearfog-gt-8k.dtb 33368 bytes read in 31 ms (1 MiB/s) Booting using the fdt blob at 0x4f00000 Loading Device Tree to 00000000bfff4000, end 00000000bffff257 ... "Synchronous Abort" handler, esr 0x96000045 elr: 000000000006e1cc lr : 0000000000068fd8 (reloc) elr: 000000007ffa91cc lr : 000000007ffa3fd8 x0 : ffffffffffffffff x1 : 00000000bfffc258 x2 : 0000000000000000 x3 : ffffffffffff7da7 x4 : 0000000004f08258 x5 : 00000000bfff4000 x6 : 00000000bfff4000 x7 : 000000000000000f x8 : 000000007fb23bf8 x9 : 0000000000000008 x10: 00000000bffff257 x11: 00000000bffff257 x12: 0000000000000000 x13: fffffffffffff000 x14: 00000000bfff4000 x15: 0000000000000021 x16: 000000007ff7bc38 x17: 0000000000000000 x18: 000000007fb2add0 x19: 00000000bfff4000 x20: 0000000004f00000 x21: 000000000000b258 x22: 0000000058820000 x23: 0000000000000010 x24: 000000007ffe3c40 x25: 000000007fb23cb8 x26: 00000000c0000000 x27: 0000000000000000 x28: 000000007fc3fd50 x29: 000000007fb23bd0 Code: 54000061 aa0603e0 d65f03c0 38606882 (38206822) Resetting CPU ... Thanks to Patrice CHOTARD who directed me to the right way. Signed-off-by:
Baruch Siach <baruch@tkos.co.il>
-
- Aug 26, 2020
-
-
Stefan Roese authored
Use only gd->ram_base/_size in env_get_bootm_size() instead of bi_dram[] in some cases and bi_memstart in others. Signed-off-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Simon Glass <sjg@chromium.org>
-
Stefan Roese authored
Since commit 86cf1c82 ("configs: Migrate CONFIG_NR_DRAM_BANKS") & commit 999a772d ("Kconfig: Migrate CONFIG_NR_DRAM_BANKS"), CONFIG_NR_DRAM_BANKS is always defined with a value (4 is default). It makes no sense to still carry code that is guarded with "#ifndef CONFIG_NR_DRAM_BANKS" (and similar). This patch removes all these unreferenced code paths. Signed-off-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Bin Meng <bmeng.cn@gmail.com>
-
- Jul 17, 2020
-
-
Masahiro Yamada authored
The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by:
Masahiro Yamada <masahiroy@kernel.org>
-
- Jul 07, 2020
-
-
Robert Marko authored
This patch adds support for ZSTD decompression of FIT images. Signed-off-by:
Robert Marko <robert.marko@sartura.hr> Cc: Luka Perkov <luka.perkov@sartura.hr>
-
- May 19, 2020
-
-
Simon Glass authored
Move this header out of the common header. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
We should not use typedefs in U-Boot. They cannot be used as forward declarations which means that header files must include the full header to access them. Drop the typedef and rename the struct to remove the _s suffix which is now not useful. This requires quite a few header-file additions. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- May 18, 2020
-
-
Simon Glass authored
Move this uncommon header out of the common header. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Move this fairly uncommon header out of the common header. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
Simon Glass authored
Move this header out of the common header. Network support is used in quite a few places but it still does not warrant blanket inclusion. Note that this net.h header itself has quite a lot in it. It could be split into the driver-mode support, functions, structures, checksumming, etc. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Apr 17, 2020
-
-
Atish Patra authored
Currently, there is no method that can detect compression types given a file. This is very useful where a compressed kernel image is loaded directly to the memory. Inspect initial few bytes to figure out compression type of the image. It will be used in booti method for now but can be reused any other function in future as well. Signed-off-by:
Atish Patra <atish.patra@wdc.com> Reviewed-by:
Tom Rini <trini@konsulko.com>
-
- Feb 06, 2020
-
-
Simon Glass authored
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jan 24, 2020
-
-
Simon Glass authored
These global variables are quite short and generic. In fact the same name is more often used locally for struct members and function arguments. Add a image_ prefix to make them easier to distinguish. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jan 17, 2020
-
-
Simon Glass authored
These global variables are quite short and generic. In fact the same name is more often used locally for struct members and function arguments. Add a image_ prefix to make them easier to distinguish. Signed-off-by:
Simon Glass <sjg@chromium.org>
-
- Jan 07, 2020
-
-
Cristian Ciocaltea authored
Add a new OS type to be used for chain-loading an EFI compatible firmware or boot loader like GRUB2, possibly in a verified boot scenario. Bellow is sample ITS file that generates a FIT image supporting secure boot. Please note the presence of 'os = "efi";' line, which identifies the currently introduced OS type: / { #address-cells = <1>; images { efi-grub { description = "GRUB EFI"; data = /incbin/("bootarm.efi"); type = "kernel_noload"; arch = "arm"; os = "efi"; compression = "none"; load = <0x0>; entry = <0x0>; hash-1 { algo = "sha256"; }; }; }; configurations { default = "config-grub"; config-grub { kernel = "efi-grub"; signature-1 { algo = "sha256,rsa2048"; sign-images = "kernel"; }; }; }; }; Signed-off-by:
Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Reviewed-by:
Heinrich Schuchardt <xypron.glpk@gmx.de>
-