summaryrefslogtreecommitdiff
path: root/tools/binman
AgeCommit message (Collapse)AuthorFilesLines
2020-07-29Makefile: Rename ALL-y to INPUTS-ySimon Glass1-1/+1
When binman is in use, most of the targets built by the Makefile are inputs to binman. We then need a final rule to run binman to produce the final outputs. Rename the variable to indicate this, and add a new 'inputs' target. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-27binman: Don't change the descriptor in testsSimon Glass3-5/+47
At present testPackX86RomMeNoDesc removes the contents of the descriptor.bin file and testPackX86RomMeMissingDesc removes the file completely. If a test that relies on this file happens to run after it is removed, it will not work. Since we have no control over the selecting of tests that run in parallel and series, we must avoid changing the files. Update this tests to use separate files instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25binman: Add support for generating a FITSimon Glass5-0/+384
FIT (Flat Image Tree) is the main image format used by U-Boot. In some cases scripts are used to create FITs within the U-Boot build system. This is not ideal for various reasons: - Each architecture has its own slightly different script - There are no tests - Some are written in shell, some in Python To help address this, add support for FIT generation to binman. This works by putting the FIT source directly in the binman definition, with the ability to adjust parameters, etc. The contents of each FIT image come from sub-entries of the image, as is normal with binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25binman: Allow zero-length entries to overlapSimon Glass3-1/+23
Some binary blobs unfortunately obtain their position in the image from other binary blobs, such as Intel's 'descriptor'. In this case we cannot rely on packing to work. It is not possible to produce a valid image in any case, due to the missing blobs. Allow zero-length overlaps so that this does not cause any problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: Allow missing Intel blobsSimon Glass4-14/+55
Update the Intel blob entries to support missing binaries. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: Detect when valid images are not producedSimon Glass6-3/+75
When external blobs are missing, show a message indicating that the images are not functional. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25patman: Update errors and warnings to use stderrSimon Glass1-1/+1
When warnings and errors are produced by tools they should be written to stderr. Update the tout implementation to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: Allow external binaries to be missingSimon Glass7-6/+60
Sometimes it is useful to build an image even though external binaries are not present. This allows the build system to continue to function without these files, albeit not producing valid images. U-Boot does with with ATF (ARM Trusted Firmware) today. Add a new flag to binman to request this behaviour. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: Convert existing binary blobs to blob_extSimon Glass16-39/+29
Many of the existing blobs rely on external binaries which may not be available. Move them over to use blob_ext to indicate this. Unfortunately cros-ec-rw cannot use this class because it inherits another. So set the 'external' value for that class. While we are here, drop the import of Entry since it is not used (and pylint3 complains). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25binman: Add an etype for external binary blobsSimon Glass5-0/+83
It is useful to be able to distinguish between ordinary blobs such as u-boot.bin and external blobs that cannot be build by the U-Boot build system. If the external blobs are not available for some reason, then we know that a value image cannot be built. Introduce a new 'blob-ext' entry type for that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: Use super() instead of specifying parent typeSimon Glass57-87/+86
It is easier and less error-prone to use super() when the parent type is needed. Update binman to remove the type names. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: Fix a few typos in the entry docsSimon Glass2-2/+2
Some typos have been fixed in the generated entry docs but the code was not updated. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25binman: Add support for calling mkimageSimon Glass5-0/+120
As a first step to integrating mkimage into binman, add a new entry type that feeds data into mkimage for processing and incorporates that output into the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25binman: Set a default toolpathSimon Glass1-0/+5
When binman is run from 'make check' it is given a toolpath so that the latest tools (e.g. mkimage) are used. When run manually with no toolpath, it relies on the system mkimage. But this may be missing or old. Make some effort to find the built-from-soruce version by looking in the current directory and in the builds created by 'make check'. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25binman: Specify the toolpath when running test coverageSimon Glass1-3/+7
At present binman's test coverage runs without a toolpath set. This means that the system tools will be used. That may not be correct if they are out of date or missing and this can result in a reduction in test coverage below 100%. Provide the toolpath to binman in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-25binman: Correct the search patch for pylibfdtSimon Glass1-0/+1
Now that binman uses tools/ as its base directory for importing modules, the path to the pylibfdt build by U-Boot is incorrect. Fix it with a new path. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: cbfs: Fix IFWI typoSimon Glass1-1/+1
This comment references the wrong thing. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-25binman: Output errors to stderrSimon Glass1-1/+1
At present binman outputs errors to stdout which means that fails are effectively silent when printed by buildman, for example. Fix this by outputing errors to stderr. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-24Revert "Merge tag 'dm-pull-20jul20' of git://git.denx.de/u-boot-dm"Tom Rini72-926/+151
This reverts commit 5d3a21df6694ebd66d5c34c9d62a26edc7456fc7, reversing changes made to 56d37f1c564107e27d873181d838571b7d7860e7. Unfortunately this is causing CI failures: https://travis-ci.org/github/trini/u-boot/jobs/711313649 Signed-off-by: Tom Rini <trini@konsulko.com>
2020-07-20binman: Add support for generating a FITSimon Glass5-0/+384
FIT (Flat Image Tree) is the main image format used by U-Boot. In some cases scripts are used to create FITs within the U-Boot build system. This is not ideal for various reasons: - Each architecture has its own slightly different script - There are no tests - Some are written in shell, some in Python To help address this, add support for FIT generation to binman. This works by putting the FIT source directly in the binman definition, with the ability to adjust parameters, etc. The contents of each FIT image come from sub-entries of the image, as is normal with binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Allow zero-length entries to overlapSimon Glass3-1/+23
Some binary blobs unfortunately obtain their position in the image from other binary blobs, such as Intel's 'descriptor'. In this case we cannot rely on packing to work. It is not possible to produce a valid image in any case, due to the missing blobs. Allow zero-length overlaps so that this does not cause any problems. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Allow missing Intel blobsSimon Glass4-14/+55
Update the Intel blob entries to support missing binaries. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Detect when valid images are not producedSimon Glass6-3/+75
When external blobs are missing, show a message indicating that the images are not functional. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20patman: Update errors and warnings to use stderrSimon Glass1-1/+1
When warnings and errors are produced by tools they should be written to stderr. Update the tout implementation to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Allow external binaries to be missingSimon Glass7-6/+60
Sometimes it is useful to build an image even though external binaries are not present. This allows the build system to continue to function without these files, albeit not producing valid images. U-Boot does with with ATF (ARM Trusted Firmware) today. Add a new flag to binman to request this behaviour. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Convert existing binary blobs to blob_extSimon Glass16-39/+29
Many of the existing blobs rely on external binaries which may not be available. Move them over to use blob_ext to indicate this. Unfortunately cros-ec-rw cannot use this class because it inherits another. So set the 'external' value for that class. While we are here, drop the import of Entry since it is not used (and pylint3 complains). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Add an etype for external binary blobsSimon Glass5-0/+83
It is useful to be able to distinguish between ordinary blobs such as u-boot.bin and external blobs that cannot be build by the U-Boot build system. If the external blobs are not available for some reason, then we know that a value image cannot be built. Introduce a new 'blob-ext' entry type for that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Use super() instead of specifying parent typeSimon Glass57-87/+86
It is easier and less error-prone to use super() when the parent type is needed. Update binman to remove the type names. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Fix a few typos in the entry docsSimon Glass2-2/+2
Some typos have been fixed in the generated entry docs but the code was not updated. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Add support for calling mkimageSimon Glass5-0/+120
As a first step to integrating mkimage into binman, add a new entry type that feeds data into mkimage for processing and incorporates that output into the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Set a default toolpathSimon Glass1-0/+5
When binman is run from 'make check' it is given a toolpath so that the latest tools (e.g. mkimage) are used. When run manually with no toolpath, it relies on the system mkimage. But this may be missing or old. Make some effort to find the built-from-soruce version by looking in the current directory and in the builds created by 'make check'. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Specify the toolpath when running test coverageSimon Glass1-3/+7
At present binman's test coverage runs without a toolpath set. This means that the system tools will be used. That may not be correct if they are out of date or missing and this can result in a reduction in test coverage below 100%. Provide the toolpath to binman in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-20binman: Correct the search patch for pylibfdtSimon Glass1-0/+1
Now that binman uses tools/ as its base directory for importing modules, the path to the pylibfdt build by U-Boot is incorrect. Fix it with a new path. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: cbfs: Fix IFWI typoSimon Glass1-1/+1
This comment references the wrong thing. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-07-20binman: Output errors to stderrSimon Glass1-1/+1
At present binman outputs errors to stdout which means that fails are effectively silent when printed by buildman, for example. Fix this by outputing errors to stderr. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2020-04-26patman: Tidy up sys.path changesSimon Glass1-2/+3
Now that we are using absolute paths we can remove some of the sys.path mangling that appears in the tools. We only need to add the path to 'tools/' so that everything can find modules relative to that directory. The special paths for finding pylibfdt remain. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26patman: Move to absolute importsSimon Glass30-53/+53
At present patman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move patman to use absolute imports. This requires changes in tools which use the patman libraries (which is most of them). Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26binman: Move to absolute importsSimon Glass69-203/+188
At present binman sets the python path on startup so that it can access the libraries it needs. If we convert to use absolute imports this is not necessary. Move binman to use absolute imports. This enables removable of the path adjusting in Entry also. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26patman: Move test running/reporting to test_utilSimon Glass1-70/+8
This code is useful in other tools. Move it into a common file so it can be shared. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26binman: Rename the main moduleSimon Glass3-6/+6
Python does not like the module name being the same as the module directory. To allow buildman modules to be used from other tools, rename it. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-04-26patman: Drop references to __future__Simon Glass9-18/+0
We don't need these now that the tools using Python 3. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-08binman: fix default filename of u-boot-with-ucode-ptr in documentationMasahiro Yamada2-2/+2
The suffix should be ".bin" instead of ".dtb" . Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-12-03cosmetic: Fix spelling and whitespace errorsThomas Hebb2-3/+3
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
2019-11-11binman: tegra: Adjust symbol calculation depending on end-at-4gbSimon Glass10-26/+134
A recent change adjusted the symbol calculation to work on x86 but broke it for Tegra. In fact this is because they have different needs. On x86 devices the code is linked to a ROM address and the end-at-4gb property is used for the image. In this case there is no need to add the base address of the image, since the base address is already built into the offset and image-pos properties. On other devices we must add the base address since the offsets start at zero. In addition the base address is currently added to the 'offset' and 'size' values. It should in fact only be added to 'image-pos', since 'offset' is relative to its parent and 'size' is not actually an address. This code should have been adjusted when support for 'image-pos' and 'size' was added, but it was not. To correct these problems: - move the code that handles adding the base address to section.py, which can check the end-at-4gb property and which property (offset/size/image-pos) is being read - add the base address only when needed (only for image-pos and not if the image uses end-at-4gb) - add a note to the documentation - add a separate test to cover x86 behaviour Fixes: 15c981cc (binman: Correct symbol calculation with non-zero image base) Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
2019-11-05binman: 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-05binman: 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-05binman: 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-05pylibfdt: Convert to Python 3Simon Glass3-30/+3
Build this swig module with Python 3. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-11-05patman: Adjust 'command' to return strings instead of bytesSimon Glass2-2/+2
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-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>