summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeLines
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2016-10-08-0/+165
|\
| * tools: mkimage: add support for Vybrid image formatAlbert ARIBAUD \(3ADEV\)2016-10-06-0/+165
| | | | | | | | | | | | | | This format can be flashed directly at address 0 of the NAND FLASH, as it contains all necessary headers. Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
* | env: tool: add command line option to input lockfile pathB, Ravi2016-10-08-6/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default lockname is set to /var/lock. This limits the usage of this application where OS uses different lockfile location parameter. For example, In case of android, the default lock path location is /data. Hence by providing the command line option to input lockfile path will be useful to reuse the tool across multiple operating system. usage: ./fw_printenv -l <lockfile path> Signed-off-by: Ravi Babu <ravibabu@ti.com>
* | Various, accumulated typos collected from around the tree.Robert P. J. Day2016-10-06-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix various misspellings of: * deprecated * partition * preceding,preceded * preparation * its versus it's * export * existing * scenario * redundant * remaining * value * architecture Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Reviewed-by: Jagan Teki <jteki@openedev.com> Reviewed-by: Stefan Roese <sr@denx.de>
* | Suspected Spam: Do not open attachements![PATCH 4/6] tools/env: ↵Andreas Fenkart2016-10-06-7/+8
| | | | | | | | | | | | | | | | | | | | | | flash_write_buf: enforce offset to be start of environment This allows to take advantage of the environment being block aligned. This is not a new constraint. Writes always start at the begin of the environment, since the header with CRC/length as there. Every environment modification requires updating the header Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools/env: lookup dev_type directly from flash_read_buf/flash_write_bufAndreas Fenkart2016-10-06-15/+13
| | | | | | | | | | | | | | | | flash_write_buf already looks up size/offset/#sector from struct envdev_s. It can look up mtd_type as well. Same applies to flash_read_buf. Makes the interface simpler Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools/env: pass bad block offset by valueAndreas Fenkart2016-10-06-5/+5
| | | | | | | | | | | | | | | | | | the offset is not modified by linux ioctl call see mtd_ioctl{drivers/mtd/mtdchar.c} Makes the interface less ambiguous, since the caller can now exclude a modification of blockstart Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* | tools/env: factor out environment_end functionAndreas Fenkart2016-10-06-17/+15
|/ | | | | | | instead of adhoc computation of the environment end, use a function with a proper name Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* dtoc: Add methods for reading data from propertiesSimon Glass2016-09-18-0/+25
| | | | | | | Provide easy helpers for reading integer, string and boolean values from device-tree properties. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Correct quotes in fdt_utilSimon Glass2016-09-18-1/+1
| | | | | | | The style is to use single quotes for strings where possible. Adjust this function. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Support finding the offset of a propertySimon Glass2016-09-18-0/+29
| | | | | | | | 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>
* dtoc: Support packing the device treeSimon Glass2016-09-18-0/+27
| | | | | | | | | | 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>
* dtoc: Support deleting device tree propertiesSimon Glass2016-09-18-0/+43
| | | | | | | | 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>
* dtoc: Move to using bytearraySimon Glass2016-09-18-1/+1
| | | | | | | | 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>
* dtoc: Prepare for supporting changing of device treesSimon Glass2016-09-18-4/+42
| | | | | | | | 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>
* dtoc: Drop the convert_dash parameter to GetProps()Simon Glass2016-09-18-4/+1
| | | | | | This is not used anywhere in dtoc, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* dtoc: Allow the device tree to be compiled from sourceSimon Glass2016-09-18-2/+48
| | | | | | | | 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>
* patman: Add a library to handle logging and progressSimon Glass2016-09-18-0/+166
| | | | | | | | | | | 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>
* patman: Add a tools library for using temporary filesSimon Glass2016-09-18-0/+120
| | | | | | | | | 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>
* dtoc: Move a few more common functions into fdt.pySimon Glass2016-09-18-32/+57
| | | | | | | 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>
* dtoc: Move Widen() and GetPhandle() into the base classSimon Glass2016-09-18-83/+41
| | | | | | | | | | | 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>
* dtoc: Move BytesToValue() and GetEmpty() into PropBaseSimon Glass2016-09-18-79/+80
| | | | | | | | | | 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>
* dtoc: Create a base class for FdtSimon Glass2016-09-18-48/+148
| | | | | | | | | | | | | | 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>
* dtoc: Rename fdt.py to fdt_normal.pySimon Glass2016-09-18-1/+1
| | | | | | | 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>
* dtoc: Move the fdt library selection into fdt_selectSimon Glass2016-09-18-15/+26
| | | | | | | | 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>
* dtoc: Move the struct import into the correct orderSimon Glass2016-09-18-2/+1
| | | | | | This should be in with the other system includes. Move it. Signed-off-by: Simon Glass <sjg@chromium.org>
* patman: Adjust command.Output() to raise an error by defaultSimon Glass2016-09-18-5/+8
| | | | | | | | 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>
* moveconfig: Add an option to commit changesSimon Glass2016-09-16-0/+18
| | | | | | | | | | | 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>
* moveconfig: Add an option to skip promptsSimon Glass2016-09-16-14/+23
| | | | | | | | 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>
* Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini2016-09-09-0/+0
|\
| * imx: ventana: enable splashscreen supportTim Harvey2016-09-06-0/+0
| | | | | | | | Signed-off-by: Tim Harvey <tharvey@gateworks.com>
* | tools: moveconfig: add --spl option to move options for SPL buildMasahiro Yamada2016-09-06-3/+30
| | | | | | | | | | | | | | | | | | | | | | 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>
* | tools: moveconfig: warn loudly if moved option has no entry in KconfigMasahiro Yamada2016-09-06-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | tools: moveconfig: use sets instead of lists for failed/suspicious boardsMasahiro Yamada2016-09-06-10/+10
| | | | | | | | | | | | | | 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>
* | tools: moveconfig: remove document about deprecated error messageMasahiro Yamada2016-09-06-4/+0
|/ | | | | | | | 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>
* treewide: fix "followings" to "following"Masahiro Yamada2016-08-26-2/+2
| | | | | | Most of them are my mistakes. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* tools: moveconfig: add Xtensa GCC prefix to CROSS_COMPILE listMasahiro Yamada2016-08-26-1/+2
| | | | | | | | | | 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>
* tools: kwboot: patch destaddr only for SoCs with header version 1Simon Baatz2016-08-26-8/+8
| | | | | | | | | | | | | | | | | 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>
* tools/env: soften warning about erase block alignmentAndreas Fenkart2016-08-20-1/+1
| | | | | | | | | 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>
* tools/env: return with error if redundant environments have unequal sizeAndreas Fenkart2016-08-20-3/+2
| | | | | | | | | | | 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>
* tools/env: ensure environment starts at erase block boundaryAndreas Fenkart2016-08-15-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mkimage: Fix argument parsing with signature commentKarl Beldan2016-08-05-1/+1
| | | | | | | | 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>
* tools: moveconfig: support CONFIG_SYS_EXTRA_OPTIONS cleaningMasahiro Yamada2016-08-05-0/+74
| | | | | | | | | | | | | | | | 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>
* tools: moveconfig: make getting all defconfigs into helper functionMasahiro Yamada2016-08-05-6/+11
| | | | | | | 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>
* tools: moveconfig: fix cleanup of defines across multiple linesMasahiro Yamada2016-08-05-0/+3
| | | | | | | | | | | | 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>
* tools: moveconfig: show diffs of cleaned headers in colorMasahiro Yamada2016-08-05-10/+16
| | | | | | | 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>
* tools: moveconfig: show result of header cleaning in unified diffMasahiro Yamada2016-08-05-5/+25
| | | | | | | | | | | 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>
* tools: moveconfig: trim garbage lines after header cleanupsMasahiro Yamada2016-08-05-4/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tools: moveconfig: do not check clean tree and compilers for -H optionMasahiro Yamada2016-08-05-4/+2
| | | | | | | | 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>
* tools: moveconfig: do not cleanup headers in include/generatedMasahiro Yamada2016-08-05-0/+2
| | | | | | | | 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>