summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2023-03-20display: resize the bmp logokeith.zhao1-0/+0
reduce the bmp size as the uboot partttion is 4M Signed-off-by: keith <keith.zhao@starfivetech.com>
2023-03-17CR_4094 display: update uboot logo display function:keith.zhao1-0/+0
2023-02-17display : uboot logo displaykeith.zhao1-1/+1
replace the logo bmp for uboot logo display Signed-off-by:keith.zhao<keith.zhao@statfivetech.com>
2023-02-17board:riscv:jh7110: modify config for starfive JH7110 boardkeith.zhao1-1/+1
add board_late_init to init display memory config the bitmap picture Signed-off-by:keith.zhao<keith.zhao@statfivetech.com>
2021-09-18Revert "mkeficapsule: Remove dtb related options"Simon Glass1-7/+222
This reverts commit f86caab058ff062ce72b24cd1ab9ec1253cc1352. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-09-11tools: k3_fit_atf: Fix DM binary FIT load addressesSuman Anna1-2/+2
The DM binary runs on the MCU R5F Core0 after R5 SPL on J721E and J7200 SoCs. The binary is built alongside the TFA, OPTEE and A72 SPL binaries and included in the tispl.bin FIT image. The R5 SPL loads the DM binary at 0xA0000000 address, based on the value used in the FIT image build script. The DM binary though is an ELF image and not a regular binary file, and so is processed further to load the actual program segments using the U-Boot's standard ELF loader library. The DM binary does leverage a certain portion of DDR for its program segments, and typically reserves 16 MB of DDR at 0xA0000000 with the 1st MB used for IPC between Linux and the remote processor, and remaining memory for firmware segments. This can cause an incomplete loading of the program segments if the DM binary is larger than 1 MB, due to overlap of the initial loaded binary and the actual program segments. Fix this by using the address 0x89000000, which matches the current "addr_mcur5f0_0load" env variable used by R5 SPL before the DM firmware inclusion into the tispl.bin. Fixes: df5363a67f35 ("tools: k3_fit_atf: add DM binary to the FIT image") Signed-off-by: Suman Anna <s-anna@ti.com>
2021-09-01tools: kwbimage: Remove comment about unimplemented register headers in v1 ↵Pali Rohár1-2/+0
images Support for register headers in v1 images was implemented in commit 02ba70ad6822 ("tools: kwbimage: Add support for DATA command also for v1 images"). So remove old comment. Signed-off-by: Pali Rohár <pali@kernel.org> Fixes: 02ba70ad6822 ("tools: kwbimage: Add support for DATA command also for v1 images") Reviewed-by: Stefan Roese <sr@denx.de>
2021-09-01kwbimage: check return value of image_get_csk_indexHeinrich Schuchardt1-1/+1
image_get_csk_index() may return -1 in case of an error. Don't use this value as index. This resolves Coverity CID 338488 Memory - illegal accesses (NEGATIVE_RETURNS) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Pali Rohár <pali@kernel.org>
2021-09-01kwbimage: check fopen() return valueHeinrich Schuchardt1-0/+11
Always check the return value of fopen(). This resolves Coverity CID 338491: Null pointer dereferences (NULL_RETURNS) Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Pali Rohár <pali@kernel.org>
2021-09-01tools: kwbimage: Use IBR_HDR_* constants instead of raw numbersPali Rohár1-11/+11
There are already IBR_HDR_* constants for these numbers, so use them. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-09-01tools: kwbimage: Verify size of image dataPali Rohár1-1/+1
Part of image data is 4 byte checksum, so every image must contain at least 4 bytes. Verify it to prevent memory corruptions. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-09-01tools: kwbimage: Verify size of v0 image headerPali Rohár1-0/+3
Check that extended image header size is not larger than file size. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-09-01tools: kwbimage: Verify supported image versionPali Rohár1-3/+3
Only image versions 0 and 1 are supported. Verify it in kwbimage_verify_header() function. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2021-08-08dtoc: Correct the intarray-widening test caseSimon Glass1-1/+1
This case was intended to check that widening an int array with an int does nothing. Fix it. Reported-by: Walter Lozano <walter.lozano@collabora.com> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
2021-08-08patman: Avoid blank lines between tagsSimon Glass2-2/+28
In some cases 'patman status' leaves a blank line between the sign-off and the tags it collects from patchwork. Fix this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-08-04CI: Update to LLVM-12Tom Rini1-3/+3
The current stable release of LLVM is 12, update to that. While at it, fix that we had not correctly upgraded to LLVM 11 previously. Signed-off-by: Tom Rini <trini@konsulko.com>
2021-08-01dtoc: Support widening a bool valueSimon Glass4-2/+33
At present if we see 'ranges' property (with no value) we assume it is a boolean, as per the devicetree spec. But another node may define 'ranges' with a value, forcing us to widen it to an int array. At present this is not supported and causes an error. Fix this and add some test cases. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Rini <trini@konsulko.com>
2021-08-01dtoc: Fix widening an int array to an intSimon Glass3-11/+21
An int array can hold a single int so we should not need to do anything in the widening operation. However due to a quirk in the code, an int[3] widened with an int produced an int[4]. Fix this and add a test. Fix a comment typo while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Rini <trini@konsulko.com>
2021-08-01dtoc: Rename is_wider_than() to reduce confusionSimon Glass1-6/+9
The current name is confusing because the logic is actually backwards from what you might expect. Rename it to needs_widening() and update the comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-08-01moveconfig: Update to newer kconfiglibSimon Glass1-12/+12
Some of the more advanced features of this tool don't work anymore since kconfiglib was update. Update the code accordingly. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-08-01doc: Add docs for the moveconfig toolSimon Glass1-290/+1
Move these docs into htmldocs so they can be read there. Signed-off-by: Simon Glass <sjg@chromium.org>
2021-08-01patman: add warning for invalid tagPatrick Delaunay2-0/+20
Add a error in patman tool when the commit message contents an invalid tag "Serie-.*" instead of "Series-.*". Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2021-07-31kwbimage: Update help message about how to extract from an existing imagePali Rohár1-1/+1
Extracting is now supported by dumpimage, so mention it in help instead of `kwbimage -x`. 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-31kwbimage: Add support for extracting images via dumpimage toolPali Rohár1-8/+64
The kwbimage library does not support extracting subimages. Implement it. 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-31tools: kwbimage: Remove v1 kwbimage SPL padding to CONFIG_SYS_U_BOOT_OFFS bytesPali Rohár2-17/+0
This padding depends on board config file and therefore it makes the mkimage binary tool board specific, which is not correct. One cannot use mkimage tool built as a result for board A to generate images for board B, even if both A and B are on the same platform. This CONFIG_SYS_U_BOOT_OFFS padding was needed when kwbimage v1 contained SPL code which loaded U-Boot proper based on CONFIG_SYS_U_BOOT_OFFS, instead of reading correct offset from kwbimage header. Now that SPL code parses kwbimage header and deterinate correct offset, there is no need for this CONFIG_SYS_U_BOOT_OFFS padding anymore. By removing it we also reduce the size of SPL code and therefore also decrease the final size of v1 kwbimage. This means there is more space for U-Boot proper binary. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2021-07-31tools: kwboot: Fix checking image header versionPali Rohár1-1/+1
Function image_version() returns unsigned value, so it can never be negative. Explicitly check for two supported image versions: v0 and v1. 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-31tools: kwboot: Check for v1 header sizePali Rohár1-0/+5
Too small invalid headers may cause kwboot to crash. Check for header size of v1 images. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwboot: Cosmetic fix - add missing curly bracketsPali Rohár1-1/+2
Add missing curly brackets for this else statement. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwboot: Print trailing newline after terminal is terminatedPali Rohár1-0/+1
Print trailing newline as the last printed byte can be something different. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwboot: Fix restoring terminalPali Rohár1-1/+2
Call tcsetattr() only if the file descriptor is valid. It may be invalidated by previous lines (if it is not a tty descriptor). 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwboot: Fix wrong parameter passed to read()Pali Rohár1-1/+1
The 'buf' variable is a pointer and '_buf' is the array itself. Therefore we should pass sizeof(_buf) instead of sizeof(buf) to read(). 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: dumpimage: Show error message when trying to extract data from kwbimagePali Rohár1-0/+5
There is no code for extracting data from kwbimage, so show an error message when user tries this via e.g. dumpimage call: ./tools/dumpimage -T kwbimage -o /tmp/out u-boot-spl.kwb 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-31tools: dumpimage: Fix crashing when trying to extract data from kwbimagePali Rohár1-1/+1
Trying to call the following command causes NULL pointer dereference in strlen(): ./tools/dumpimage -T kwbimage -o /tmp/out u-boot-spl.kwb Fix it by checking whether params->imagename is non-NULL before calling strlen(). 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-31tools: kwbimage: Mark all BootROM structures __packedPali Rohár2-19/+19
These structures must have specific size without padding, so mark them as packed via the de-facto standard macro __packed. Also replace PACKED macro. 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-31tools: kwbimage: Do not hide usage of secure header under CONFIG_ARMADA_38XPali Rohár2-26/+0
The mkimage host tool can be used to generate kwbimage v1 image with secure header on host system for A38x plaform also when U-Boot is being compiled for different platform. So there is no reason to not allow compiling of mkimage/kwbimage with secure header support for e.g. x86-64 host. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Add support for a new DATA_DELAY commandPali Rohár1-1/+23
This command is supported only by v1 images and specifies a milliseconds delay after executing some set of DATA commands. The special string value SDRAM_SETUP instructs BootROM to setup SDRAM controller instead of executing delay. SDRAM_SETUP may be specified only once and after the last DATA command. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Add support for DATA command also for v1 imagesPali Rohár2-1/+58
The DATA command is already supported by mkimage for v0 images, but not for v1 images. BootROM code which executes v1 images also supports DATA command via an optional extended v1 header OPT_HDR_V1_REGISTER_TYPE. Implement support for DATA command for v1 images. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Don't parse PAYLOAD keywordPali Rohár1-13/+0
The PAYLOAD keyword does nothing. No code is using it and both mkimage and kwbimage completely ignore it. It looks like a relict from the past. The payload image itself can be specified only via -d parameter to mkimage. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Add support for more BINARY headersPali Rohár1-31/+28
The kwbimage v1 format supports multiple BINARY executable headers. Add support for it into mkimage/kwbimage tool. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Fix calculating size of binary headerPali Rohár1-9/+2
Binary header consist of: * 1 byte for header type * 3 bytes for header size * 1 byte for number of arguments * 3 reserved bytes * N*4 bytes for arguments * M bytes (aligned to 4 bytes) for executable data * 1 byte for information about next header * 3 reserved bytes The first four bytes are specified as sizeof(struct opt_hdr_v1) and the remaining bytes as ALIGN(s.st_size, 4) + (binarye->binary.nargs + 2) * sizeof(uint32_t) 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-31tools: kwbimage: Change maximum number of arguments in binary header to 256Pali Rohár1-1/+1
The number is stored in one byte, so the maximum should be 255. 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-31tools: kwbimage: Use -a parameter (load address) for v1 imagesPali Rohár1-9/+1
The data part of v1 kwbimage currently contains U-Boot binary prepended by 64 bytes long Legacy U-Boot image header. This means that the load address is currently substracted by 64 bytes to ensure that U-Boot's entry point is at specified execution address. As mkimage has already separate arguments for load (-a) and execution (-e) address, there is no need to derive fixed load address from execution address. Therefore remove this load address hack from the kwbimage tool and support generating v1 kwbimage with arbitrary addresses for load and execution. Finally, calculate correct load address by caller for mkimage tool in Makefile. File u-boot-spl.kwb is always a v1 kwbimage and it is the only v1 kwbimage which U-Boot's build system generates. Remove also useless overwriting of destaddr for /binary.0 to the value which is already set on previous lines. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Cosmetic fix - remove redundant space characterMarek Behún1-1/+1
Remove this space, since the constants are indented by tabs. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Print size of binary header in kwbimage_print_header()Pali Rohár1-0/+24
The binary header in kwbimage contains executable SPL code. Print information about this binary header and not only information about it's data part. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Validate data checksum of v1 imagesPali Rohár1-0/+43
The data part of v1 images contains 32-bit checksum after the data. Validate whether this checksum is correct. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Validate extended headers of v1 imagesPali Rohár1-0/+29
Add basic checks for extended headers of v1 images. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Fix check for v0 extended header checksumPali Rohár1-7/+11
Extended header checksum for v0 image is present only in the case when extended header is present. Skip checksum validation if extended header is not present. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Don't crash when binary file name does not contain '/'Pali Rohár1-1/+1
In the case when the file name is specified relative to the current working directory, it does not contain '/' character and strrchr() returns NULL. The following strcmp() function then crashes on NULL pointer dereference. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Fix generation of SATA, SDIO and PCIe imagesPali Rohár1-0/+25
SATA and SDIO images must be aligned to sector size (which in most cases is 512 bytes) and Source Address in main header is stored in number of sectors from the beginning of the drive. SATA image must be stored at sector 1 and SDIO image at sector 0. Source Address for PCIe image is not used and must be set to 0xFFFFFFFF. 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> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2021-07-31tools: kwbimage: Add constant for SDIO bootfromMarek Behún1-0/+1
Add constant for SDIO value of the bootfrom header field. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Chris Packham <judge.packham@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>