aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2017-09-07tools: .gitignore: Add libfdt related filesBin Meng
Some files are generated during libfdt build. Ignore them. This was wrongly put in the .gitignore in the root directory before. Now let's remove entries there and put them in the right place. Fixes: 34e2c285 ("gitignore: add intermediates from libfdt build") Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-07tools: .gitignore: Sort in alphabetical orderBin Meng
These are currently out of alphabetical order. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-05env: Add 'envtools' target to 'make help'Simon Glass
The target is not currently mentioned anywhere. Add it to the help so people can find it. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-09-05env: Fix operation of 'make environ'Simon Glass
This was broken by the recent environment refactoring. Specifically: $ make environ scripts/Makefile.build:59: tools/environ/Makefile: No such file or directory make[1]: *** No rule to make target 'tools/environ/Makefile'. Stop. make: *** [Makefile:1469: environ] Error 2 Fix this by updating the Makefile and adjusting the #include filesnames in two C files. Fixes: ec74f5f (Makefile: Rename 'env' target to 'environ') Reported-by: Måns Rullgård <mans@mansr.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-09-05env: Fix out of tree building of tools-allTom Rini
With the move of environment code from common/ to env/ a number of changes needed to be made to various make targets. We missed updating some of the files required for out of tree builds of the tools. Correct the 'environ' target to know that we need to work under tools/env/ still (not tools/environ/) and then update the wrappers in env_attr.c and env_flags.c to point to the new correct file. Reported-by: Peter Robinson <pbrobinson@gmail.com> Tested-by: Peter Robinson <pbrobinson@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2017-09-03Makefile: Suppress output of python libfdt build commandBin Meng
This should not be printed by default. Prefix it with $(Q). Fixes ee95d10b: ("fdt: Build the new python libfdt module") Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-03Makefile: Quiesce libfdt buildBin Meng
Since commit 3809e302 "Makefile: honor PYTHON configuration properly", the build commands of libfdt are printed while previously were not. This adds the missing '--quiet' back. Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
2017-09-03fix: fw_env: Prevent writing error message on special files, which don't ↵Lukasz Majewski
support fsync According to fsync specification [1] some special files (e.g., a pipe, FIFO, or socket) don't support synchronization and return either EROFS or EINVAL. On the linux side the sys_fsync -> do_fsync() checks if the requested file has f_op->fsync defined. If not it returns EINVAL [2]. This commit prevents writing error messages for files (devices), which do not support fsync(). [1] - http://man7.org/linux/man-pages/man2/fsync.2.html [2] - http://elixir.free-electrons.com/linux/v4.13-rc6/source/fs/sync.c#L183 Signed-off-by: Lukasz Majewski <lukma@denx.de> Acked-by: Michael Heimpold <mhei@heimpold.de>
2017-08-23imx: move imximage header to common locationStefan Agner
Move the imximage.h header file to a common location so we can make use of it from U-Boot too. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Łukasz Majewski <lukma@denx.de>
2017-08-20Fix 'notes' typosAnatolij Gustschin
s/notes/nodes Signed-off-by: Anatolij Gustschin <agust@denx.de>
2017-08-20Makefile: honor PYTHON configuration properlyClément Bœsch
On some systems `python` is `python3` (for instance, Archlinux). The `PYTHON` variable can be used to point to `python2` to have a successful build. The use of `PYTHON` is currently limited in the Makefile and needs to be extended in other places: First, pylibfdt is required to be a Python 2 binding (binman imports pylibfdt and is only compatible Python 2), so its setup.py needs to be called accordingly. An alternative would be to change the libfdt setup.py shebang to python2, but the binding is actually portable. Also, it would break on system where there is no such thing as `python2`. Secondly, the libfdt import checks need to be done against Python 2 as well since the Python 2 compiled modules (in this case _libdft.so) can not be imported from Python 3. Note on the libfdt imports: "@if ! PYTHONPATH=tools $(PYTHON) -c 'import libfdt'; then..." is probably simpler than the currently sub-optimal pipe. Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
2017-08-16env: Rename setenv() to env_set()Simon Glass
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-15Move environment files from common/ to env/Simon Glass
About a quarter of the files in common/ relate to the environment. It seems better to put these into their own subdirectory and remove the prefix. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-13rockchip: rk3368: mkimage: add support for the RK3368Philipp Tomsich
This commit adds support for RK3368 SoC in mkimage. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-07-25mips-relocs: Fix warning from gcc 6.3Paul Burton
It seems that gcc 6.3 at least is smart enough to warn about the _val variable being unassigned in the default case in the set_hdr_field() macro, but not smart enough to figure out that the default case is never taken. This results in warnings such as the following: pfx##hdr32[idx].field = _val; \ ^ ../tools/mips-relocs.c:51:11: note: _val was declared here uint64_t _val; \ ^ ../tools/mips-relocs.c:88:2: note: in expansion of macro set_hdr_field set_hdr_field(p, idx, field, val) ^~~~~~~~~~~~~ ../tools/mips-relocs.c:408:3: note: in expansion of macro set_phdr_field set_phdr_field(i, p_filesz, load_sz); ^~~~~~~~~~~~~~ ../tools/mips-relocs.c: In function main: ../tools/mips-relocs.c:77:25: warning: _val may be used uninitialized in this function [-Wmaybe-uninitialized] Avoid this by assigning _val = 0 in the default case, and asserting that we didn't actually hit it for good measure. For reference gcc 7.1.1 seems to be smart enough to not hit the above warning without this patch. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Fixes: 011dd93ca97a ("MIPS: Stop building position independent code") Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Tom Rini <trini@konsulko.com> Cc: u-boot@lists.denx.de
2017-07-25MIPS: Stop building position independent codePaul Burton
U-Boot has up until now built with -fpic for the MIPS architecture, producing position independent code which uses indirection through a global offset table, making relocation fairly straightforward as it simply involves patching up GOT entries. Using -fpic does however have some downsides. The biggest of these is that generated code is bloated in various ways. For example, function calls are indirected through the GOT & the t9 register: 8f998064 lw t9,-32668(gp) 0320f809 jalr t9 Without -fpic the call is simply: 0f803f01 jal be00fc04 <puts> This is more compact & faster (due to the lack of the load & the dependency the jump has on its result). It is also easier to read & debug because the disassembly shows what function is being called, rather than just an offset from gp which would then have to be looked up in the ELF to discover the target function. Another disadvantage of -fpic is that each function begins with a sequence to calculate the value of the gp register, for example: 3c1c0004 lui gp,0x4 279c3384 addiu gp,gp,13188 0399e021 addu gp,gp,t9 Without using -fpic this sequence no longer appears at the start of each function, reducing code size considerably. This patch switches U-Boot from building with -fpic to building with -fno-pic, in order to gain the benefits described above. The cost of this is an extra step during the build process to extract relocation data from the ELF & write it into a new .rel section in a compact format, plus the added complexity of dealing with multiple types of relocation rather than the single type that applied to the GOT. The benefit is smaller, cleaner, more debuggable code. The relocate_code() function is reimplemented in C to handle the new relocation scheme, which also makes it easier to read & debug. Taking maltael_defconfig as an example the size of u-boot.bin built using the Codescape MIPS 2016.05-06 toolchain (gcc 4.9.2, binutils 2.24.90) shrinks from 254KiB to 224KiB. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: u-boot@lists.denx.de Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Tested-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2017-07-22RFC: moveconfig: Use toolchains from buildmanSimon Glass
It is annoying to have to set up and maintain two sets of toolchains, one for buildman and one for moveconfig. Adjust moveconfig to make use to buildman's toolchains. This should make things easier. One missing feature is the ability to specify the toolchain on the command line with a special environment variable, e.g. CROSS_COMPILE_ARM. I'm not sure if that is useful, but if it is it could be implemented in buildman. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-07-22moveconfig: Tidy up imply flag parsingSimon Glass
Add an option to specify 'all' to enable all flags. Also print an error if an unrecognised flag is used. At present it just prints usage information which is not very helpful. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-22dtc: mkimage: Add the possibility to specify DTCEmmanuel Vadot
FreeBSD recently switch to it's BSDL dtc. While it support most of the features of the GPL one it still lacks the incbin directive. Add the possibility to specify which dtc we want to use for compiling dts and generating fit image. Signed-off-by: Emmanuel Vadot <manu@bidouilliste.com> Acked-by: Simon Glass <sjg@chromium.org>
2017-07-22tools/fw_env: use fsync to ensure that data is physically storedMichael Heimpold
Closing a file descriptor does not guarantee that the data has been successfully saved to disk, as the kernel might defer the write. Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2017-07-18Merge branch 'master' of git://www.denx.de/git/u-boot-imxTom Rini
2017-07-12imx: reorganize IMX code as other SOCsStefano Babic
Change is consistent with other SOCs and it is in preparation for adding SOMs. SOC's related files are moved from cpu/ to mach-imx/<SOC>. This change is also coherent with the structure in kernel. Signed-off-by: Stefano Babic <sbabic@denx.de> CC: Fabio Estevam <fabio.estevam@nxp.com> CC: Akshay Bhat <akshaybhat@timesys.com> CC: Ken Lin <Ken.Lin@advantech.com.tw> CC: Marek Vasut <marek.vasut@gmail.com> CC: Heiko Schocher <hs@denx.de> CC: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com> CC: Christian Gmeiner <christian.gmeiner@gmail.com> CC: Stefan Roese <sr@denx.de> CC: Patrick Bruenn <p.bruenn@beckhoff.com> CC: Troy Kisky <troy.kisky@boundarydevices.com> CC: Nikita Kiryanov <nikita@compulab.co.il> CC: Otavio Salvador <otavio@ossystems.com.br> CC: "Eric Bénard" <eric@eukrea.com> CC: Jagan Teki <jagan@amarulasolutions.com> CC: Ye Li <ye.li@nxp.com> CC: Peng Fan <peng.fan@nxp.com> CC: Adrian Alonso <adrian.alonso@nxp.com> CC: Alison Wang <b18965@freescale.com> CC: Tim Harvey <tharvey@gateworks.com> CC: Martin Donnelly <martin.donnelly@ge.com> CC: Marcin Niestroj <m.niestroj@grinn-global.com> CC: Lukasz Majewski <lukma@denx.de> CC: Adam Ford <aford173@gmail.com> CC: "Albert ARIBAUD (3ADEV)" <albert.aribaud@3adev.fr> CC: Boris Brezillon <boris.brezillon@free-electrons.com> CC: Soeren Moch <smoch@web.de> CC: Richard Hu <richard.hu@technexion.com> CC: Wig Cheng <wig.cheng@technexion.com> CC: Vanessa Maegima <vanessa.maegima@nxp.com> CC: Max Krummenacher <max.krummenacher@toradex.com> CC: Stefan Agner <stefan.agner@toradex.com> CC: Markus Niebel <Markus.Niebel@tq-group.com> CC: Breno Lima <breno.lima@nxp.com> CC: Francesco Montefoschi <francesco.montefoschi@udoo.org> CC: Jaehoon Chung <jh80.chung@samsung.com> CC: Scott Wood <oss@buserror.net> CC: Joe Hershberger <joe.hershberger@ni.com> CC: Anatolij Gustschin <agust@denx.de> CC: Simon Glass <sjg@chromium.org> CC: "Andrew F. Davis" <afd@ti.com> CC: "Łukasz Majewski" <l.majewski@samsung.com> CC: Patrice Chotard <patrice.chotard@st.com> CC: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> CC: Hans de Goede <hdegoede@redhat.com> CC: Masahiro Yamada <yamada.masahiro@socionext.com> CC: Stephen Warren <swarren@nvidia.com> CC: Andre Przywara <andre.przywara@arm.com> CC: "Álvaro Fernández Rojas" <noltari@gmail.com> CC: York Sun <york.sun@nxp.com> CC: Xiaoliang Yang <xiaoliang.yang@nxp.com> CC: Chen-Yu Tsai <wens@csie.org> CC: George McCollister <george.mccollister@gmail.com> CC: Sven Ebenfeld <sven.ebenfeld@gmail.com> CC: Filip Brozovic <fbrozovic@gmail.com> CC: Petr Kulhavy <brain@jikos.cz> CC: Eric Nelson <eric@nelint.com> CC: Bai Ping <ping.bai@nxp.com> CC: Anson Huang <Anson.Huang@nxp.com> CC: Sanchayan Maity <maitysanchayan@gmail.com> CC: Lokesh Vutla <lokeshvutla@ti.com> CC: Patrick Delaunay <patrick.delaunay@st.com> CC: Gary Bisson <gary.bisson@boundarydevices.com> CC: Alexander Graf <agraf@suse.de> CC: u-boot@lists.denx.de Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-07-12tools/kwbimage: fix v1 header verificationBaruch Siach
The verify_header callback in kwbimage.c only verifies v0 headers checksum. Running 'mkimage -l' on a v1 image gives the following misleading output: GP Header: Size ae000000 LoadAddr 34160600 Implement support for v1 headers. For that, factor out the header checksum code to a separate main_hdr_checksum_ok() routine. This routine relies on the fact that the checksum field offset is the same in both v0 and v1 headers. With this patch applied 'mkimage -l' correctly identifies the image: Image Type: MVEBU Boot from sdio Image Image version:1 Data Size: 398904 Bytes = 389.55 KiB = 0.38 MiB Load Address: 007fffc0 Entry Point: 00800000 Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
2017-07-12tools/kwbimage.h: make offset marks style consistentBaruch Siach
The offset marking in kwbimage.h is inconsistent. main_hdr_v0 uses decimals, main_hdr_v1 uses hex without '0x' prefix, secure_hdr_v1 uses hex with '0x' prefix. Make all offset marks hex with '0x' prefix. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
2017-07-12tools/kwbimage: update the list of SoCs using v1 headerBaruch Siach
Armada 38x also uses image header v1. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Stefan Roese <sr@denx.de>
2017-07-11Merge git://git.denx.de/u-boot-dmTom Rini
2017-07-11binman: Put our local modules ahead of system modulesSimon Glass
If a system module is named the same as one of those used by binman we currently pick the system module. Adjust the ordering so that our modules are chosen instead. The module conflict reported was 'tools' from jira-python. I cannot access that package to test it. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Kevin Hilman <khilman@baylibre.com> Acked-by: Kevin Hilman <khilman@baylibre.com>
2017-07-11dtoc: Add testsSimon Glass
Add some tests of dtoc's functionality to make it easier to expand and enhance the tool. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Add a comment about string replace in conv_name_to_c()Simon Glass
This function uses several separate string replaces where a regular expression might seem more reasonable. Add a comment justifying the way it is currently done. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Move the main logic into the dtb_platdata fileSimon Glass
Collect the main logic of dtoc into a function and put it into dtb_platdata. This will allow tests to use this function instead of duplicating the code themselves. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Move static functions out of the classSimon Glass
Rather than using static functions within the class, move them out of the class. This will make it slightly easier for tests to call them. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Pass include_disabled explicitlySimon Glass
This option is the only one actually used by the dtb_platdata class. Pass it explicitly to avoid needing to pass the whole option object to the constructor. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Don't handle properties with / in themSimon Glass
This conversion appears to not be needed as it does not occur in practice. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Fix pylint warningsSimon Glass
Unfortunately I neglected to run pylint on this tool with its initial submission. Fix the warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Split out the main class into its own fileSimon Glass
To simplify running tests we should move this class into its own file. This allows the tests to import it without having to import dtoc.py, which runs the tests. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Add a comment at the topSimon Glass
Add a description of the dtoc tool at the top of the file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Use self._options instead of the global optionsSimon Glass
This class should use the options object passed to it rather than finding the global one. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Allow automatic location and adding of 'imply'Simon Glass
By using a Kconfig parser we can find the location of each option in the Kconfig tree. Using the information from the database we can then automatically add an 'imply' option into the right place if requested by the user. Add a -a option to support adding 'imply' options. Display the location of any existing 'imply' option so that progress can be examined. Add a -A option to hide any existing 'imply' options so that already-completed additions need not be considered further. Also add documentation for this feature. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Allow control of which implying configs are shownSimon Glass
Sometimes it is useful to display CONFIG_TARGET or CONFIG_CMD configs. Add an option to control this. Also we generally ignore implying configs which affect fewer than 5 boards. But sometimes it is useful to show those those, so add an option that reduces the minimum to two. ERRATUM configs are never useful for implying things, so ignore those. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Allow piping in 'git show --stat' outputSimon Glass
It is useful to be able to process only a subset of boards to save time. Often that subset is defined by the defconfig files in a git commit. This change allows things like: # Build the database ./tools.moveconfig.py -b # Find some implying configs ./tools/moveconfig.py -i CONFIG_X # Add some 'imply' statements to Kconfig files ./tools/moveconfig.py -i CONFIG_X -a CONFIG_A,CONFIG_B # Reprocess the defconfig files to see if we can drop some changes git show --stat | ./tools/moveconfig.py -s -d - # Update the commit, with fewer defconfig changes gii commit -au Where the commit contains defconfig files, this will reprocess them to take account of the imply statements that you added. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11dtoc: Support multiple compatible strings in a nodeSimon Glass
Sometimes a node will have multiple compatible strings. Drivers may use one or the other so the best approach seems to be to #define them to be equivalent. Update dtoc to support this. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Kever Yang <kever.yang@rock-chips.com>
2017-07-11moveconfig: Support looking for implied CONFIG optionsSimon Glass
Some CONFIG options can be implied by others and this can help to reduce the size of the defconfig files. For example, CONFIG_X86 implies CONFIG_CMD_IRQ, so we can put 'imply CMD_IRQ' under 'config X86' and all x86 boards will have that option, avoiding adding CONFIG_CMD_IRQ to each of the x86 defconfig files. Add a -i option which searches for such options. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2017-07-11moveconfig: Support building a simple config databaseSimon Glass
Add a -b option which scans all the defconfigs and builds a database of all the CONFIG options used by each. This is useful for querying later. At present this only works with the separate -b option, which does not move any configs. It would be possible to adjust the script to build the database automatically when moving configs, but this might not be useful as the database does not change that often. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Add a constant for auto.confSimon Glass
This filename is used a few times. Move it to a constant before adding further uses. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Tidy up the documentation and add hintsSimon Glass
The newest clean-up features are not mentioned in the docs. Fix this and add a few hints for particular workflows that are hopefully helpful. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Allow reading the defconfig list from stdinSimon Glass
Support passes in a defconfig filename of '-' to read the list from stdin instead of from a file. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11moveconfig: Support providing a path to the defconfig filesSimon Glass
It is convenient to provide the full patch to the defconfig files in some situations, e.g. when the file was generated by a shell command (e.g. 'ls configs/zynq*'). Add support for this, and move the globbing code into a function with its own documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2017-07-11rockchip: mkimage: add support for rk322x socKever Yang
Add support for rk322x package header in mkimage tool. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-07-06avr32: Retire AVR32 for goodAndy Shevchenko
AVR32 is gone. It's already more than two years for no support in Buildroot, even longer there is no support in GCC (last version is heavily patched 4.2.4). Linux kernel v4.12 got rid of it (and v4.11 didn't build successfully). There is no good point to keep this support in U-Boot either. Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2017-07-06mkimage: fix display of image types listBaruch Siach
Since commit 5b9d44df2307f (mkimage: Display a better list of available image types) mkimage usage text suggest to "use -T to see a list of available image types". Unfortunately, commit 02221f29deb8 (mkimage: Convert to use getopt()) broke that feature, because getopt() fails when -T has no option argument. Add a pseudo image type name 'list' that lists all image types. Update the usage text accordingly. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Baruch Siach <baruch@tkos.co.il>