summaryrefslogtreecommitdiffstats
path: root/tools/binman/README
Commit message (Collapse)AuthorAgeFilesLines
* binman: doc: Add documentation to htmldocsSimon Glass2021-03-261-1138/+0
| | | | | | | | Add a link to binman's documentation and adjust the files so that it is accessible. Use the name README.rst so it is easy to discover when binman is installed without U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Automatically expand phase binaries into sectionsSimon Glass2021-03-261-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | When creating an entry, check for an expanded version of that entry, then use it instead. This allows, for example use of: u-boot { }; instead of having to write out in full: u-boot { type = "section"; u-boot-nodtb { }; u-boot-dtb { }; }; Add an implementaion of this and associated documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Indicate how to make binman verboseSimon Glass2021-03-021-1/+3
| | | | | | | | Add notes about how to make binman produce verbose logging when building. Add a comment on how to do this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Update the TODO listSimon Glass2021-01-301-2/+1
| | | | | | | Two of the items have been completed and I thought of another one. Update the list. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Support compression of sectionsSimon Glass2020-10-291-0/+8
| | | | | | | | | | With the previous changes, it is now possible to compress entire sections. Add some tests to check that compression works correctly, including updating the metadata. Also update the documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Drop CheckEntries()Simon Glass2020-10-291-12/+10
| | | | | | | | | | | | | This method introduces a separation between packing and checking that is different for sections. In order to handle compression properly, we need to be able to deal with a section's size being smaller than the uncompressed size of its contents. It is easier to make this work if everything happens in the Pack() method. The only real user of CheckEntries() is entry_Section and it can call it directly. Drop the call from 'control' and handle it locally. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Drop the Entry.CheckSize() methodSimon Glass2020-10-291-11/+10
| | | | | | | This is only used by entry_Section and that class already calls it. Avoid calling it twice. Also drop it from the documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Expand docs and test for alignmentSimon Glass2020-10-291-9/+20
| | | | | | | | Alignment does form part of the entry once the image is written out, but within binman the entry contents does not include the padding. Add documentation to make this clear, as well as a test. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Expand docs and test for paddingSimon Glass2020-10-291-3/+9
| | | | | | | | Padding becomes part of the entry once the image is written out, but within binman the entry contents does not include the padding. Add documentation to make this clear, as well as a test. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Support help messages for missing blobsSimon Glass2020-09-221-0/+6
| | | | | | | | When an external blob is missing it can be quite confusing for the user. Add a way to provide a help message that is shown. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
* binman: Document how CROSS_COMPILE, CC, HOSTCC etc. are used in READMEAlper Nebi Yasak2020-09-221-0/+24
| | | | | | | | | | Explain that binman interprets these environment variables in the "External tools" section to run target/host specific versions of the tools, and add a new section on how to use CROSS_COMPILE to run the tests on non-x86 machines. Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Makefile: Rename ALL-y to INPUTS-ySimon Glass2020-07-281-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>
* cosmetic: Fix spelling and whitespace errorsThomas Hebb2019-12-031-1/+1
| | | | Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
* binman: tegra: Adjust symbol calculation depending on end-at-4gbSimon Glass2019-11-111-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* binman: Use qemu-x86_defconfig in the exampleBin Meng2019-10-111-2/+2
| | | | | | | | | The doc currently uses sandbox_defconfig as examples of enabling debug/verbose output of binman. However during a sandbox build it does not call binman at all. Change it to qemu-x86_defconfig. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* binman: Allow selection of logging verbositySimon Glass2019-10-081-0/+6
| | | | | | | | | Support a new BINMAN_VERBOSE option to the build, to allow passing the -v flag to binman. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
* binman: Add command-line support for replacing entriesSimon Glass2019-07-291-4/+18
| | | | | | | Add a 'replace' command to binman to permit entries to be replaced, either individually or all at once (using a filter). Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add a few more features to the wishlistSimon Glass2019-07-291-0/+2
| | | | | | | Add mention of a few other desirable features that may be implemented in the future. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Allow updating entries that change sizeSimon Glass2019-07-291-1/+3
| | | | | | | | | | | | | | | So far we don't allow entries to change size when repacking. But this is not very useful since it is common for entries to change size after an updated binary is built, etc. Add support for this, respecting the original offset/size/alignment constraints of the image layout. For this to work the original image must have been created with the 'allow-repack' property. This does not support entry types with sub-entries such as files and CBFS, but it does support sections. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Update documentation for image creationSimon Glass2019-07-291-5/+18
| | | | | | | There are a few more steps in the process now. Update the documentation to reflect this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add info to allow safely repacking an image laterSimon Glass2019-07-291-0/+23
| | | | | | | | | | | At present it is not possible to discover the contraints to repacking an image (e.g. maximum section size) since this information is not preserved from the original image description. Add new 'orig-offset' and 'orig-size' properties to hold this. Add them to the main device tree in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Support updating entries in an existing imageSimon Glass2019-07-291-1/+12
| | | | | | | | | | | While it is useful and efficient to build images in a single pass from a unified description, it is sometimes desirable to update the image later. Add support for replace an existing file with one of the same size. This avoids needing to repack the file. Support for more advanced updates will come in future patches. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add an 'extract' commandSimon Glass2019-07-241-1/+24
| | | | | | | It is useful to be able to extract all binaries from the image, or a subset of them. Add a new 'extract' command to handle this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Allow for logging information to be displayedSimon Glass2019-07-241-1/+18
| | | | | | | | Binman generally operates silently but in some cases it is useful to see what Binman is actually doing at each step. Enable some logging output with different logging levels selectable via the -v flag. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Support listing an imageSimon Glass2019-07-241-1/+43
| | | | | | | Add support for listing the entries in an image. This relies on the image having an FDT map. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Allow entries to expand after packingSimon Glass2019-07-241-1/+2
| | | | | | | | | | Add support for detecting entries that change size after they have already been packed, and re-running packing when it happens. This removes the limitation that entry size cannot change after PackEntries() is called. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Move compression into the Entry base classSimon Glass2019-07-241-3/+8
| | | | | | | | | | | | Compression is currently available only with blobs. However we want to report the compression algorithm and uncompressed size for all entries, so that other entry types can support compression. This will help with the forthcoming 'list' feature which lists entries in the image. Move the compression properties into the base class. Also fix up the docs which had the wrong property name. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Convert to use ArgumentParserSimon Glass2019-07-241-4/+4
| | | | | | | | This class is the new way to handle arguments in Python. Convert binman over to use it. At the same time, introduce commands so that we can separate out the different parts of binman functionality. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add an image headerSimon Glass2019-07-241-2/+3
| | | | | | | | | | | | | It is useful to be able to quickly locate the FDT map in the image. An easy way to do this is with a pointer at the start or end of the image. Add an 'image header' entry, which places a magic number followed by a pointer to the FDT map. This can be located at the start or end of the image, or at a chosen location. As part of this, update GetSiblingImagePos() to detect missing siblings. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add an FDT mapSimon Glass2019-07-241-1/+4
| | | | | | | | | An FDT map is an entry which holds a full description of the image entries, in FDT format. It can be discovered using the magic string at its start. Tools can locate and read this entry to find out what entries are in the image and where each entry is located. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Update help for new featuresSimon Glass2019-07-241-4/+3
| | | | | | | A few new features have been added. This has rendered part of the README obsolete. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Update future featuresSimon Glass2019-07-241-4/+8
| | | | | | A few features have been completed and a few items are added. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Allow preserving test directoriesSimon Glass2019-07-231-0/+8
| | | | | | | | | Sometimes when debugging tests it is useful to keep the input and output directories so they can be examined later. Add an option for this and update the binman tests to support it. This affects both the test class and the tearDown() function called after each test. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Add functions to compress and decompress dataSimon Glass2019-07-231-1/+2
| | | | | | | | | | | Add utility functions to compress and decompress using lz4 and lzma algorithms. In the latter case these use the legacy lzma support favoured by coreboot's CBFS. No tests are provided as these functions will be tested by the CBFS tests in a separate patch. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add a function to decode an ELF fileSimon Glass2019-07-231-0/+4
| | | | | | | Add a function which decodes an ELF file, working out where in memory each part of the data should be written. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add a --toolpath option to set the tool search pathSimon Glass2019-07-231-0/+10
| | | | | | | | | | | Sometimes tools used by binman may not be in the normal PATH search path, such as when the tool is built by the U-Boot build itself (e.g. mkimage). Provide a way to specify an additional search path for tools. The flag can be used multiple times. Update the help to describe this option. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add coverage tools info for Python 3Simon Glass2019-07-231-1/+1
| | | | | | | Test coverage with Python 3 requires a new package. Add details about this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Document parallel testsSimon Glass2019-07-101-0/+14
| | | | | | Since binman can run tests in parallel, document this. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Allow sections to have an offsetSimon Glass2019-05-081-0/+7
| | | | | | | | | 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>
* binman: Add a way to enable debugging from the buildSimon Glass2018-11-201-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>
* Merge git://git.denx.de/u-boot-dmTom Rini2018-09-301-9/+40
|\
| * binman: Support hashing entriesSimon Glass2018-09-291-0/+22
| | | | | | | | | | | | | | | | 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>
| * binman: Mention section attributes in docsSimon Glass2018-09-291-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>
| * binman: Support expanding entriesSimon Glass2018-09-291-0/+4
| | | | | | | | | | | | | | 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>
| * binman: Support compressed entriesSimon Glass2018-09-291-0/+16
| | | | | | | | | | | | | | | | 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>
| * binman: Move 'special properties' docs to README.entriesSimon Glass2018-09-281-11/+0
| | | | | | | | | | | | | | 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>
* | binman: Add a new "skip-at-start" property in Section classJagdish Gediya2018-09-271-0/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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>
* binman: fix a few typos in documentationMichael Heimpold2018-09-181-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>
* binman: Create README.entriesSimon Glass2018-08-011-0/+9
| | | | | | | | | | Create a new README containing documentation for the entry types supported by binman. This provides an easy reference in one place. It is automatically generated from the source-code documentation. Add a reference to this from the binman README. Signed-off-by: Simon Glass <sjg@chromium.org>
* binman: Add support for passing arguments to entriesSimon Glass2018-08-011-0/+20
| | | | | | | | | | | | | | | | | | Sometimes it is useful to pass binman the value of an entry property from the command line. For example some entries need access to files and it is not always convenient to put these filenames in the image definition (device tree). Add a -a option which can be used like this: -a<prop>=<value> where <prop> is the property to set <value> is the value to set it to Signed-off-by: Simon Glass <sjg@chromium.org>