aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2019-11-04binman: Move to use Python 3Simon Glass1-1/+1
Update this tool to use Python 3 to meet the 2020 deadline. Unfortunately this introduces a test failure due to a problem in pylibfdt on Python 3. I will investigate. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04dtoc: Convert fdt.py to Python 3Simon Glass1-13/+4
Drop the now-unused Python 2 code to keep code coverage at 100%. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04binman: Convert a few tests to Python 3Simon Glass1-7/+7
Some tests have crept in with Python 2 strings and constructs. Convert then. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04binman: Remember the pre-reset entry sizeSimon Glass1-1/+8
When preparing to possible expand or contract an entry we reset the size to the original value from the binman device-tree definition, which is often None. This causes binman to forget the original size of the entry. Remember this so that it can be used when needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04pylibfdt: Convert to Python 3Simon Glass3-30/+3
Build this swig module with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04rkmux: Convert to Python 3Simon Glass1-8/+8
Convert this tool to Python 3 and make it use that, to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04move_config: Convert to Python 3Simon Glass1-41/+41
Convert this tool to Python 3 and make it use that, to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04microcode_tool: Convert to Python 3Simon Glass1-14/+14
Convert this tool to Python 3 and make it use that, to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04test_dtoc: Move to use Python 3Simon Glass2-1/+2
Update this test to use Python 3 to meet the 2020 deadline. Also make it executable while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04test_fdt: Move to use Python 3Simon Glass1-1/+1
Update this test to use Python 3 to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04buildman: Convert to Python 3Simon Glass9-145/+146
Convert buildman to Python 3 and make it use that, to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04patman: Move to use Python 3Simon Glass1-1/+1
Update this tool to use Python 3 to meet the 2020 deadline. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04patman: Use unicode for file I/OSimon Glass5-11/+11
At present patman test fail in some environments which don't use utf-8 as the default file encoding. Add this explicitly. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04patman: Adjust 'command' to return strings instead of bytesSimon Glass4-18/+46
At present all the 'command' methods return bytes. Most of the time we actually want strings, so change this. We still need to keep the internal representation as bytes since otherwise unicode strings might break over a read() boundary (e.g. 4KB), causing errors. But we can convert the end result to strings. Add a 'binary' parameter to cover the few cases where bytes are needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-04fdt: Sync up to the latest libfdtSimon Glass1-1/+2
Bring over the fdt from this commit: 430419c (origin/master) tests: fix some python warnings adding in the 'assumptions' series designed to reduce code size. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-02binman: Fix up comment in intel-fsp-mSimon Glass1-1/+1
This comment references the wrong FSP component. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-11-02binman: Add support for Intel FSP-TSimon Glass4-0/+63
This entry is used to hold an Intel FSP-T (Firmware Support Package Temp-RAM init) binary. Add support for this in binman. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-11-02binman: Add support for Intel FSP-SSimon Glass4-0/+64
This entry is used to hold an Intel FSP-S (Firmware Support Package Silicon init) binary. Add support for this in binman. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-11-02binman: Correct symbol calculation with non-zero image baseSimon Glass2-4/+2
At present binman adds the image base address to the symbol value before it writes it to the binary. This is not correct since the symbol value itself (e.g. image position) has no relationship to the image base. Fix this and update the tests to cover this case. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-11-01Merge tag 'dm-pull-29oct19' of git://git.denx.de/u-boot-dmTom Rini3-5/+5
- Fix for patman with email addresses containing commas - Bootstage improvements for TPL, SPL - Various sandbox and dm improvements and fixes
2019-10-31mkimage: Set correct FDT type and ramdisk architecture in FIT auto modeMichal Sojka1-0/+3
When running the following command mkimage -f auto -A arm -O linux -T kernel -C none -a 0x8000 -e 0x8000 \ -d zImage -b zynq-microzed.dtb -i initramfs.cpio image.ub the type of fdt subimage is the same as of the main kernel image and the architecture of the initramfs image is not set. Such an image is refused by U-Boot when booting. This commits sets the mentioned attributes, allowing to use the "-f auto" mode in this case instead of writing full .its file. Following is the diff of mkimage output without and with this commit: FIT description: Kernel Image image with one or more FDT blobs Created: Thu Sep 12 23:23:16 2019 Image 0 (kernel-1) Description: Created: Thu Sep 12 23:23:16 2019 Type: Kernel Image Compression: uncompressed Data Size: 4192744 Bytes = 4094.48 KiB = 4.00 MiB Architecture: ARM OS: Linux Load Address: 0x00008000 Entry Point: 0x00008000 Image 1 (fdt-1) Description: zynq-microzed Created: Thu Sep 12 23:23:16 2019 - Type: Kernel Image + Type: Flat Device Tree Compression: uncompressed Data Size: 9398 Bytes = 9.18 KiB = 0.01 MiB Architecture: ARM - OS: Unknown OS - Load Address: unavailable - Entry Point: unavailable Image 2 (ramdisk-1) Description: unavailable Created: Thu Sep 12 23:23:16 2019 Type: RAMDisk Image Compression: Unknown Compression Data Size: 760672 Bytes = 742.84 KiB = 0.73 MiB - Architecture: Unknown Architecture + Architecture: ARM OS: Linux Load Address: unavailable Entry Point: unavailable Default Configuration: 'conf-1' Configuration 0 (conf-1) Description: zynq-microzed Kernel: kernel-1 Init Ramdisk: ramdisk-1 FDT: fdt-1 Loadables: kernel-1 Signed-off-by: Michal Sojka <michal.sojka@cvut.cz>
2019-10-29tools: buildman: Remove useless mkdir() in Make() in test.pyBin Meng1-8/+0
In the 'Make' function, the codes tries to create a directory if current stage is 'build'. But the directory isn't used at all anywhere. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-10-29tools: buildman: Honor output directory when generating boards.cfgBin Meng1-5/+5
buildman always generates boards.cfg in the U-Boot source tree. When '-o' is given, we should generate boards.cfg to the given output directory. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-10-28tools: Avoid creating symbolic links for tools/version.hBin Meng2-1/+1
When building U-Boot host tools for Windows from Microsoft Azure Pipelines, the following errors were seen: HOSTCC tools/mkenvimage.o In file included from tools/mkenvimage.c:25: ./tools/version.h:1:1: error: expected identifier or ‘(’ before ‘.’ token 1 | ../include/version.h | ^ tools/mkenvimage.c: In function ‘main’: tools/mkenvimage.c:117:4: warning: implicit declaration of function ‘usage’ [-Wimplicit-function-declaration] 117 | usage(prg); | ^~~~~ tools/mkenvimage.c:120:35: error: ‘PLAIN_VERSION’ undeclared (first use in this function) 120 | printf("%s version %s\n", prg, PLAIN_VERSION); | ^~~~~~~~~~~~~ tools/mkenvimage.c:120:35: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [scripts/Makefile.host:114: tools/mkenvimage.o] Error 1 It turns out tools/version.h is a symbolic link and with Windows default settings it is unsupported hence the actual content of tools/version.h is not what file include/version.h has, but the the linked file path, which breaks the build. To fix this, remove the symbolic links for tools/version.h. Instead we perform a copy from include/version.h during the build. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-28tools: ifwitool: Define __packed when it is not definedBin Meng1-0/+2
Some compilers may provide __packed define for us. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-28tools: zynqmpbif: Use compiler builtin instead of linux-specific __swab32Bin Meng1-1/+1
__swab32() is a Linux specific macro defined in linux/swab.h. Let's use the compiler equivalent builtin function __builtin_bswap32() for better portability. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-28tools: mtk_image.h: Use portable uintXX_t instead of linux-specific __leXXBin Meng1-43/+43
__leXX has Linux kernel specific __attribute__((bitwise)) which is not portable. Use corresponding uintXX_t instead. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2019-10-27patman: separate emails in CC list with NULsDmitry Torokhov3-5/+5
There is a contributor in Linux kernel with a comma in their name, which confuses patman and results in invalid to- or cc- addresses on some patches. To avoid this, let's use \0 as a separator when generating cc file. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-10-24arm64: zynqmp: Do not remove dpll_prog from psu_initMichal Simek1-1/+0
dpll_prog is available in some psu_init files that's why this function should stay there. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2019-10-15patman: Use the Change-Id, version, and prefix in the Message-IdDouglas Anderson4-5/+85
As per the centithread on ksummit-discuss [1], there are folks who feel that if a Change-Id is present in a developer's local commit that said Change-Id could be interesting to include in upstream posts. Specifically if two commits are posted with the same Change-Id there's a reasonable chance that they are either the same commit or a newer version of the same commit. Specifically this is because that's how gerrit has trained people to work. There is much angst about Change-Id in upstream Linux, but one thing that seems safe and non-controversial is to include the Change-Id as part of the string of crud that makes up a Message-Id. Let's give that a try. In theory (if there is enough adoption) this could help a tool more reliably find various versions of a commit. This actually might work pretty well for U-Boot where (I believe) quite a number of developers use patman, so there could be critical mass (assuming that enough of these people also use a git hook that adds Change-Id to their commits). I was able to find this git hook by searching for "gerrit change id git hook" in my favorite search engine. In theory one could imagine something like this could be integrated into other tools, possibly even git-send-email. Getting it into patman seems like a sane first step, though. NOTE: this patch is being posted using a patman containing this patch, so you should be able to see the Message-Id of this patch and see that it contains my local Change-Id, which ends in 2b9 if you want to check. [1] https://lists.linuxfoundation.org/pipermail/ksummit-discuss/2019-August/006739.html Signed-off-by: Douglas Anderson <dianders@chromium.org>
2019-10-15binman: Drop comment-out code in testUpdateFdtOutput()Simon Glass1-2/+0
This code is not needed so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Add logging for the number of pack passesSimon Glass1-0/+1
Sometimes binman takes multiple passes to complete packing an image. Add logging to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Write symbol info before image inclusionSimon Glass1-1/+1
At present the symbol information is written to binaries just before binman exits. This is fine for entries within sections since the section contents is calculated when it is needed, so the updated symbol values are included in the image that is written. However some binaries are inside entries which have already generated their contents and do not notice that the entries have changed (e.g. Intel IFWI). Move the symbol writing earlier to cope with this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Support writing symbols into entries within an IFWISimon Glass1-0/+5
The Intel IFWI (Integrated Firmware Image) is effectively a section with other entries inside it. Support writing symbol information into entries within it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Update IFWI entry to support updatesSimon Glass1-18/+28
Add support for the ProcessContents() method in this entry so that it is possible to support entries which change after initial creation. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Update IFWI entry to read entries outside constructorSimon Glass1-0/+3
At present this class reads its entries in the constructor. This is not how things should be done now. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Fix entry comment for Intel descriptorSimon Glass1-1/+1
This comment references another entry type. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Add support for Intel FSP meminitSimon Glass4-0/+66
The Intel FSP supports initialising memory early during boot using a binary blob called 'fspm'. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Allow support for writing a size symbol to binariesSimon Glass4-9/+12
It is useful to be able to access the size of an image in SPL, with something like: binman_sym_declare(unsigned long, u_boot_any, size); ... ulong u_boot_size = binman_sym(ulong, u_boot_any, size); Add support for this and update the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Increase size of TPL and SPL test dataSimon Glass7-14/+14
At present these are large enough to hold 20 bytes of symbol data. Add four more bytes so we can add another test. Unfortunately at present this involves changing a few test files to make room. We could adjust the test files to not specify sizes for entries. Then we could make the tests check the actual sizes. But for now, leave it as it is, since the effort is minor. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Avoid needing the section size in advanceSimon Glass3-4/+49
Entries which include a section and need to obtain its contents call GetData(), as with any other entry. But the current implementation of this method in entry_Section requires the size of the section to be known. If it is unknown, an error is produced, since size is None: TypeError: can't multiply sequence by non-int of type 'NoneType' There is no need to know the size in advance since the code can be adjusted to build up the section piece by piece, instead of patching each entry into an existing bytearray. Update the code to handle this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Rename some two-digit test filesSimon Glass3-2/+2
Two of the test files somehow were not converted to three digits. Fix them, using the next available numbers. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Use underscore in test filenamesSimon Glass14-14/+14
At present a small number of test files use hyphens instead of underscores. Rename them for consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Allow symbols to be resolved inside sectionsSimon Glass4-10/+67
At present we only support symbols inside binaries which are at the top level of an image. This restrictions seems unreasonable since more complex images may want to group binaries within different sections. Relax the restriction, adding a new _SetupTplElf() helper function. Also fix a typo in the comment for testTpl(). Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Clean up unnecessary code related to ELF test filesSimon Glass3-12/+4
We use the Makefile for all ELF test files now, so drop all the code that checks whether to get the test file from the Makefile or from the git repo. Also add a comment to the Makefile indicating that it is run from binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Use the Makefile for u_boot_binman_syms_badSimon Glass3-3/+3
Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Use the Makefile for u_boot_binman_syms_sizeSimon Glass3-3/+4
Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Use the Makefile for u_boot_binman_symsSimon Glass5-9/+13
Remove this file from git and instead build it using the Makefile. With this change a few things need to be adjusted: 1. The 'notes' section no-longer appears at the start of the ELF file (before the code), so update testSymbols to adjust the offsets. 2. The dynamic linker is disabled to avoid errors like: "Not enough room for program headers, try linking with -N" 3. The interpreter note is moved to the end of the image, so that the binman symbols appear first. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Use the Makefile for u_boot_no_ucode_ptrSimon Glass3-6/+6
Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-10-15binman: Use the Makefile for u_boot_ucode_ptrSimon Glass6-14/+26
Remove this file from git and instead build it using the Makefile. Update tools.GetInputFilename() to support reading files from an absolute path, so that we can read the Elf test files easily. Also make sure that the temp directory is report in ELF tests as this was commented out. Signed-off-by: Simon Glass <sjg@chromium.org>