aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2022-08-05buildman: Drop a TODO that is doneSimon Glass
Buildman now uses worktrees when available, instead of doing a full clone. This was done in this commit: 76de29fc4f buildman: Use git worktrees instead of git clones when possible Drop the TODO. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Drop a Python 2.7 commentSimon Glass
This is well out of date, but it is still reasonable to use a list. Drop the comment. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Allow lines without a symbolSimon Glass
The 'nm' tool can produce lines without a symbol, for example: 00000004 t Silently skip these and anything else without three fields. Drop the warning since there is nothing the user can do about it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Rini <trini@konsulko.com>
2022-08-05Drop genboardscfg.pySimon Glass
Now that buildman can generate this with the -R option, drop the script. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com>
2022-08-05buildman: Return an error if there are maintainer warningsSimon Glass
Detect warnings about missing maintain info and return result code 2 in that case. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05Revert "Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support""Simon Glass
This is not needed now that CONFIG_SYS_TARGET_NAME is correctly determined when scanning Kconfig. This reverts commit 25b8acee2ea11a9edc100c42a61f5d6187eb6167. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2022-08-05buildman: Replace the Options column with config nameSimon Glass
This appears in boards.cfg but we want to remove it. Drop support for generating it and reading it. Detect an old boards.cfg file that has this field and regenerate it, to avoid problems. Instead, add the config name in that place. This fixes a subtle bug in the generation code, since it uses 'target' for the config name and then overwrites the value in scan() by setting params['target'] to the name of the defconfig. The defconfig name is not the same as the SYS_CONFIG_NAME variable. With this change, we still have the config name and it can be searched by buildman, e.g. with: buildman -nv sun5i Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Rini <trini@konsulko.com>
2022-08-05buildman: Tidy up pylint problems in boards moduleSimon Glass
Fix all the pylint warnings. Also tidy up the comments so that they show type information, as required. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Incorporate the genboardscfg.py toolSimon Glass
Bring this tool into buildman, so we don't have to run it separately. The board.cfg file is still produced as part of the build, to save time when doing another build in the same working directory. If it is out of date with respect to the Kconfig, it is updated. Time to regenerate on a recent single-thread machine is 4.6s (1.3s on a 32-thread machine), so we do need some sort of cache if we want buildman to be useful on incremental builds. We could use Python's pickle format but: - it seems useful to allow boards.cfg to be regenerated, at least for a while, in case other tools use it - it is possible to grep the file easily, e.g. to find boards which use a particular SoC (similar to 'buildman -nv <soc>' Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Tom Rini <trini@konsulko.com>
2022-08-05buildman: Split out Boards into its own fileSimon Glass
Use a separate file for the Boards class so that its name matches the module name. Fix up the function names to match the pylint style and fix some other warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Convert camel case in board.pySimon Glass
Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Drop use of 'board' in board moduleSimon Glass
Use brds instead so that we can reserve 'boards' and 'board' as module names. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Drop use of 'boards' in controlSimon Glass
Use brds instead so that we can reserve 'boards' for a module name. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Fix use of 'boards' in testSimon Glass
We want to create a module called 'boards' so avoid use of this variable name in this module. Change the global to be capitalised, as required by Python style. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Fix use of 'boards' in func_testSimon Glass
We want to create a module called 'boards' so avoid use of this variable name in this module. Change the global to be capitalised, as required by Python style. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Avoid using board as a variableSimon Glass
We have a module called 'board'. Sometimes buildman uses 'brd' as an instance variable but sometimes it uses 'board', which is confusing and can mess with the module handling. Update the code to use 'brd' consistently, making it easier for tools to determine when the module is being referenced. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Support running from an IDESimon Glass
Add a flag to allow buildman to behave properly for use from an IDE. This shows error/warning output on stderr and drops all summary and progress information. This should normally only be used when building a single board. Fix up a confusing comment for GetResultSummary() while we are here, since we want to use the Outcome object to access the unprocessed error lines from the build. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-05buildman: Drop -I optionSimon Glass
This has been deprecated with a notice that it will be removed after April 2021. Drop it now. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-08-04tools: mkimage: fix build with LibreSSLMichal Vasilek
RSA_get0_* functions are not available in LibreSSL Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-08-04tools: kwboot: use pkg-config to get -ltinfoHeiko Thiery
Instead of hardcoding -ltinfo as the flags needed to build kwboot, use pkg-config when available. We gracefully fallback on the previous behavior of hardcoding -ltinfo if pkg-config is not available or fails with an error. Reviewed-by: Pali Rohár <pali@kernel.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2022-08-04tools: mkeficapsule: use pkg-config to get -luuid and -lgnutlsHeiko Thiery
Instead of hardcoding -luuid -lgnutls as the flags needed to build mkeficapsule, use pkg-config when available. We gracefully fallback on the previous behavior of hardcoding -luuid -lgnutls if pkg-config is not available or fails with an error. Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
2022-07-27Merge tag 'dm-pull-26jul22' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git minor dm- and fdt-related fixes start of test for fdt command
2022-07-26Merge tag 'u-boot-imx-20220726' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx u-boot-imx-20220726 ------------------- i.MX for 2022.10 - Added i.MX93 architecture CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/12891
2022-07-26tools: image: support i.MX93Peng Fan
Support build i.MX93 container image with mkimage Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-07-26patman: By default don't pass "--no-tree" to checkpatch for linuxDouglas Anderson
When you pass "--no-tree" to checkpatch it disables some extra checks that are important for Linux. Specifically I want checks like: warning: DT compatible string "boogie,woogie" appears un-documented check ./Documentation/devicetree/bindings/ Let's make the default for Linux to _not_ pass --no-tree. We'll have a config option and command line flag to override. Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-07-26binman: Increase default fitImage data section resize step from 1k to 64kMarek Vasut
Currently the fitImage data area is resized in 1 kiB steps. This works when bundling smaller images below some 1 MiB, but when bundling large images into the fitImage, this make binman spend extreme amount of time and CPU just spinning in pylibfdt FdtSw.check_space() until the size grows enough for the large image to fit into the data area. Increase the default step to 64 kiB, which is a reasonable compromise -- the U-Boot blobs are somewhere in the 64kiB...1MiB range, DT blob are just short of 64 kiB, and so are the other blobs. This reduces binman runtime with 32 MiB blob from 2.3 minutes to 5 seconds. The following can be used to trigger the problem if rand.bin is some 32 MiB. " / { itb { fit { images { test { compression = "none"; description = "none"; type = "flat_dt"; blob { filename = "rand.bin"; type = "blob-ext"; }; }; }; }; }; configurations { binman_configuration: config { loadables = "test"; }; }; }; " Signed-off-by: Marek Vasut <marex@denx.de> Cc: Alper Nebi Yasak <alpernebiyasak@gmail.com> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-07-26tools: relocate-rela: Define all macros for e_machine and reloc typesMichal Simek
With some old toolchain not all values should be available that's why better to define all of them to avoid compilation issues. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/e2a66854c5506100eb82b5b33cec7f0b5fca1008.1657260903.git.michal.simek@amd.com
2022-07-26tools: relocate-rela: Remove guard around R_AARCH64_RELATIVEMichal Simek
In code you can find out this fragment: 19 #ifndef R_AARCH64_RELATIVE 20 #define R_AARCH64_RELATIVE 1027 21 #endif which means that R_AARCH64_RELATIVE is defined all the time that's why ifdef is not needed. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/0d40a09ab6edcd88ba3059f7a0b63a819b71256a.1657260903.git.michal.simek@amd.com
2022-07-26tools: relocate-rela: Fix ELF decoding on big-endian hostsSamuel Holland
The new ELF decoding logic assumed that the target binary has the same endianness as the host, which broke building ARM64 firmware binaries on big-endian machines. This commit fixes the ELF64 decoding to be host-endianness-neutral, and applies the same changes to the ELF32 decoding. It does not fix the microblaze-specific dynamic symbol decoding. It also corrects the functions used for byte swapping in rela_elf64() and rela_elf32(). The result is the same, but semantically the code is converting bytes read from a foreign-endianness file to host byte order. Fixes: 4c9e2d643460 ("tools: relocate-rela: Read rela start/end directly from ELF") Fixes: a1405d9cfedb ("tools: relocate-rela: Check that relocation works only for EM_AARCH64") Signed-off-by: Samuel Holland <samuel@sholland.org> Link: https://lore.kernel.org/r/20220715064026.54551-1-samuel@sholland.org Signed-off-by: Michal Simek <michal.simek@amd.com>
2022-07-25k3_gen_x509_cert: Make SWRV configurable for anti-rollback protectionYogesh Siraswar
The x509 certificate SWRV is currently hard-coded to 0. This need to be updated to 1 for j721e 1.1, j7200 and am64x. It is don't care for other k3 devices. Added new config K3_X509_SWRV to k3. Default is set to 1. Signed-off-by: Yogesh Siraswar <yogeshs@ti.com> Reviewed-by: Dave Gerlach <d-gerlach@ti.com>
2022-07-25tools: mkimage: Add support to generate FlexSPI Header for i.MX8mMamta Shukla
Add struct with Flex SPI Configuration Block and enable generating fspi header using mkimage. Refer i.MX 8M Mini Application Processor Reference Manual for detailed information about parameters for FlexSPI Configuration block. Signed-off-by: Mamta Shukla <mamta.shukla@leica-geosystems.com> Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com> Tested-by: Adam Ford <aford173@gmail.com> Reviewed-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
2022-07-25tools: imx8mimage: Keep IVT reserved1 field zero alwaysMarek Vasut
Since fe8acf556c3 ("imx: HAB: Validate IVT before authenticating image") the U-Boot HAB implementation is checking whether reserved1 field in IVT is zero or not. In case the field is not zero, IVT validation fails. Stop setting IVT reserved1 field to non-zero in mkimage imx8m plugin, otherwise the validation cannot ever work. Note that this only affects legacy boards which do not use binman. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
2022-07-21treewide: Fix Marek's name and change my e-mail addressMarek Behún
Fix diacritics in some instances of my name and change my e-mail address to kabel@kernel.org. Add corresponding .mailmap entries. Signed-off-by: Marek Behún <kabel@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
2022-07-14Merge tag 'mips-pull-2022-07-13' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-mips - MIPS: add drivers and board support for Mediatek MT7621 SoC
2022-07-13tools: mtk_image: add support for MT7621 NAND imagesWeijie Gao
The BootROM of MT7621 requires a image header for SPL to record its size and load address when booting from NAND. To create such an image, one can use the following command line: mkimage -T mtk_image -a 0x80200000 -e 0x80200000 -n "mt7621=1" -d u-boot-spl-ddr.bin u-boot-spl-ddr.img Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2022-07-13mkimage: Add long optionsSean Anderson
The mkimage command has had many options added over the years. Unfortunately, we are starting to run out of short options. Recent options don't have any obvious relation to their meaning (e.g. -o/-g). Fortunately, long options exist. Add long options for each current short option. For the curious, the remaining short options are HIkLmMPQSuUwWXyYzZ. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-07-11Merge branch 'next'Tom Rini
2022-07-08Merge tag 'dm-pull-28jun22' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dm into next nman external-symbol improvements Driver model memory-usage reporting patman test-reporting improvements Add bloblist design goals
2022-07-08fw_env: add fallback to Linux's NVMEM based accessRafał Miłecki
A new DT binding for describing environment data block has been added in Linux's commit 5db1c2dbc04c ("dt-bindings: nvmem: add U-Boot environment variables binding"). Once we get a proper Linux NVMEM driver it'll be possible to use Linux's binary interface for user-space as documented in the: https://www.kernel.org/doc/html/latest/driver-api/nvmem.html This commits makes fw_env fallback to looking for a compatible NVMEM device in case config file isn't present. In a long term this may make config files redundant and avoid code (info) duplication. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-01image: fit: Use stack allocation macroJoel Stanley
The documentation above the DEFINE_ALIGN_BUFFER says it's for use outside functions, but we're inside one. Instead use ALLOC_CACHE_ALIGN_BUFFER, the stack based macro, which also includes the cache alignment. Fixes: b583348ca8c8 ("image: fit: Align hash output buffers") Signed-off-by: Joel Stanley <joel@jms.id.au> Tested-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
2022-06-28spl: binman: Check at runtime if binman symbols were filled inAlper Nebi Yasak
Binman lets us declare symbols in SPL/TPL that refer to other entries in the same binman image as them. These symbols are filled in with the correct values while binman assembles the images, but this is done in-memory only. Symbols marked as optional can be filled with BINMAN_SYM_MISSING as an error value if their referred entry is missing. However, the unmodified SPL/TPL binaries are still available on disk, and can be used by people. For these files, nothing ensures that the symbols are set to this error value, and they will be considered valid when they are not. Empirically, all symbols show up as zero in a sandbox_vpl build when we run e.g. tpl/u-boot-tpl directly. On the other hand, zero is a perfectly fine value for a binman-written symbol, so we cannot say the symbols have wrong values based on that. Declare a magic symbol that binman always fills in with a fixed value. Check this value as an indicator that symbols were filled in correctly. Return the error value for all symbols when this magic symbol has the wrong value. For binman tests, we need to make room for the new symbol in the mocked SPL/TPL data by extending them by four bytes. This messes up some test image layouts. Fix the affected values, and check the magic symbol wherever it makes sense. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-06-28spl: binman: Split binman symbols support from enabling binmanAlper Nebi Yasak
Enabling CONFIG_BINMAN makes binman run after a build to package any images specified in the device-tree. It also enables a mechanism for SPL/TPL to declare and use special linker symbols that refer to other entries in the same binman image. A similar feature that gets this info from the device-tree exists for U-Boot proper, but it is gated behind a CONFIG_BINMAN_FDT unlike the symbols. Confusingly, CONFIG_SPL/TPL_BINMAN_SYMBOLS also exist. These configs don't actually enable/disable the symbols mechanism as one would expect, but declare some symbols for U-Boot using this mechanism. Reuse the BINMAN_SYMBOLS configs to make them toggle the symbols mechanism, and declare symbols for the U-Boot phases in a dependent BINMAN_UBOOT_SYMBOLS config. Extend it to cover symbols of all phases. Update the config prompt and help message to make it clearer about this. Fix binman test binaries to work with CONFIG_IS_ENABLED(BINMAN_SYMBOLS). Co-developed-by: Peng Fan <peng.fan@nxp.com> [Alper: New config for phase symbols, update Kconfigs, commit message] Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-06-28dm: core: Support accessing core tagsSimon Glass
At present tag numbers are only allocated for non-core data, meaning that the 'core' data, like priv and plat, are accessed through dedicated functions. For debugging and consistency it is convenient to use tags for this 'core' data too. Add support for this, with new tag numbers and functions to access the pointer and size for each. Update one of the test drivers so that the uclass-private data can be tested here. There is some code duplication with functions like device_alloc_priv() but this is not addressed for now. At some point, some rationalisation may help to reduce code size, but more thought it needed on that. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28dm: core: Switch the testbus driver to use a new structSimon Glass
At present this driver uses 'priv' struct to hold 'plat' data, which is confusing. The contents of the strct don't matter, since only dtoc is using it. Create a new struct with the correct name. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-06-28patman: Fix defaults not propagating to subparsersSean Anderson
On python 3.8.10 (and 3.10), subparsers are not updated with defaults. I suspect this is related to [1]. Fix this by explicitly updating subparsers with settings. [1] https://github.com/python/cpython/issues/89398 Fixes: 3145b63513 ("patman: Update defaults in subparsers") Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Tested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-06-28patman: test_util: Print test stdout/stderr within test summariesAlper Nebi Yasak
While running tests for a python tool, the tests' outputs get printed in whatever order they happen to run, without any indication as to which output belongs to which test. Unittest supports capturing these outputs and printing them as part of the test summaries, but when a failure or error occurs it switches back to printing as the tests run. Testtools and subunit tests can do the same as their parts inherit from unittest, but they don't outright expose this functionality. On the unittest side, enable output buffering for the custom test result class. Try to avoid ugly outputs by not printing stdout/stderr before the test summary for low verbosity levels and for successful tests. On the subunit side, implement a custom TestProtocolClient that enables the same underlying functionality and injects the captured streams as additional test details. This causes them to be merged into their test's error traceback message, which is later rebuilt into an exception and passed to our unittest report class. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-28patman: test_util: Customize unittest test results for more infoAlper Nebi Yasak
By default, unittest test summaries only print extended info about tests that failed or couldn't run due to an error. Use a custom text result class to print info about more cases: skipped tests, expected failures and unexpected successes. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2022-06-28patman: test_util: Use unittest text runner to print test resultsAlper Nebi Yasak
The python tools' test utilities handle printing test results, but the output is quite bare compared to an ordinary unittest run. Delegate printing the results to a unittest text runner, which gives us niceties like clear separation between each test's result and how long it took to run the test suite. Unfortunately it does not print info for skipped tests by default, but this can be handled later by a custom test result subclass. It also does not print the tool name; manually print a heading that includes the toolname so that the outputs of each tool's tests are distinguishable in the CI output. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-28patman: test_util: Handle nonexistent tests while loading testsAlper Nebi Yasak
It's possible to request a specific test to run when trying to run a python tool's tests. If we request a nonexistent test, the unittest loaders generate a fake test that reports this as an error. However, we get these fake tests even when the test exists, because test_util can load tests from multiple places one by one and the test we want only exists in one. The test_util helpers currently remove these fake tests when printing test results, but that's more of a workaround than a proper solution. Instead, don't even try to load the missing tests. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-06-28patman: test_util: Fix printing results for failed testsAlper Nebi Yasak
When printing a python tool's test results, the entire list of failed tests and their tracebacks are reprinted for every failed test. This makes the test output quite unreadable. Fix the loop to print failures and tracebacks one at a time. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>