aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26rockchip: add CONFIG_IRAM_BASE for all SoCsKever Yang8-0/+14
Rockchip SoCs have internal sram for bootrom data area and for sdram init program space. Introduce the base address in case we need to use it. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-26rockchip: remove redundant CONFIG_SYS_NS16550_MEM32Kever Yang4-8/+0
The CONFIG_SYS_NS16550_MEM32 already defined in rockchip_common.h, no need to define again in soc level header. Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-26include: configs: Increase CONFIG_SYS_BOOTM_LEN to 16MBShyam Saini1-0/+2
The default value of CONFIG_SYS_BOOTM_LEN is 0x800000 i.e, 8MB which causes board reset because of larger uImage size. This was tested on rk3288 Amarula Vyasa and rk3288 Asus Tinker boards. Error log snippet: Booting using the fdt blob at 0x1f00000 Loading Kernel Image ... Image too large: increase CONFIG_SYS_BOOTM_LEN Must RESET board to recover resetting ... Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Signed-off-by: Shyam Saini <shyam.saini@amarulasolutions.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-07-24gitlab-ci: Update Docker image to xenial-20190720-24Jul2019 tagTom Rini1-1/+1
- Add in lzma-alone for current binman tests - Update to Ubuntu's xenial-20190720 tag (latest). Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24gitlab-ci: Add pyelftools to the binman testsuite sectionTom Rini1-0/+3
We need pyelftools here to run rather than skip some tests. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24Merge tag 'dm-pull-24jul19-take3' of ↵Tom Rini87-923/+8158
https://gitlab.denx.de/u-boot/custodians/u-boot-dm Minor driver-model fixes and tweaks A few device-tree fixes Binman support for extracting files from an image
2019-07-24dm: device: make power domain calls optionalAnatolij Gustschin1-1/+2
Reduce power domain calls when CONFIG_POWER_DOMAIN is disabled. With gcc v8.2, this change saves 104 bytes. Signed-off-by: Anatolij Gustschin <agust@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2019-07-24buildman: fix invocation examples typosBaruch Siach1-2/+2
Also, make command line example indentation consistent. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2019-07-24clk: initialize clk->data when using default xlateSekhar Nori1-0/+2
Right now when using clk_of_xlate_default(), clk->data remains un-initialized because clk_get_bulk() does not initialize memory on allocation of clock structure. This can cause problems when data is used to match if two clocks pointers are exactly the same underlying clocks, for example. Fix it by initializing clk->data to 0. Suggested-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
2019-07-24dm: uclass: fix comment copy/paste errorBaruch Siach1-1/+1
The uclass_next_device() routine continues a previously started device iteration. Change the description that is copied from uclass_first_device(). Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24common: fdt_support: Add missing cpu_to_fdt32() to fdt_pci_dma_ranges()Marek Vasut1-11/+14
The fdt_pci_dma_ranges() cannot work on e.g. ARM, since the DT entries endianness is not adjusted at all. Fix this. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Tom Rini <trini@konsulko.com>
2019-07-24dm: Fix parameter description of dev_read_name()Bin Meng1-1/+1
The comments of dev_read_name() wrongly describe "node" as its parameter. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24dm: core: Set correct "status" value for a nodeBin Meng1-1/+1
Per device tree spec, "status" property can have a value of "okay", or "disabled", but not "disable". Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24dm: core: Call clk_set_defaults() during probe() only for a valid ofnodeBin Meng1-4/+10
Without a valid ofnode, it's meaningless to call clk_set_defaults() to process various properties. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24dm: timer: Skip device that does not have a valid ofnode in pre_probe()Bin Meng1-0/+4
It is possible that a timer device has a null ofnode, hence there is no need to further parse DT for the clock rate. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-24fdt: make fdt_get_base_address() return OF_BAD_ADDR when "reg" not foundMasahiro Yamada1-1/+1
Currently, fdt_get_base_address() returns 0 if the "reg" property is missing. Since 0 is a valid value, it is not suitable for the error handling. Return OF_BAD_ADDR instead. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-07-24binman: Add a test for nested and aligned sectionsSimon Glass2-1/+94
Current test coverage is likely sufficient for the logic used to place sections in the image. However it seems useful to add a test specifically for nested sections, since these could have some unusual interactions. Add a new test for this and aligned sections. This test failed before the refactor to drop the bsection.py file (Section class), but passes now. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Add an 'extract' commandSimon Glass4-1/+286
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>
2019-07-24binman: Support reading from CBFS entriesSimon Glass2-0/+21
CBFS is a bit like a section but with a custom format. Provide the list of entries and the compression type to binman so that it can extract the data from the CBFS, just like any other part of the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Allow reading an entry from an imageSimon Glass5-1/+99
It is useful to be able to extract entry contents from an image to see what is inside. Add a simple function to read the contents of an entry, decompressing it by default. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Allow for logging information to be displayedSimon Glass4-4/+31
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>
2019-07-24binman: Support listing an imageSimon Glass6-1/+352
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>
2019-07-24binman: Convert Image to a subclass of EntrySimon Glass9-702/+462
When support for sections (and thus hierarchical images) was added to binman, the decision was made to create a new Section class which could be used by both Image and an Entry_section class. The decision between using inheritance and composition was tricky to make, but in the end it was decided that Image was different enough from Entry that it made sense to put the implementation of sections in an entirely separate class. It also has the advantage that core Image code does have to rely on an entry class in the etype directory. This work was mostly completed in commit: 8f1da50ccc "binman: Refactor much of the image code into 'section' As a result of this, the Section class has its own version of things like offset and size and these must be kept in sync with the parent Entry_section class in some cases. In the last year it has become apparent that the cost of keeping things in sync is larger than expected, since more and more code wants to access these properties. An alternative approach, previously considered and rejected, now seems better. Adjust Image to be a subclass of Entry_section. Move the code from Section (in bsection.py) to Entry_section and delete Section. Update all tests accordingly. This requires substantial changes to Image. Overall the changes reduce code size by about 240 lines. While much of that is just boilerplate from Section, there are quite a few functions in Entry_section which now do not need to be overiden from Entry. This suggests the change is beneficial even without further functionality being added. A side benefit is that the properties of sections are now consistent with other entries. This fixes a problem in testListCmd() where some properties are missing for sections. Unfortunately this is a very large commit since it is not feasible to do the migration piecemeal. Given the substantial tests available and the 100% code coverage of binman, we should be able to do this safely. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Support reading an image into an Image objectSimon Glass4-4/+111
It is possible to read an Image, locate its FDT map and then read it into the binman data structures. This allows full access to the entries that were written to the image. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Support locating an image headerSimon Glass2-0/+50
Add support for locating an image header in an image. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Support locating an FDT mapSimon Glass3-2/+74
Add support for locating an image's Fdt map which is used to determine the contents and structure of the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Allow listing the entries in an imageSimon Glass7-1/+174
It is useful to be able to summarise all the entries in an image, e.g. to display this to this user. Add a new ListEntries() method to Entry, and set up a way to call it through the Image class. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Detect bad CBFS file typesSimon Glass3-0/+26
Detect when an unknown or unsupported file type is specified and report an error. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Support FDT update for CBFSSimon Glass3-3/+92
It is useful to add the CBFS file information (offset, size, etc.) into the FDT so that the layout is complete. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Use the cbfs memlen field only for uncompressed lengthSimon Glass1-4/+7
The purpose of this badly named field is a bit ambiguous. Adjust the code to use it only to store the uncompressed length of a file, leaving it set to None if there is no compression used. This makes it easy to see if the value in this field is relevant / useful. Also set data_len for compressed fields, since it should be the length of the compressed data, not the uncompressed data. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Provide the actual data address for cbfs filesSimon Glass1-11/+20
At present a file with no explicit CBFS offset is placed in the next available location but there is no way to find out where it ended up. Update and rename the get_data() function to provide this information. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Allow device-tree entries to be compressedSimon Glass4-12/+53
At present the logic skips the blob class' handling of compression, so this is not supported with device tree entries. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Allow entries to expand after packingSimon Glass12-25/+184
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>
2019-07-24binman: Add a control for post-pack entry expansionSimon Glass1-0/+24
We plan to support changing the size of entries after they have been packed. For now it will always be enabled. But to aid testing of both cases (in the event that we want to add a command-line flag, for example), add a setting to control it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Add a return value to ProcessContentsUpdate()Simon Glass10-15/+44
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: Simon Glass <sjg@chromium.org>
2019-07-24binman: Call ProcessUpdateContents() consistentlySimon Glass4-4/+4
SetContents() should only be called to set the contents of an entry from within the ObtainContents() call, since it has no guard against increasing the size of the contents, thus triggering incorrect operation. Change all such calls to use ProcessUpdateContents() instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Fix up ProcessUpdateContents error and commentsSimon Glass2-5/+5
This function raises an exception with its arguments around the wrong way so the message is incorrect. Fix this as well as a few minor comment problems. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Allow easy importing of entry modulesSimon Glass3-0/+3
At present entry modules can only be accessed using Entry.Lookup() or Entry.Create(). Most of the time this is fine, but sometimes a module needs to provide constants or helper functions useful to other modules. It is easier in this case to use 'import'. Add an __init__ file to permit this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Drop an unused arg in Entry.Lookup()Simon Glass1-4/+3
The first argument is not used. Remove it. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Move compression into the Entry base classSimon Glass3-18/+21
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>
2019-07-24binman: Convert to use ArgumentParserSimon Glass10-137/+134
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>
2019-07-24binman: Add an image headerSimon Glass10-3/+242
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>
2019-07-24binman: Add an FDT mapSimon Glass6-8/+211
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>
2019-07-24binman: Add a convenience functions for real-DTB testsSimon Glass1-2/+12
Quite a few tests will use a real device tree and need it updated with the binman metadata. Add a helper function for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Update help for new featuresSimon Glass1-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>
2019-07-24binman: Update future featuresSimon Glass1-4/+8
A few features have been completed and a few items are added. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Simplify the entry testSimon Glass1-16/+16
The current test for the 'entry' module is a bit convoluted since it has to import the module multiple times. It also relies on ordering, in that test1EntryNoImportLib() must run before test2EntryImportLib() if they are running in the same Python process. This is unreliable since neither the ordering of tests nor the process that they run in is defined. Fix this by always reloading the entry in these two tests. Also add a check that the expected value of have_importlib is obtained. This corrects a code-coverage problem in the 'entry' module on some systems. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Add support for fixed-offset files in CBFSSimon Glass6-34/+276
A feature of CBFS is that it allows files to be positioned at particular offset (as with binman in general). This is useful to support execute-in-place (XIP) code, since this may not be relocatable. Add a new cbfs-offset property to control this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Pad empty areas of the CBFS with filesSimon Glass2-4/+87
When there is lots of open space in a CBFS it is normally padded with 'empty' files so that sequentially scanning the CBFS can skip from one to the next without a break. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2019-07-24binman: Add support for Intel IFWI entriesSimon Glass8-2/+245
An Integrated Firmware Image is used to hold various binaries used for booting with Apollolake and some later devices. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>