summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* binman: Indicate how to make binman verboseSimon Glass2021-03-021-1/+3
| | | | | | | | Add notes about how to make binman produce verbose logging when building. Add a comment on how to do this. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools/mkeficapsule.c: fix DEBUG buildKlaus Heinrich Kiwi2021-02-261-1/+1
| | | | | | | | | | | | | Fix a missing comma sign (,) from a printf(), that is only reachable if DEBUG is defined, in which case the build fails with: tools/mkeficapsule.c:266:36: error: expected ‘)’ before ‘bin’ 266 | printf("\tbin: %s\n\ttype: %pUl\n" bin, guid); | ^~~~ | ) Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* image: Adjust the workings of fit_check_format()Simon Glass2021-02-153-2/+5
| | | | | | | | | | | | | | | | | At present this function does not accept a size for the FIT. This means that it must be read from the FIT itself, introducing potential security risk. Update the function to include a size parameter, which can be invalid, in which case fit_check_format() calculates it. For now no callers pass the size, but this can be updated later. Also adjust the return value to an error code so that all the different types of problems can be distinguished by the user. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Bruce Monroe <bruce.monroe@intel.com> Reported-by: Arie Haenel <arie.haenel@intel.com> Reported-by: Julien Lenoir <julien.lenoir@intel.com>
* buildman: 'Thread' object has no attribute 'isAlive'Heinrich Schuchardt2021-02-141-1/+1
| | | | | | | | | | | The isAlive() method was deprecated in Python 3.8 and has been removed in Python 3.9. See https://bugs.python.org/issue37804. Use is_alive() instead. Since Python 2.6 is_alive() has been a synonym for isAlive(). So there should be no problems for users using elder Python 3 versions. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools/fit_check_sign.c: Update usage function.Ilies CHERGUI2021-02-011-2/+3
| | | | | | | Add "-c" option to set the configuration name when checking the FIT image signature. Signed-off-by: Ilies CHERGUI <ilies.chergui@gmail.com>
* Merge tag 'dm-pull-30jan21' of ↵Tom Rini2021-01-3124-36/+393
|\ | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-dm tpm fixes for coral binman fixes support for symbols in sub-sections support for additional cros_ec commands various minor fixes / tweaks
| * binman: Allow for skip_at_start when reading entriesSimon Glass2021-01-303-4/+48
| | | | | | | | | | | | | | The offset of an entry needs to be adjusted by its skip-at-start value. This is currently missing when reading entry data. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Support alignment of filesSimon Glass2021-01-307-1/+53
| | | | | | | | | | | | | | | | When packing files it is sometimes useful to align the start of each file, e.g. if the flash driver can only access 32-bit-aligned data. Provides a new property to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Allow vblock to include devicetree blobsSimon Glass2021-01-305-10/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At present if a devicetree blob is included in a vblock it does not deal with updates. This is because the vblock is created once at the start and does not have a method to update itself later, after all the entry contents are finalised. Fix this by adjusting how the vblock is created. Also simplify Image.ProcessEntryContents() since it effectively duplicates the code in Section.ProcessContents(). Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Support reading an image with entry argsSimon Glass2021-01-305-4/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally when an entry is created, any entry arguments it has are required to be provided, so it can actually generate its contents correctly. However when an existing image is read, Entry objects are created for each of the entries in the image. This happens as part of the process of reading the image into binman. In this case we don't need the entry arguments, since we do not intend to regenerate the entries, or at least not unless requested. So there is no sense in reporting an error for missing entry arguments. Add a new property for the Image to handle this case. Update the error reporting to be conditional on this property. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Support finding symbols in sub-sectionsSimon Glass2021-01-306-7/+123
| | | | | | | | | | | | | | | | | | | | At present binman only supports resolving symbols in the same section as the binary that uses it. This is quite limited because we often need to group entries into different sections. Enhance the algorithm to search the entire image for symbols. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Fix a few file commentsSimon Glass2021-01-302-2/+1
| | | | | | | | | | | | Two files have the wrong comment at the top of them. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Show the size when writing entriesSimon Glass2021-01-301-1/+2
| | | | | | | | | | | | Update the log output to show the size, since this is useful information. Signed-off-by: Simon Glass <sjg@chromium.org>
| * binman: Update the TODO listSimon Glass2021-01-301-2/+1
| | | | | | | | | | | | | | Two of the items have been completed and I thought of another one. Update the list. Signed-off-by: Simon Glass <sjg@chromium.org>
| * patman: Correct lz4 compression parametersSimon Glass2021-01-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | At present on large files, lz4 uses a larger block size (e.g. 256KB) than the 64KB supported by the U-Boot decompression implementation. Also it is optimised for maximum compression speed, producing larger output than we would like. Update the parameters to correct these problems. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: binman: Drop Python 2 codeSimon Glass2021-01-302-4/+3
| | | | | | | | | | | | Drop a few more Python 2 relics that are no-longer needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* | tools: add mkeficapsule to .gitignoreHeinrich Schuchardt2021-01-291-0/+1
|/ | | | | | mkeficapsule is a build product. Add it to .gitignore Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* Merge tag 'efi-2021-04-rc1-3' of ↵Tom Rini2021-01-231-15/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-efi Pull request for UEFI sub-system for efi-2021-04-rc1-3 Bug fixes for UEFI sub-system: * correct value of EFI_BLOCK_IO_PROTOCOL.Media.LastBlock * correct GUID when closing of EFI_LOAD_FILE_PROTOCOL * error handling in mkeficapsule tool Bug fixes for FAT file system: * consistent error handling for flush dir()
| * mkeficapsule: Miscellaneous fixes in the utilitySughosh Ganu2021-01-231-15/+23
| | | | | | | | | | | | | | | | Miscellaneous fixes in the mkeficapsule utility -- these include a few resource leak issues flagged by Coverity along with some additional code improvements suggested by Heinrich during code review. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
| * tools: mkeficapsule: fill reserved members of structureAKASHI Takahiro2021-01-231-0/+3
| | | | | | | | | | | | | | | | | | Fill reserved members of efi_firmware_management_capsule_image_header structure with zero's for safety. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Fixes: CID 316354 Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* | tools: env: return error if ubi_update_start() failsMartin Hundebøll2021-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | The UBI_IOCVOLUP ioctl can fail if exclusive access to the volume isn't obtained. If this happens, the flush operation doesn't return error, leaving the caller without knowledge of missing flush. Fix this by forwarding the error (-1) from ubi_update_start(). Fixes: 34255b92e6e ("tools: env: Add support for direct read/write UBI volumes") Signed-off-by: Martin Hundebøll <martin@geanix.com>
* | mkimage: Move padding commands outside of FIT_SIGNATUREJoel Stanley2021-01-221-5/+6
| | | | | | | | | | | | | | | | These commands were disabled when CONFIG_FIT_SIGNATURE is disabled, but they do not depend on crypto support so they can be unconditionally enabled. Signed-off-by: Joel Stanley <joel@jms.id.au>
* | tools/Makefile: FIT_CIPHER requires libsslJoel Stanley2021-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If CONFIG_FIT_CIPHER is enabled without CONFIG_FIT_SIGNATURE then mkimage/dumpimage will fail to link: /usr/bin/ld: tools/common/image-cipher.o: in function `fit_image_decrypt_data': image-cipher.c:(.text+0x9a): undefined reference to `image_get_host_blob' /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x10): undefined reference to `EVP_aes_128_cbc' /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x40): undefined reference to `EVP_aes_192_cbc' /usr/bin/ld: tools/common/image-cipher.o:(.data.rel+0x70): undefined reference to `EVP_aes_256_cbc' /usr/bin/ld: tools/lib/aes/aes-encrypt.o: in function `image_aes_encrypt': aes-encrypt.c:(.text+0x22): undefined reference to `EVP_CIPHER_CTX_new' /usr/bin/ld: aes-encrypt.c:(.text+0x6f): undefined reference to `EVP_EncryptInit_ex' /usr/bin/ld: aes-encrypt.c:(.text+0x8d): undefined reference to `EVP_EncryptUpdate' /usr/bin/ld: aes-encrypt.c:(.text+0xac): undefined reference to `EVP_CIPHER_CTX_free' /usr/bin/ld: aes-encrypt.c:(.text+0xf2): undefined reference to `EVP_EncryptFinal_ex' collect2: error: ld returned 1 exit status Signed-off-by: Joel Stanley <joel@jms.id.au>
* | tools: image-host: add support for several sub-imagesPhilippe Reynes2021-01-221-15/+21
| | | | | | | | | | | | | | | | | | The propoerty sign-images points to images in the configuration node. But thoses images may references severals "sub-images" (for example for images loadable). This commit adds the support of severals sub-images. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* | tools: image-host: clean function fit_config_get_hash_listPhilippe Reynes2021-01-221-56/+76
|/ | | | | | | | This commit creates a function fit_config_add_hash that will be used in the next commit to support several 'sub-images'. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* tools: mtk_image: add support for booting ARM64 imagesFabien Parent2021-01-182-5/+29
| | | | | | | | | | | mkimage is only able to package aarch32 binaries. Add support for AArch64 images. One can create a ARM64 image using the following command line: mkimage -T mtk_image -a 0x201000 -e 0x201000 -n "media=emmc;arm64=1" -d bl2.bin bl2.img Signed-off-by: Fabien Parent <fparent@baylibre.com>
* Merge branch '2021.04-rc' of https://github.com/lftan/u-bootTom Rini2021-01-151-16/+70
|\ | | | | | | | | - Add ATF flow for SoC64 devices - Update socfpgaimage to support print header and update padding flow
| * tools: socfpgaimage: update padding flowLey Foon Tan2021-01-151-13/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing socfpgaimage always pads the image to the maximum size of OCRAM size. This will break in the encryption flow where it expects the image to be un-padded. The encryption tool will do the encryption for the whole image and append the signature key at end of the image. The signature key will append to beyond the size of OCRAM if the image is padded with the maximum size before encryption. Move the padding step from socfpgaimage to Makefile and pads with objcopy command. socfpgaimage will pad the image with 16 bytes aligned (including CRC word), this is a requirement in encryption flow. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
| * tools: socfpgaimage: Print image header informationLey Foon Tan2021-01-151-3/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Print image header information if the header is verified. Example output from mkimage "-l" option: $ ./tools/mkimage -l spl/u-boot-spl.sfp Image Type : Cyclone V / Arria V SoC Image Validation word : 0x31305341 Version : 0x00000000 Flags : 0x00000000 Program length : 0x00003a59 Header checksum : 0x00000188 $ ./tools/mkimage -l spl/u-boot-spl.sfp Image Type : Arria 10 SoC Image Validation word : 0x31305341 Version : 0x00000001 Flags : 0x00000000 Header length : 0x00000014 Program length : 0x000138e0 Program entry : 0x00000014 Header checksum : 0x00000237 Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
* | tools: efivar.py unused variableHeinrich Schuchardt2021-01-131-1/+1
| | | | | | | | | | | | | | Unused variables should be called '_'. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
* | tools: efivar.py should check GUID when deletingHeinrich Schuchardt2021-01-131-1/+1
| | | | | | | | | | | | | | | | When deleting a variable we must check that the GUID provided by the user matches the GUID of the variable. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
* | tools: efivar.py: incorrect indentationHeinrich Schuchardt2021-01-131-15/+15
| | | | | | | | | | | | | | | | According to https://pep8.org/#indentation we should use 4 spaces per indentation level. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
* | tools: efivar.py without argumentsHeinrich Schuchardt2021-01-131-1/+4
|/ | | | | | | | | | | | | | | | When tools: efivar.py is called without arguments an error occurs: Traceback (most recent call last): File "tools/efivar.py", line 380, in <module> main() File "tools/efivar.py", line 360, in main args.func(args) AttributeError: 'Namespace' object has no attribute 'func' Show the online help if the arguments do not specify a function. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
* tools: mkimage: Add Allwinner eGON supportAndre Przywara2021-01-112-0/+137
| | | | | | | | | | | | | | | 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>
* Merge tag 'xilinx-for-v2021.04' of ↵Tom Rini2021-01-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2021.04 arm64: - DT updates microblaze: - Add support for NOR device support spi: - Fix unaligned data write issue nand: - Minor code change xilinx: - Fru fix in limit calculation - Fill git repo link for all Xilinx boards video: - Add support for seps525 spi display tools: - Minor Vitis file support cmd/common - Minor code indentation fixes serial: - Uartlite debug uart initialization fix
| * tools: zynqmp: Fix regex expression around XPm_ConfigObjectAdrian Fiergolski2021-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The XPm_ConfigObject array definition generated by Vitis 2020.1 differs from previous Vivado versions (before 2019.2). -const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) = { +const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) = +#elif defined (__ICCARM__) +#pragma location = ".sys_cfg_data" +__root const u32 XPm_ConfigObject[] = +#endif +{ Change the matching regex to handle both cases. Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com> Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* | Merge tag 'dm-pull-5jan21' of git://git.denx.de/u-boot-dm into nextTom Rini2021-01-059-512/+779
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Driver model: make some udevice fields private Driver model: Rename U_BOOT_DEVICE et al. dtoc: Tidy up and add more tests ns16550 code clean-up x86 and sandbox minor fixes for of-platdata dtoc prepration for adding build-time instantiation
| * | dtoc: Tidy up src_scan testsSimon Glass2021-01-051-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some of these tests don't actually check anything. Add a few more checks to complete the tests. Also add a simple scan test that does the basics. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Move src_scan tests to a separate fileSimon Glass2021-01-055-78/+97
| | | | | | | | | | | | | | | | | | | | | Move the tests related to scanning into their own class, updating them to avoid using dtb_platdata as a pass-through. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Split source-code scanning to a separate fileSimon Glass2021-01-053-169/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before expanding the scanning features any more, move this into a separate file. This will make it easier to maintain in the future. In particular, it reduces the size of dtb_platdata.py and allows us to add tests specifically for scanning, without going through that file. The pieces moved are the Driver class, the scanning code and the various naming functions, since they mostly depend on the scanning results. So far there is are no separate tests for src_scan. These will be added as new functionality appears. This introduces no functional change. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Drop dm_populate_phandle_data()Simon Glass2021-01-052-28/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has not been needed since parent information was added and we started using indicies for references to other drivers instead of pointers. It was kept around in the expectation that it might be needed later. However with the latest updates, it doesn't seem likely that we'll need this in the foreseeable future. Drop dm_populate_phandle_data() from dtoc and driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Output nodes in orderSimon Glass2021-01-052-43/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we had to worry about nodes being output before those that they depended on, thus causing build errors. So the current algorithm is careful to output nodes in the right order. We now use a different method for outputting phandles that does not involve pointers. Also we plan to add a 'declarations' header file to declare all drivers as 'extern'. Update the code to drop the dependency checking and output in a simple loop. This makes the output easier to follow since drivers are in order of thier indices (0, 1, ...), which is also the order it appears in in the linker list. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Allow specifying the base directory for testsSimon Glass2021-01-052-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The base directory of U-Boot, where the source is, it currently calculated from the directory of the dtb_platdata.py script. If this is installed elsewhere that will not work. Also it is inconvenient for tests. Add a parameter to allow specifying this base directory. To test this, pass a temporary directory with some files in it and check that they are passed to scan_driver(). Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Add the method for each command to OutputFileSimon Glass2021-01-051-26/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than the if/else construct, update OutputFile with the method to call to process each command. This is easier to maintain as the number of commands increases. Rename generate_tables to generate_plat since it better describes what is being generated ('plat' is the U-Boot name for platform data). With this, each output method needs to have the same signature. Store the output structures in a member variable instead of using parameters, to accomplish this. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Rename dt-platdata.c to dt-plat.cSimon Glass2021-01-052-4/+4
| | | | | | | | | | | | | | | | | | | | | Use this new name to be consistent with the rest of U-Boot, which talks about 'plat' for the platform data, which is what this file holds. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Add a header comment to each generated fileSimon Glass2021-01-052-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is currently fairly obvious what the two generated files are for, but this will change as more are added. It is helpful for readers to describe the purpose of each file. Add a header commment field to OutputFile and use it to generate a comment at the top of each file. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dtoc: Run tests using test_utilSimon Glass2021-01-051-21/+10
| | | | | | | | | | | | | | | | | | | | | | | | Use the standard function for running tests and reported results. This allows the tests to run in parallel, which is a significant speed-up on most machines (e.g. 4.5 seconds -> 1.5s on mine). Signed-off-by: Simon Glass <sjg@chromium.org>
| * | concurrencytest: Fix Python3 warningSimon Glass2021-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives a warning in some situations: File "tools/dtoc/../concurrencytest/concurrencytest.py", line 95, in do_fork stream = os.fdopen(c2pread, 'rb', 1) File "/usr/lib/python3.8/os.py", line 1023, in fdopen return io.open(fd, *args, **kwargs) RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used Fix this by dropping the line-buffer parameter. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dm: Rename U_BOOT_DRIVER_ALIAS to DM_DRIVER_ALIASSimon Glass2021-01-052-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use the U_BOOT_ prefix (i.e. U_BOOT_DRIVER) to declare a driver but in every other case we just use DM_. Update the alias macros to use the DM_ prefix. We could perhaps rename U_BOOT_DRIVER() to DM_DRIVER(), but this macro is widely used and there is at least some benefit to indicating it us a U-Boot driver, particularly for code ported from Linux. So for now, let's keep that name. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dm: Rename DM_GET_DEVICE() to DM_DRVINFO_GET()Simon Glass2021-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does not get a device (struct udevice *) but a struct driver_info * so the name is confusing. Rename it accordingly. Since we plan to have several various of these macros, put GET at the end instead of the middle, so it is easier to spot the related macros. Signed-off-by: Simon Glass <sjg@chromium.org>