aboutsummaryrefslogtreecommitdiff
path: root/tools/binman
AgeCommit message (Collapse)AuthorFilesLines
2019-05-08binman: Allow sections to have an offsetSimon Glass5-5/+67
At present sections are always placed automatically. Even if an 'offset' property is provided it is ignored. Update the logic to support an offset for sections. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-05-08binman: Add a missing comment in Entry_vblockSimon Glass1-0/+1
An important property is missing. Update the entry comment to include this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-05-08binman: Don't show image-skip message by defaultSimon Glass2-9/+21
This message is not very important since it is simply indicating that the user's instructions are being followed. Only show it when the verbosity level is above the default. Also drop the unnecessary extra newline on this message, which causes two line breaks. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-05-08binman: Don't generate an error in 'text' entry constructorSimon Glass1-2/+2
It is not good practice to raise an exception in a constructor. In this case the 'text' entry may not actually be used, if -i is used to filter out the images that get built. Move the exception to where the data is actually used. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-11-20binman: Set the pathname correctly for ELF filesSimon Glass1-3/+2
At present, stripped files don't have the right pathname which means that blob compression cannot be used. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-20binman: Drop an unnecessary comma in blob handlingSimon Glass1-1/+1
This comma is not needed. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-20binman: Add a way to enable debugging from the buildSimon Glass1-0/+6
When the build fails due to something wrong in binman it is sometimes useful to get a full backtrace showing the location of the failure. Add a BINMAN_DEBUG environment variable to support this along with some documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-22binman: Add a test for Intel reference codeSimon Glass2-0/+21
Unfortunately the test was not included in the original implementation. Add one. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-22binman: Add support for Intel reference codeSimon Glass1-0/+27
Some platforms use this instead of FSP to set up the platform, including memory. Add support for this in binman. This is needed for chromebook_samus, for example. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2018-10-09binman: Move to three-digit test-file numbersSimon Glass101-115/+115
We now have 99 tests. Before adding any more, rename everything to three digits. This helps to preserve the ordering of tests and makes it easier to find things. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-08binman: Run tests concurrentlySimon Glass4-21/+48
At present the tests run one after the other using a single CPU. This is not very efficient. Bring in the concurrencytest module and run the tests concurrently, using one process for each CPU by default. A -P option allows this to be overridden, which is necessary for code-coverage to function correctly. This requires fixing a few tests which are currently not fully independent. At some point we might consider doing this across all pytests in U-Boot. There is a pytest version that supports specifying the number of processes to use, but it did not work for me. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-08binman: Separate out testSplBssPad()Simon Glass1-1/+3
At present this test runs binman twice, which means that the temporary files from the first run do not get cleaned up. Split this into two tests to fix this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-08binman: Fix up removal of temporary directoriesSimon Glass4-7/+18
At present 'make check' leaves some temporary directories around. Part of this is because we call tools.PrepareOutputDir() twice in some cases, without calling tools.FinaliseOutputDir() in between. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-10-08binman: Add a default path to libfdt.pySimon Glass1-0/+2
This module is often available in the sandbox_spl build created by 'make check'. Use this as a default path so that just typing 'binman -t' (without setting PYTHONPATH) will generally run the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-30Merge git://git.denx.de/u-boot-dmTom Rini55-153/+1705
2018-09-29binman: Allow writing a map file when something goes wrongSimon Glass4-8/+46
When we get a problem like overlapping regions it is sometimes hard to figure what what is going on. At present we don't write the map file in this case. However the file does provide useful information. Catch any packing errors and write a map file (if enabled with -m) to aid debugging. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Support ELF files for U-Boot and SPLSimon Glass6-0/+130
For sandbox we want to put ELF files in the image since that is what we need to execute. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Correct fmap output on x86Simon Glass8-16/+121
Normally x86 platforms use the end-at-4gb option. This currently produces an FMAP with positions which have a large offset. The use of end-at-4gb is a useful convenience within binman, but we don't really want to export a map with these offsets. Fix this by subtracting the 'skip at start' parameter. Also put the code which convers names to fmap format, for clarity. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Record the parent section of each sectionSimon Glass3-4/+9
At present sections have no record of their parent so it is not possible to traverse up the tree to the root and figure out the position of a section within the image. Change the constructor to record this information. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Support x86 microcode in TPLSimon Glass9-21/+151
When TPL is used on x86 we may want to program the microcode (at least for the first CPU) early in boot. Add support for this by refactoring the existing code to be more generic. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Support hashing entriesSimon Glass9-0/+143
Sometimesi it us useful to be able to verify the content of entries with a hash. Add an easy way to do this in binman. The hash information can be retrieved from the device tree at run time. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Mention section attributes in docsSimon Glass1-2/+2
Images and sections have the same attributes, since an image is mostly just a top-level section. Update the docs to explain this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Support expanding entriesSimon Glass8-2/+136
It is useful to have entries which can grow automatically to fill available space. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Support adding filesSimon Glass16-0/+207
In some cases it is useful to add a group of files to the image and be able to access them at run-time. Of course it is possible to generate the binman config file with a set of blobs each with a filename. But for convenience, add an entry type which can do this. Add required support (for adding nodes and string properties) into the state module. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Allow zero-size sectionsSimon Glass1-1/+1
At present if there is only a zero-size entry in a section this is reported as an error, e.g.: Offset 0x0 (0) is outside the section starting at 0x0 (0) Adjust the logic in CheckEntries() to avoid this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-29binman: Support compressed entriesSimon Glass5-9/+105
Add support for compressing blob entries. This can help reduce image sizes for many types of data. It requires that the firmware be able to decompress the data at run-time. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Support updating all device tree filesSimon Glass13-21/+235
Binman currently supports updating the main device tree with things like the position of each entry. Extend this support to SPL and TPL as well, since they may need (a subset of) this information. Also adjust DTB output files to have a .out extension since this seems clearer than having a .dtb extension with 'out' in the name somwhere. Also add a few missing comments and update the DT setup code to use ReadFile and WriteFile(). Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Allow control of whether a fake DT is usedSimon Glass4-2/+7
We use a fake device tree in tests most of the time since tests don't normally care about the actual data. For example, for U-Boot proper we use U_BOOT_DTB_DATA which is just a four-character string. This makes testing the image output against an expected value very easy. However in some cases, such as when the test wants to check that the DT output containing particular nodes, we do actually need the real DT. Add support for this, along with a command-line option to select 'test mode'. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Obtain the list of device trees from the configSimon Glass5-3/+46
We always have a device tree for U-Boot proper. But we may also have one for SPL and TPL. Add a new Entry method to find out what DTs an entry has, and use that list when updating DTs. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Centralise device-tree updates within binmanSimon Glass3-8/+44
At present we have a few calls to device-tree functions in binman and plan to add more as we add new entry types which need to report their results. It makes sense to put this code in a central place so that we can make sure all device trees are updated. At present we only have U-Boot proper, but plan to add SPL and TPL too. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Move state logic into the state moduleSimon Glass2-8/+56
Rather than reaching into this module from control, move the code that needs this info into state. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Move state information into a new moduleSimon Glass5-48/+95
At present the control module has state information in it, since it is the primary user of this. But it is a bit odd to have entries and other modules importing control to obtain this information. It seems better to have a dedicated state module, which control can use as well. Create a new module using code from control and update other modules to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Add an entry method for getting the default filenameSimon Glass2-0/+8
Various entry implementations provide a way to obtain the default filename for an entry. But at present there is no base-class implementation for this function. Add one so that the API is defined. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28dtoc: Allow syncing of the device tree back to a fileSimon Glass1-0/+2
At present we require the caller to manually update the device tree using individual calls to libfdt functions. This is not ideal. It would be better if we could make changes using the Python structure and then call a Sync() function to write them back. Add this feature to the Fdt class. Update binman and the tests to match. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Support building a selection of imagesSimon Glass3-1/+29
Sometimes it is useful to build only a subset of the images provided by the binman configuration. Add a -i option for this. It can be given multiple times to build several images. If the option is not given, all images are built. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Tidy up the vblock entrySimon Glass5-4/+43
At present if there are two vblock entries an image their contents are written to the same file in the output directory. This prevents checking the contents of each separately. Fix this by adding part of the entry path to the filename, and add some missing comments. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Add x86 support for starting TPLSimon Glass4-1/+70
Sometimes we want to include TPL for x86 platforms, such as when we want to select between different SPL images (e.g. for Chrome OS verified boot). Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Generate an error when text is not providedSimon Glass2-0/+10
When the value of a text entry is not provided an execption is generated talking about a None type. This is confusing. Add a more explanatory error and a test for this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Allow 'fill' entry to have a size of 0Simon Glass3-1/+21
The check for this should be for None, not 0. Fix it and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-28binman: Move 'special properties' docs to README.entriesSimon Glass3-12/+7
This information should be in the entry it relates to, not in the main README. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-09-27binman: Add support for PowerPC mpc85xx 'bootpg + resetvec' entryJagdish Gediya4-1/+62
This entry contains the PowerPC mpc85xx boot page and resetvec sections. Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: York Sun <york.sun@nxp.com>
2018-09-27binman: Add a new "skip-at-start" property in Section classJagdish Gediya4-4/+49
Currently binman calculates '_skip_at_start' based on 'end-at-4gb' property and it is used for x86 images. For PowerPC mpc85xx based CPU, CONFIG_SYS_TEXT_BASE is the entry offset of the first entry. It can be 0xeff40000 or 0xfff40000 for nor flash boot, 0x201000 for sd boot etc, so "_skip_at_start" should be set to CONFIG_SYS_TEXT_BASE. 'end-at-4gb' property is not applicable where CONFIG_SYS_TEXT_BASE + Image size != 4gb. Add new property 'skip-at-start' in Section class so that '_skip_at_start' can be calculated either based on 'end-at-4gb' or based on "skip-at-start". Add a test case to check that 'skip-at-start' and 'end-at-4gb' property can't be used together. Signed-off-by: Jagdish Gediya <jagdish.gediya@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: York Sun <york.sun@nxp.com>
2018-09-18binman: fix a few typos in documentationMichael Heimpold1-4/+4
This fixes four small typos in the README file. Signed-off-by: Michael Heimpold <mhei@heimpold.de> Cc: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Adjust _GetPropTree() parametersSimon Glass1-9/+5
At present this function takes a filename, but it is better to use an Fdt object so that the caller can control this, perhaps obtainint the device tree from a bytearray. Update the method accordingly and also fix a confusing parameter name. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Add a test to catch use of the old 'pos' propertySimon Glass3-0/+19
This property has been changed to 'offset'. To help downstream users who might still be using 'pos', add a check that this is not used by mistake. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Rename ReadContents() to ReadBlobContents()Simon Glass3-4/+4
This function name is too generic for its purpose and is therefore confusing. It actually only applies to blobs, so rename it to indicate this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Show the image position in the mapSimon Glass4-19/+23
At present the map only shows the offset and size for each region. The image position provides the actual position of each entry in the image, regardless of the section hierarchy. Add the image position to the map. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Add support for adding TPL binariesSimon Glass7-6/+137
Add support for U-Boot's TPL and TPL device tree. Also fix a few comments in the other device-tree entries. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Add an entry for a Chromium vblockSimon Glass9-1/+259
This adds support for a Chromium verified boot block, used to sign a read-write section of the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-08-01binman: Add support for Chromium GBBSimon Glass6-0/+221
This entry contains a Google Binary Block, used to store keys and bitmaps in a Chromium image. Signed-off-by: Simon Glass <sjg@chromium.org>