summaryrefslogtreecommitdiff
path: root/tools/binman
AgeCommit message (Collapse)Author
2021-03-26binman: Support symbols in u-boot-spl-nodtbSimon Glass
Since this is an execuable we should be able insert symbol values into it. Add support for this. Use common code for this test and the original testSymbols. Use hex consistently for the values and add some more comments. Signed-off-by: Simon Glass <[email protected]>
2021-03-26binman: Correct the documentation for u-boot-spl-bss-padSimon Glass
The documentation for this entry indicates that the SPL binary is included along with the padding. It is not, so update it to correct the error. Signed-off-by: Simon Glass <[email protected]>
2021-03-26binman: Tidy up underscores in entry documentationSimon Glass
Several entries currently use an underscore in the entry-type name, but in fact a hyphen is used. Update the docs to fix this as it might be confusing. Also simplify the 'filename' comment and fix the 'operation' typo. Signed-off-by: Simon Glass <[email protected]>
2021-03-26binman: Update entry help for files-alignSimon Glass
Regenerate the entry documentation, which step was missed when the files-align feature was added. Fixes: 6eb9932668f ("binman: Support alignment of files") Signed-off-by: Simon Glass <[email protected]>
2021-03-26binman: Document ExpandEntries() in the base classSimon Glass
Move the documentation to the base method as it is with other methods. Also update it a little while we are here. Signed-off-by: Simon Glass <[email protected]>
2021-03-26binman: Allow extracting to current directorySimon Glass
Extracting files to the current directory is not normally a very friendly thing to do, but it can be warranted, e.g. in a new temporary dir. At present binman reports an error when such an attempt is made. Fix it. Signed-off-by: Simon Glass <[email protected]>
2021-03-02binman: Indicate how to make binman verboseSimon Glass
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 <[email protected]>
2021-01-30binman: Allow for skip_at_start when reading entriesSimon Glass
The offset of an entry needs to be adjusted by its skip-at-start value. This is currently missing when reading entry data. Fix it. Signed-off-by: Simon Glass <[email protected]>
2021-01-30binman: Support alignment of filesSimon Glass
When packing files it is sometimes useful to align the start of each file, e.g. if the flash driver can only access 32-bit-aligned data. Provides a new property to support this. Signed-off-by: Simon Glass <[email protected]>
2021-01-30binman: Allow vblock to include devicetree blobsSimon Glass
At present if a devicetree blob is included in a vblock it does not deal with updates. This is because the vblock is created once at the start and does not have a method to update itself later, after all the entry contents are finalised. Fix this by adjusting how the vblock is created. Also simplify Image.ProcessEntryContents() since it effectively duplicates the code in Section.ProcessContents(). Signed-off-by: Simon Glass <[email protected]>
2021-01-30binman: Support reading an image with entry argsSimon Glass
Normally when an entry is created, any entry arguments it has are required to be provided, so it can actually generate its contents correctly. However when an existing image is read, Entry objects are created for each of the entries in the image. This happens as part of the process of reading the image into binman. In this case we don't need the entry arguments, since we do not intend to regenerate the entries, or at least not unless requested. So there is no sense in reporting an error for missing entry arguments. Add a new property for the Image to handle this case. Update the error reporting to be conditional on this property. Signed-off-by: Simon Glass <[email protected]>
2021-01-30binman: Support finding symbols in sub-sectionsSimon Glass
At present binman only supports resolving symbols in the same section as the binary that uses it. This is quite limited because we often need to group entries into different sections. Enhance the algorithm to search the entire image for symbols. Signed-off-by: Simon Glass <[email protected]>
2021-01-30binman: Fix a few file commentsSimon Glass
Two files have the wrong comment at the top of them. Fix this. Signed-off-by: Simon Glass <[email protected]>
2021-01-30binman: Show the size when writing entriesSimon Glass
Update the log output to show the size, since this is useful information. Signed-off-by: Simon Glass <[email protected]>
2021-01-30binman: Update the TODO listSimon Glass
Two of the items have been completed and I thought of another one. Update the list. Signed-off-by: Simon Glass <[email protected]>
2021-01-30dtoc: binman: Drop Python 2 codeSimon Glass
Drop a few more Python 2 relics that are no-longer needed. Signed-off-by: Simon Glass <[email protected]>
2020-12-13patman: Drop tools.ToByte()Simon Glass
This is not needed in Python 3. Drop it. Signed-off-by: Simon Glass <[email protected]>
2020-12-13patman: Drop unicode helper functionsSimon Glass
We don't need these now that everything uses Python 3. Remove them and the extra code in GetBytes() and ToBytes() too. Signed-off-by: Simon Glass <[email protected]>
2020-12-13fdt: Use an Enum for the data typeSimon Glass
Use an Enum instead of the current ad-hoc constants, so that there is a data type associated with each 'type' value. Signed-off-by: Simon Glass <[email protected]>
2020-11-05binman: Correct calculation for image-posSimon Glass
A recent change removed the base offset from the calculation. This is used on coral to find the FSP-S binary. Fix it. Fixes: a9fad07d4b8 ("binman: Avoid reporting image-pos with compression") Signed-off-by: Simon Glass <[email protected]>
2020-11-05binman: Update intel_ifwi to store padded sectionSimon Glass
With a recent change this entry stores only part of the section data, leaving out the padding at the end. Fix this by using GetPaddedData() to get the data. Add this function to the base Entry class also. Fixes: d1d3ad7d1fe ("binman: Move section padding to the parent") Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Avoid calculated section data repeatedlySimon Glass
Refactor the implementation slightly so that section data is not rebuilt when it is already available. We still have GetData() set up to rebuild the section, since we don't currently track when things change that might affect a section. For example, if a blob is updated within a section, we must rebuild it. Tracking that would be possible but is more complex, so it left for another time. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Support compression of sectionsSimon Glass
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 <[email protected]>
2020-10-29binman: Use the actual contents in CheckSize()Simon Glass
At present this function adds up the total size of entries to work out the size of a section's contents. With compression this is no-longer enough. We may as well bite the bullet and build the section contents instead. Call _BuildSectionData() to get the (possibly compressed) contents and GetPaddedData() to get the same but with padding added. Note that this is inefficient since the section contents is calculated twice. Future work will improve this. This affects testPackOverlapMap() since the error is reported with a different section size now (enough to hold the contents). Update that at the same time. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Update CheckEntries() for compressed sectionsSimon Glass
At present this function assumes that the size of a section is at least as large as its contents. With compression this is often not the case. Relax this constraint by using the uncompressed size, if available. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Drop CheckEntries()Simon Glass
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 <[email protected]>
2020-10-29binman: Call CheckSize() from the section's Pack() methodSimon Glass
At present CheckSize() is called from the function that packs the entries. Move it up to the main Pack() function so that _PackEntries() can just do the packing. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Drop the Entry.CheckSize() methodSimon Glass
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 <[email protected]>
2020-10-29binman: Move sort and expand to the main Pack() functionSimon Glass
At present sorting and expanding entries are side-effects of the CheckEntries() function. This is a bit confusing, as 'checking' would not normally involve making changes. Move these steps into the Pack() function instead. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Drop Entry.CheckOffset()Simon Glass
This function just calls CheckEntries() in the only non-trivial implementation. Drop it and use CheckEntries() directly. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Avoid reporting image-pos with compressionSimon Glass
When a section is compressed, all entries within it are grouped together into a compressed block of data. This obscures the start of each individual child entry. Avoid reporting bogus 'image-pos' properties in this case, since it is not possible to access the entry at the location provided. The entire section must be decompressed first. CBFS does not support compressing whole sections, only individual files, so needs no special handling here. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Set section contents in GetData()Simon Glass
Section contents is not set up when ObtainContents() is called, since packing often changes the layout of the contents. Ensure that the contents are correctly recorded by making this function regenerate the section. It is normally only called by the parent section (when packing) or by the top-level image code, when writing out the image. So the performance impact is fairly small. Now that sections have their contents in their 'data' property, update testSkipAtStartSectionPad() to check it. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Store the original data before compressionSimon Glass
When compressing an entry, the original uncompressed data is overwritten. Store it so it is available if needed. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Make section padding consistent with other entriesSimon Glass
At present padding of sections is inconsistent with other entry types, in that different pad bytes are used. When a normal entry is padded by its parent, the parent's pad byte is used. But for sections, the section's pad byte is used. Adjust logic to always do this the same way. Note there is still a special case in entry_Section.GetPaddedData() where an image is padded with the pad byte of the top-level section. This is necessary since otherwise there would be no way to set the pad byte of the image, without adding a top-level section to every image. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Move section padding to the parentSimon Glass
Each section is padded up to its size, if the contents are not large enough. Move this logic from _BuildSectionData() to GetPaddedDataForEntry() so that all the padding is in one place. With this, the testDual test is working again, so enable it. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Refactor _BuildSectionData()Simon Glass
At present this function does the padding needed around an entry. It is easier to understand what is going on if we have a function that returns the contents of an entry, with padding included. Refactor the code accordingly, adding a new GetPaddedData() method. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Move section-building code into a functionSimon Glass
Create a new _BuildSectionData() to hold the code that is now in GetData(), so that it is clearly separated from entry.GetData() base function. Separate out the 'pad-before' processing to make this easier to understand. Unfortunately this breaks the testDual test. Rather than squash several patches into an un-reviewable glob, disable the test for now. This also affects testSkipAtStartSectionPad(), although it still not quite what it should be. Update that temporarily for now. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Expand docs and test for alignmentSimon Glass
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 <[email protected]>
2020-10-29binman: Expand docs and test for paddingSimon Glass
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 <[email protected]>
2020-10-29binman: Update testPackExtra with more checksSimon Glass
Check the contents of each section to make sure it is actually in the right place. Also fix a whitespace error in the .dts file. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Use 'files-compress' to set compression for filesSimon Glass
At present we use 'compress' as the property to set the compression of a 'files' entry. But this conflicts with the same property for entries, of which Entry_section is a subclass. Strictly speaking, since Entry_files is in fact a subclass of Entry_section, the files can be compressed individually but also the section (that contains all the files) can itself be compressed. With this change, it is possible to express that. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Move CompressData() into Entry base classSimon Glass
At present this is only used by blobs. To allow it to be used by other entry types (such as sections), move it into the base class. Also read the compression type in the base class. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Expand the error message for breaching a sectionSimon Glass
Add in a few more details to this error message to make it easier to see what is going on. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Remove references to 'image' in entry_SectionSimon Glass
While a section is the base class of Image, it is more correct to refer to sections in most places in this file. Fix these comments. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Fix return from u-boot-ucode if there is no DTSimon Glass
This should return empty contents, not leave it unset. Fix it. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Give a sensible error if no command is givenSimon Glass
At present if 'binman' is typed on the command line, a strange error about a missing argument is displayed. Fix this. These does not seem to be standard way to add the 'required' argument in all recent Python versions, so set it manually. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Add tests for skip-at-start sectionsSimon Glass
At present this feature is tested view the end-at-4gb feature. Add some tests of its own, including the operation of padding. The third test here shows binman's current, inconsistent approach to padding in the top-level section. Future patches in this series will address this. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Drop unused return variable for _DoTestFile()Simon Glass
This function returns the exit code from binman, not any data. Fix up a few callers in the tests. Signed-off-by: Simon Glass <[email protected]>
2020-10-29binman: Update the entry docsSimon Glass
This has got out of sync with the entries. Regenerate it. Signed-off-by: Simon Glass <[email protected]>
2020-10-22sunxi: binman: Add support for including SCP firmwareSamuel Holland
Allwinner sun50i SoCs contain an OpenRISC 1000 CPU that functions as a System Control Processor, or SCP. ARM Trusted Firmware (ATF) communicates with the SCP over SCPI to implement the PSCI system suspend, shutdown and reset functionality. Currently, SCP firmware is optional; the system will boot and run without it, but system suspend will be unavailable. Since all communication with the SCP is mediated by ATF, the only thing U-Boot needs to do is load the firmware into SRAM. The SCP firmware occupies the last 16KiB of SRAM A2, immediately following ATF. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Jagan Teki <[email protected]>