summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeLines
* 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>
* buildman: Add a quick-start noteSimon Glass2016-07-31-0/+14
| | | | | | | | 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>
* buildman: Avoid overwriting existing toolchain entriesSimon Glass2016-07-31-2/+1
| | | | | | | | | | | | | | | | | | | 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>
* buildman: Drop the toolchain error when downloading toolchainsSimon Glass2016-07-31-7/+10
| | | | | | | | | | | 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>
* buildman: Fix a typo in TestSettingsHasPath()Simon Glass2016-07-31-1/+1
| | | | | | | The function comment should say 'buildman'. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* buildman: Improve the toolchain progress/error outputSimon Glass2016-07-31-12/+21
| | | | | | | | | | 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>
* buildman: Allow the toolchain error to be suppressedSimon Glass2016-07-31-6/+14
| | | | | | | | | 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>
* buildman: Fix the 'help' test to use the correct pathSimon Glass2016-07-31-1/+1
| | | | | | | 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>
* buildman: Automatically create a config file if neededSimon Glass2016-07-31-0/+44
| | | | | | | | | | 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>
* buildman: Tidy up the README a littleSimon Glass2016-07-31-23/+30
| | | | | | | Tidy up some problems found by a recent review. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* Merge branch 'master' of git://git.denx.de/u-boot-i2cTom Rini2016-07-26-7/+10
|\
| * tools: env: Fix format warnings in debugMarcin Niestroj2016-07-26-7/+10
| | | | | | | | | | | | | | | | | | | | Format warnings (-Wformat) were shown in printf() calls after defining DEBUG macro. Update format string and explicitly cast variables to suppress all warnings. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
* | mkimage: rockchip: add suport for rk33 serialKever Yang2016-07-25-1/+1
| | | | | | | | | | | | | | Add support for rockchip rk33 series Soc like rk3368 and rk3399 Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
* | mkimage: rockchip: add suport for rk33 serialKever Yang2016-07-25-0/+1
|/ | | | | | | Add support for rockchip rk33 series Soc like rk3368 and rk3399 Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
* dtoc: Correct the type widening code in fdt_fallbackSimon Glass2016-07-25-0/+6
| | | | | | | | | | | | | This code does not match the fdt version in fdt.py. When dtoc is unable to use the Python libfdt library, it uses the fallback version, which does not widen arrays correctly. Fix this to avoid a warning 'excess elements in array initialize' in dt-platdata.c which happens on some platforms. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com>
* tools, rsa: Further minor cleanups on top of c236ebd and 2b9ec7mario.six@gdsys.cc2016-07-25-3/+8
| | | | | | | | | | | | | | | [NOTE: I took v1 of these patches in, and then v2 came out, this commit is squashing the minor deltas from v1 -> v2 of updates to c236ebd and 2b9ec76 into this commit - trini] - Added an additional NULL check, as suggested by Simon Glass to fit_image_process_sig - Re-formatted the comment blocks Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org> [For merging the chnages from v2 back onto v1] Signed-off-by: Tom Rini <trini@konsulko.com>
* tools: Fix return code of fit_image_process_sig()mario.six@gdsys.cc2016-07-22-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | When signing images, we repeatedly call fit_add_file_data() with successively increasing size values to include the keys in the DTB. Unfortunately, if large keys are used (such as 4096 bit RSA keys), this process fails sometimes, and mkimage needs to be called repeatedly to integrate the keys into the DTB. This is because fit_add_file_data actually returns the wrong error code, and the loop terminates prematurely, instead of trying again with a larger size value. This patch corrects the return value and also removes a error message, which is misleading, since we actually allow the function to fail. A (hopefully helpful) comment is also added to explain the lack of error message. This is probably related to 1152a05 ("tools: Correct error handling in fit_image_process_hash()") and the corresponding error reported here: https://www.mail-archive.com/u-boot@lists.denx.de/msg217417.html Signed-off-by: Mario Six <mario.six@gdsys.cc>
* tools/env: reuse fw_getenv in fw_printenv functionAndreas Fenkart2016-07-22-27/+17
| | | | | | | | | | Try to avoid adhoc iteration of the environment. Reuse fw_getenv to find the variables that should be printed. Only use open-coded iteration when printing all variables. For backwards compatibility, keep emitting a newline when printing with value_only. Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools/env: move envmatch further up in file to avoid forward declarationsAndreas Fenkart2016-07-22-20/+18
| | | | | | | forward declaration not needed when re-ordered Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools/env: kernel-doc for fw_printenv, fw_getenv and fw_parse_scriptAndreas Fenkart2016-07-22-2/+115
| | | | | | | | | | | | | | | there are two groups of functions: - application ready tools: fw_setenv/fw_getenv/fw_parse_script these are used, when creating a single binary containing multiple tools (busybox like) - file access like: open/read/write/close above functions are implemented on top of these. applications can use those to modify several variables without creating a temporary batch script file tested with "./scripts/kernel-doc -html -v tools/env/fw_env.h" Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Andreas Fenkart <andreas.fenkart@digitalstrom.com>
* tools/env: allow negative offsetsStefan Agner2016-07-22-9/+35
| | | | | | | | | | A negative value for the offset is treated as a backwards offset for from the end of the device/partition for block devices. This aligns the behavior of the config file with the syntax of CONFIG_ENV_OFFSET where the functionality has been introduced with commit 5c088ee841f9 ("env_mmc: allow negative CONFIG_ENV_OFFSET"). Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
* tools/env: complete environment device config earlyStefan Agner2016-07-22-50/+60
| | | | | | | | | | | | | | | Currently flash_read completes a crucial part of the environment device configuration, the device type (mtd_type). This is rather confusing as flash_io calls flash_read conditionally, and one might think flash_write, which also makes use of mtd_type, gets called before flash_read. But since flash_io is always called with O_RDONLY first, this is not actually the case in reality. However, it is much cleaner to complete and verify the config early in parse_config. This also prepares the code for further extension. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Andreas Fenkart
* Various, unrelated tree-wide typo fixes.Robert P. J. Day2016-07-16-1/+1
| | | | | | | | | | | | | | | | | | | Fix a number of typos, including: * "compatble" -> "compatible" * "eanbeld" -> "enabled" * "envrionment" -> "environment" * "FTD" -> "FDT" (for "flattened device tree") * "ommitted" -> "omitted" * "overriden" -> "overridden" * "partiton" -> "partition" * "propogate" -> "propagate" * "resourse" -> "resource" * "rest in piece" -> "rest in peace" * "suport" -> "support" * "varible" -> "variable" Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
* Merge git://git.denx.de/u-boot-dmTom Rini2016-07-15-0/+883
|\
| * dm: core: Expand platdata for of-platdata devicesSimon Glass2016-07-14-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Devices which use of-platdata have their own platdata. However, in many cases the driver will have its own auto-alloced platdata, for use with the device tree. The ofdata_to_platdata() method converts the device tree settings to platdata. With of-platdata we would not normally allocate the platdata since it is provided by the U_BOOT_DEVICE() declaration. However this is inconvenient since the of-platdata struct is closely tied to the device tree properties. It is unlikely to exactly match the platdata needed by the driver. In fact a useful approach is to declare platdata in the driver like this: struct r3288_mmc_platdata { struct dtd_rockchip_rk3288_dw_mshc of_platdata; /* the 'normal' fields go here */ }; In this case we have dt_platadata available, but the normal fields are not present, since ofdata_to_platdata() is never called. In fact driver model doesn't allocate any space for the 'normal' fields, since it sees that there is already platform data attached to the device. To make this easier, adjust driver model to allocate the full size of the struct (i.e. platdata_auto_alloc_size from the driver) and copy in the of-platdata. This means that when the driver's bind() method is called, the of-platdata will be present, followed by zero bytes for the empty 'normal field' portion. A new DM_FLAG_OF_PLATDATA flag is available that indicates that the platdata came from of-platdata. When the allocation/copy happens, the DM_FLAG_ALLOC_PDATA flag will be set as well. The dtoc tool is updated to output the platdata_size field, since U-Boot has no other way of knowing the size of the of-platdata struct. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dtoc: Ignore the u-boot, dm-pre-reloc propertySimon Glass2016-07-14-0/+1
| | | | | | | | | | | | This property is not useful for of-platdata, so omit it. Signed-off-by: Simon Glass <sjg@chromium.org>
| * Only build the libfdt python module if 'swig' is availableSimon Glass2016-07-14-1/+4
| | | | | | | | | | | | | | When swig is not available, we can still build correctly. So make this optional. Add a comment about how to enable this build. Signed-off-by: Simon Glass <sjg@chromium.org>
| * dm: Add a more efficient libfdt librarySimon Glass2016-07-14-0/+191
| | | | | | | | | | | | | | | | Add a Python version of the libfdt library which contains enough features to support the dtoc tool. This is only a very bare-bones implementation. It requires the 'swig' to build. Signed-off-by: Simon Glass <sjg@chromium.org>