summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2016-09-19dtoc: Add methods for reading data from propertiesSimon Glass
Provide easy helpers for reading integer, string and boolean values from device-tree properties. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Correct quotes in fdt_utilSimon Glass
The style is to use single quotes for strings where possible. Adjust this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Support finding the offset of a propertySimon Glass
Add a way to find the byte offset of a property within the device tree. This is only supported with the normal libfdt implementation since fdtget does not provide this information. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Support packing the device treeSimon Glass
After any node/property deletion the device tree can be packed to remove spare space. Add a way to perform this operation. Note that for fdt_fallback, fdtput automatically packs the device tree after deletion, so no action is required here. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Support deleting device tree propertiesSimon Glass
Add support for deleting a device tree property. With the fallback implementation this uses fdtput. With libfdt it uses the API call and updates the offsets afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Move to using bytearraySimon Glass
Since we want to be able to change the in-memory device tree using libfdt, use a bytearray instead of a string. This makes interfacing from Python easier. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Prepare for supporting changing of device treesSimon Glass
For binman we need to support deleting properties in the device tree. This will change the offsets of nodes after the deletion. In preparation, add code to keep track of when the offsets are invalid, and regenerate them. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Drop the convert_dash parameter to GetProps()Simon Glass
This is not used anywhere in dtoc, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Allow the device tree to be compiled from sourceSimon Glass
If a source device tree is provide to the Fdt() constructors, compile it automatically. This will be used in tests, where we want to build a particular test .dts file and check that it works correctly in binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19patman: Add a library to handle logging and progressSimon Glass
When tools want to display information of varying levels of importance, it helps to provide the user with control over the verbosity of these messages. Progress messages work best if they are displayed and then removed from the display when no-longer relevant. Add a new tout library (terminal out) to handle these tasks. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19patman: Add a tools library for using temporary filesSimon Glass
For tools which want to use input files and temporary output, it is useful to have the handling of these dealt with in one place. Add a new library which allows input files to be read, and output files to be written, all based on a common directory structure. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Move a few more common functions into fdt.pySimon Glass
Some functions have the same code in the subclasses. Move these into the superclass to avoid duplication. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Move Widen() and GetPhandle() into the base classSimon Glass
These functions are identical in both subclasses. Move them into the base class. Note: In fact there is a bug in one version, which was fixed by this patch: https://patchwork.ozlabs.org/patch/651697/ Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Move BytesToValue() and GetEmpty() into PropBaseSimon Glass
These functions are currently in a separate fdt_util file. Since they are only used from PropBase and subclasses, it makes sense for them to be in the PropBase class. Move these functions into fdt.py along with the list of types. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Create a base class for FdtSimon Glass
At present we have two separate implementations of the Fdt library, one which uses fdtget/fdtput and one which uses libfdt (via swig). Before adding more functionality it makes sense to create a base class for these. This will allow common functions to be shared, and make the Fdt API a little clearer. Create a new fdt.py file with the base class, and adjust fdt_normal.py and fdt_fallback.py to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Rename fdt.py to fdt_normal.pySimon Glass
In preparation for creating an Fdt base class, rename this file to indicate it is the normal Fdt implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Move the fdt library selection into fdt_selectSimon Glass
Rather than have dtc worry about which fdt library to use, move this into a helper file. Add a function which creates a new Fdt object and scans it, regardless of the implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19dtoc: Move the struct import into the correct orderSimon Glass
This should be in with the other system includes. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-19patman: Adjust command.Output() to raise an error by defaultSimon Glass
It is more useful to have this method raise an error when something goes wrong. Make this the default and adjust the few callers that don't want to use it this way. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-16moveconfig: Add an option to commit changesSimon Glass
The moveconfig tool is quite clever and generally produces results that are suitable for sending as a patch without further work. The main required step is to add the changes to a commit. Add an option to do this automatically. This allows moveconfig to be used from a script to convert multiple CONFIG options, once per commit. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-16moveconfig: Add an option to skip promptsSimon Glass
At present it is not easy to use moveconfig from a script since it asks for user input a few times. Add a -y option to skip this and assume that 'y' was entered. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-09Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini
2016-09-06tools: moveconfig: add --spl option to move options for SPL buildMasahiro Yamada
Prior to this commit, the tool could not move options guarded by CONFIG_SPL_BUILD ifdef conditionals because they do not show up in include/autoconf.mk. This new option, if given, makes the tool parse spl/include/autoconf.mk instead of include/autoconf.mk, which is probably preferred behavior when moving options for SPL. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-09-06tools: moveconfig: warn loudly if moved option has no entry in KconfigMasahiro Yamada
Currently, the tool gives up moving an option quietly if its entry was not found in Kconfig. If the option is not defined in the config header in the first place, it is no problem (as the Kconfig entry may have been hidden by reasonable "depends on"). However, if the option is defined in the config header, the missing Kconfig entry is a sign of possible behavior change. It is highly recommended to manually check if the option has been moved as expected. In this case, let's add "suspicious" in the log and change the log color (if --color option is given) to make it stand out. This was suggested by Tom in [1]. [1] http://lists.denx.de/pipermail/u-boot/2016-July/261988.html Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Suggested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-09-06tools: moveconfig: use sets instead of lists for failed/suspicious boardsMasahiro Yamada
The sets feature is handier for adding unique elements. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-09-06tools: moveconfig: remove document about deprecated error messageMasahiro Yamada
Since commit cc008299f852 ("tools: moveconfig: do not rely on type and default value given by users"), we do not have this error case. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
2016-09-06imx: ventana: enable splashscreen supportTim Harvey
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2016-08-26treewide: fix "followings" to "following"Masahiro Yamada
Most of them are my mistakes. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-08-26tools: moveconfig: add Xtensa GCC prefix to CROSS_COMPILE listMasahiro Yamada
This is needed to move CONFIG options for the recently-added xtfpga_defconfig. The tarball of the pre-built toolchain can be downloaded from: https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/ Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-08-26tools: kwboot: patch destaddr only for SoCs with header version 1Simon Baatz
Commit f4db6c976cf ("arm: mvebu: Add runtime detection of UART (xmodem) boot-mode") added a change to hdr->destaddr when dynamically patching an image for UART boot mode. With this change, kwboot ceases to work on Kirkwood. Thus, let's change hdr->destaddr only when we are patching an image with header version 1 (Orion and Kirkwood use header version 0). Signed-off-by: Simon Baatz <gmbnomis@gmail.com> Fixes: f4db6c976cf ("arm: mvebu: Add runtime detection of UART (xmodem) boot-mode") Cc: Stefan Roese <sr@denx.de> Cc: Luka Perkov <luka.perkov@sartura.hr> Cc: Kevin Smith <kevin.smith@elecsyscorp.com> Signed-off-by: Stefan Roese <sr@denx.de>
2016-08-20tools/env: soften warning about erase block alignmentAndreas Fenkart
addon 183923d3e MMC/SATA have no erase blocks, only blocks. Hence the warning about erase block alignment might be confusing in such environment. Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-20tools/env: return with error if redundant environments have unequal sizeAndreas Fenkart
For double buffering to work, the target buffer must always be big enough to hold all data. This can only be ensured if buffers are of equal size, otherwise one must be smaller and we risk data loss when copying from the bigger to the smaller buffer. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-15tools/env: ensure environment starts at erase block boundaryAndreas Fenkart
56086921 added support for unaligned environments access. U-boot itself does not support this: - env_nand.c fails when using an unaligned offset. It produces an error in nand_erase_opts{drivers/mtd/nand/nand_util.c} - in env_sf/env_flash the unused space at the end is preserved, but not in the beginning. block alignment is assumed - env_sata/env_mmc aligns offset/length to the block size of the underlying device. data is silently redirected to the beginning of a block There is seems no use case for unaligned environment. If there is some useful data at the beginning of the the block (e.g. end of u-boot) that would be very unsafe. If the redundant environments are hosted by the same erase block then that invalidates the idea of double buffering. It might be that unaligned access was allowed in the past, and that people with legacy u-boot are trapped. But at the time of 56086921 it wasn't supported and due to reasons above I guess it was never introduced. I prefer to remove that (unused) feature in favor of simplicity Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com> Acked-by: Stefan Agner <stefan.agner@toradex.com>
2016-08-06mkimage: Fix argument parsing with signature commentKarl Beldan
Inform getopt that '-c' requires a parameter. Fixes: a02221f29deb ("mkimage: Convert to use getopt()") Signed-off-by: Karl Beldan <kbeldan@baylibre.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-05tools: moveconfig: support CONFIG_SYS_EXTRA_OPTIONS cleaningMasahiro Yamada
We mostly move config options from board header files to Kconfig, but sometimes config defines come from CONFIG_SYS_EXTRA_OPTIONS. Historically, CONFIG_SYS_EXTRA_OPTIONS originates in boards.cfg, which was used as a central database of configuration prior to the Kconfig conversion. Now, we want to migrate to primary entries in Kconfig rather than option list in CONFIG_SYS_EXTRA_OPTIONS, so it should be helpful to have the tool to cleanup CONFIG_SYS_EXTRA_OPTIONS automatically. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-05tools: moveconfig: make getting all defconfigs into helper functionMasahiro Yamada
I want to reuse this routine in the next commit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-05tools: moveconfig: fix cleanup of defines across multiple linesMasahiro Yamada
Correct the clean-up of such defines that continue across multiple lines, like follows: #define CONFIG_FOO "this continues to the next line " \ "this line should be removed too" \ "this line should be removed as well" Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-05tools: moveconfig: show diffs of cleaned headers in colorMasahiro Yamada
Show code diff in color if --color option is given. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-05tools: moveconfig: show result of header cleaning in unified diffMasahiro Yamada
The header cleanup feature of this tool now removes empty ifdef's, successive blank lines as well as moved option defines. So, we want to see a little more context to check which lines were deleted. It is true that we can see it by "git diff", but it would not work in the --dry-run mode. So, here, this commit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-08-05tools: moveconfig: trim garbage lines after header cleanupsMasahiro Yamada
The tools/moveconfig.py has a feature to cleanup #define/#undef's of moved config options, but I want this tool to do a better job. For example, when we are moving CONFIG_FOO and its define is surrounded by #ifdef ... #endif, like follows: #ifdef CONFIG_BAR # define CONFIG_FOO #endif The header cleanup will leave empty #ifdef ... #endif: #ifdef CONFIG_BAR #endif Likewise, if a define line between two blank lines <blank line> #define CONFIG_FOO <blank lines. ... is deleted, the result of the clean-up will be successive empty lines, which is a coding-style violation. It is tedious to remove left-over garbage lines manually, so I want the tool to take care of this. The tool's job is still not perfect, so we should check the output of the tool, but I hope our life will be much easier with this patch. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-08-05tools: moveconfig: do not check clean tree and compilers for -H optionMasahiro Yamada
The clean tree (make mrproper) and compilers are required when moving config options, but not needed when we only cleanup headers. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-05tools: moveconfig: do not cleanup headers in include/generatedMasahiro Yamada
The files in include/generated are generated during build and removed by "make mrproper", so it has no point to touch them by this tool. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-01buildman: Add a quick-start noteSimon Glass
For those who just want to build a board, it is useful to see a quick hint right at the start of the documentation. Add a few commands showing how to download toolchains and build a board. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-08-01buildman: Avoid overwriting existing toolchain entriesSimon Glass
The current code for setting up the toolchain config always writes the new paths to an item called 'toolchain'. This means that it will overwrite any existing toolchain item with the same name. In practice, this means that: buildman --fetch-arch all will fetch all toolchains, but only the path of the final one will be added to the config. This normally works out OK, since most toolchains are the same version (e.g. gcc 4.9) and will be found on the same path. But it is not correct and toolchains for archs which don't use the same version will not function as expected. Adjust the code to use a complete glob of the toolchain path. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-01buildman: Drop the toolchain error when downloading toolchainsSimon Glass
It doesn't make sense to complain about missing toolchains when the --fetch-arch option is being used. The user is presumably aware that there is a toolchain problem and is actively correcting it by running with this option. Refactor the code to avoid printing this confusing message. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-08-01buildman: Fix a typo in TestSettingsHasPath()Simon Glass
The function comment should say 'buildman'. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-01buildman: Improve the toolchain progress/error outputSimon Glass
Use colour to make it easier to see what is going on. Also print a message before downloading a new toolchain. Mention --fetch-arch in the message that is shown when there are no available toolchains, since this is the quickest way to resolve the problem. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-01buildman: Allow the toolchain error to be suppressedSimon Glass
When there are no toolchains a warning is printed. But in some cases this is confusing, such as when the user is fetching new toolchains. Adjust the function to supress the warning in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-08-01buildman: Fix the 'help' test to use the correct pathSimon Glass
When buildman is run via a symlink, this test fails. Fix it to work the same way as buildman itself. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-08-01buildman: Automatically create a config file if neededSimon Glass
If there is no ~/.buildman file, buildman currently complains and exists. To make things a little more friendly, create an empty one automatically. This will not allow things to be built, but --fetch-arch can be used to handle that. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>