- 25 7月, 2019 2 次提交
-
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
At present if this function tries to update the contents such that the size changes, it raises an error. We plan to add the ability to change the size of entries after packing is completed, since in some cases it is not possible to determine the size in advance. An example of this is with a compressed device tree, where the values of the device tree change in SetCalculatedProperties() or ProcessEntryContents(). While the device tree itself does not change size, since placeholders for any new properties have already bee added by AddMissingProperties(), we cannot predict the size of the device tree after compression. If a value changes from 0 to 0x1234 (say), then the compressed device tree may expand. As a first step towards supporting this, make ProcessContentsUpdate() return a value indicating whether the content size is OK. For now this is always True (since otherwise binman raises an error), but later patches will adjust this. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 24 7月, 2019 4 次提交
-
-
由 Simon Glass 提交于
At present this function always sets both the offset and the size of entries. But in some cases we want to set only one or the other, for example with the forthcoming ifwi entry, where we only set the offset. Update the function to handle this. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
At present binman requires that the Intel descriptor has an explicit offset. Generally this is 0 since the descriptor is at the start of the image. Add a default to handle this, so users don't need to specify the offset. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Some functions lack comments in this file. Add comments to cover this functionality. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This comment is out of date as it does not correctly describe the return value. Fix it. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 11 7月, 2019 3 次提交
-
-
由 Simon Glass 提交于
The method of multiplying a character by a number works well for creating a repeated string in Python 2. But in Python 3 we need to use bytes() instead, to avoid unicode problems, since 'bytes' is no-longer just an alias of 'str'. Create a function to handle this detail and call it from the relevant places in binman. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Python 3 requires this, and Python 2 allows it. Convert the code over to ensure compatibility with Python 3. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
A new built-in set() is used in both Python 2 and 3 now. Move it to use that instead of Set(). Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 08 5月, 2019 1 次提交
-
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org> Reviewed-by: NBin Meng <bmeng.cn@gmail.com>
-
- 30 9月, 2018 6 次提交
-
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
It is useful to have entries which can grow automatically to fill available space. Add support for this. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
- 29 9月, 2018 2 次提交
-
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
- 28 9月, 2018 1 次提交
-
-
由 Jagdish Gediya 提交于
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: NJagdish Gediya <jagdish.gediya@nxp.com> Reviewed-by: NBin Meng <bmeng.cn@gmail.com> Reviewed-by: NSimon Glass <sjg@chromium.org> Reviewed-by: NYork Sun <york.sun@nxp.com>
-
- 02 8月, 2018 5 次提交
-
-
由 Simon Glass 提交于
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: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This adds support for a Chromium verified boot block, used to sign a read-write section of the image. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
At present each entry has an offset within its parent section. This is useful for figuring out how entries relate to one another. However it is sometimes necessary to locate an entry within an image, regardless of which sections it is nested inside. Add a new 'image-pos' property to provide this information. Also add some documentation for the -u option binman provides, which updates the device tree with final entry information. Since the image position is a better symbol to use for the position of U-Boot as obtained by SPL, update the SPL symbols to use this instead of offset, which might be incorrect if hierarchical sections are used. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
At present the .map file produced for each image does not include the overall image size. This is useful information. Update the code to generate it in the .map file as well as the updated FDT. Also fix a few comments while we are here. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
After some thought, I believe there is an unfortunate naming flaw in binman. Entries have a position and size, but now that we support hierarchical sections it is unclear whether a position should be an absolute position within the image, or a relative position within its parent section. At present 'position' actually means the relative position. This indicates a need for an 'image position' for code that wants to find the location of an entry without having to do calculations back through parents to discover this image position. A better name for the current 'position' or 'pos' is 'offset'. It is not always an absolute position, but it is always an offset from its parent offset. It is unfortunate to rename this concept now, 18 months after binman was introduced. However I believe it is the right thing to do. The impact is mostly limited to binman itself and a few changes to in-tree users to binman: tegra sunxi x86 The change makes old binman definitions (e.g. downstream or out-of-tree) incompatible if they use the 'pos = <...>' property. Later work will adjust binman to generate an error when it is used. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 09 7月, 2018 3 次提交
-
-
由 Simon Glass 提交于
Once binman has packed the image, the position and size of each entry is known. It is then possible for binman to update the device tree with these positions. Since placeholder values have been added, this does not affect the size of the device tree and therefore the packing does not need to be performed again. Add a new SetCalculatedProperties method to handle this. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
Some entry types modify the device tree, e.g. to remove microcode or add a property. So far this just modifies their local copy and does not affect a 'shared' device tree. Rather than doing this modification in the ObtainContents() method, and a new ProcessFdt() method which is specifically designed to modify this shared device tree. Move the existing device-tree code over to use this method, reducing ObtainContents() to the goal of just obtaining the contents without any processing, even for device tree. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
This method is supposed to return the contents of an entry. However at present there is no check that it actually does. Also some implementations do not return 'True' to indicate success, as required. Add a check for things working as expected, and correct the implementations. This requires some additional test cases to cover things which were missed originally. Add these at the same time. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 08 6月, 2018 4 次提交
-
-
由 Simon Glass 提交于
Sometimes we have several sections which repeat the same entries (e.g. for a read-only and read-write version of the same section). It is useful to be able to tell these entries apart by name. Add a new 'name-prefix' property for sections, which causes all entries within that section to have a given name prefix. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
It is useful to be able to see a list of regions in each image produced by binman. Add a -m option to output this information in a '.map' file alongside the image file. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
It is useful to be able to split an image into multiple sections, each with its own size and position, for cases where a flash device has read-only and read-write portions. Add support for this. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
由 Simon Glass 提交于
We want to support multiple sections within a single image. To do this, move most of the Image class implementation into a new Section class. An Image contains only a single Section, but at some point we will support a new 'section' entry, thus allowing Sections within Sections. Use the name 'bsection' for the module so we can use 'section' for the etype module. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 07 5月, 2018 1 次提交
-
-
由 Tom Rini 提交于
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: NTom Rini <trini@konsulko.com>
-
- 13 12月, 2017 1 次提交
-
-
由 Simon Glass 提交于
Binman construct images consisting of multiple binary files. These files sometimes need to know (at run timme) where their peers are located. For example, SPL may want to know where U-Boot is located in the image, so that it can jump to U-Boot correctly on boot. In general the positions where the binaries end up after binman has finished packing them cannot be known at compile time. One reason for this is that binman does not know the size of the binaries until everything is compiled, linked and converted to binaries with objcopy. To make this work, we add a feature to binman which checks each binary for symbol names starting with '_binman'. These are then decoded to figure out which entry and property they refer to. Then binman writes the value of this symbol into the appropriate binary. With this, the symbol will have the correct value at run time. Macros are used to make this easier to use. As an example, this declares a symbol that will access the 'u-boot-spl' entry to find the 'pos' value (i.e. the position of SPL in the image): binman_sym_declare(unsigned long, u_boot_spl, pos); This converts to a symbol called '_binman_u_boot_spl_prop_pos' in any binary that includes it. Binman then updates the value in that binary, ensuring that it can be accessed at runtime with: ulong u_boot_pos = binman_sym(ulong, u_boot_spl, pos); This assigns the variable u_boot_pos to the position of SPL in the image. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 23 11月, 2017 1 次提交
-
-
由 Simon Glass 提交于
There is a little check at the top of entry.py which decides if importlib is available. At present this has no test coverage. To add this we will need to import the module twice, once with importlib and once without. In preparation for allowing a test to control the importing of this module, remove all global imports of the 'entry' module. Signed-off-by: NSimon Glass <sjg@chromium.org>
-
- 20 12月, 2016 1 次提交
-
-
由 Simon Glass 提交于
This adds the basic code for binman, including command parsing, processing of entries and generation of images. So far no entry types are supported. These will be added in future commits as examples of how to add new types. See the README for documentation. Signed-off-by: NSimon Glass <sjg@chromium.org> Tested-by: NBin Meng <bmeng.cn@gmail.com>
-