summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2018-07-09dtoc: Add a test for code coverageSimon Glass
Add a -T option to run a code-coverage test on dtoc. At present this is about 96%. Future work will increase it to 100%. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Fix some minor errorsSimon Glass
Fix some comments and a printf string which is incorrect. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Fix properties with a single zero-arg phandleSimon Glass
At present a property with a single phandle looks like an integer value to dtoc. Correct this by adjusting it in the phandle-processing code. Add a test for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Fix Fdt.GetNode() to handle a missing nodeSimon Glass
At present the algortihm is not correct since it will return the root node if the requested node is not found and there are no slashes in the requested node name. Fix this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Keep track of property offsetsSimon Glass
At present the Fdt class does not keep track of property offsets if they change due to removal of properties. Update the code to handle this, and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Update fdt tests to increase code coverageSimon Glass
At present only some of the fdt functionality is tested. Add more tests to cover the rest of it. Also turn on test coverage, which is now 100% with a small exclusion for a Python 3 feature. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Drop use of a local dtb bufferSimon Glass
At present the Fdt class has its own copy of the device tree. This is confusing an unnecessary now that pylibfdt has its own. Drop it and provide access functions to the buffer. This allows us to move the rest of the implementation to use pylibfdt methods instead of directly calling libfdt stubs. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Make use of the new pylibfdt methodsSimon Glass
Now that pylibfdt supports a fuller API we don't need to directly call the libfdt stubs. Update the code to use the Fdt methods instead. Some other cases remain which will be tidied up in a later commit, since they need larger changes. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Update tests to write failures to /tmpSimon Glass
When a test fails due to an output mismatch (e.g. due to a new property being adding to a test file) it is currently hard to update the test to the new output. In particular the tabs in the file are written as \t in the Python tests. To make this easier, write both the expected and actual results to /tmp to allow use of meld, and copying into the test. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09dtoc: Add some tests for the fdt moduleSimon Glass
At present this module is tested via the dtoc tests. This is a bit painful since the tests are at a higher level and so failures are more difficult to diagnose. Add some tests that exercise the fdt module directly. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09binman: Move coverage logic into a new test_util fileSimon Glass
At present only binman has the logic for determining Python test coverage but this is useful for other tools also. Move it out into a separate file so it can be used by other tools. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09libfdt: Bring in proposed pylibfdt changesSimon Glass
This provides various patches sent to the devicetree-compiler mailing list to enhance the Python bindings. A final version of this patch may be created once upstreaming is complete, but if it takes too long, this can act as a placeholder. New pylibfdt features: - Support for most remaining, relevant libfdt functions - Support for sequential-write functions Changes are applied to existing U-Boot tools as needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09binman: Tidy up setting of entry contentsSimon Glass
At present the contents of an entry are set in subclasses simply by assigning to the data and content_size properties. Add some methods to do this, so that we have more control. In particular, add a method to set the contents without changing its size, so we can validate that case. Add a test case for trying to change the size when this is not allowed. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09binman: Tidy up execution of testsSimon Glass
Move all the test execution into the same mechanism so that we can request a particular test (from any suite) by passing it as an argument to 'binman -t'. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09binman: Correct operation of ObtainContents()Simon Glass
This method is supposed to return the contents of an entry. However at present there is no check that it actually does. Also some implementations do not return 'True' to indicate success, as required. Add a check for things working as expected, and correct the implementations. This requires some additional test cases to cover things which were missed originally. Add these at the same time. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09binman: Tidy up variables in _RunMicrocodeTest()Simon Glass
At present we call the three entries first, second and third. Rename them to reflect their contents instead, for clarity. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09binman: Make the operation of Entry__testing explicitSimon Glass
This fake entry is used for testing. At present it only has one behaviour which is to return an invalid set of entry positions, to cause an error. The fake entry will need to be used for other things too. Allow the test .dts file to specify the behaviour of the fake entry, so we can control its behaviour easily. While we are here, drop the ReadContents() method, since this only applies to subclasses of Entry_blob, which Entry__testing is not. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-09binman: Switch to 'python-coverage'Tom Rini
The most portable way to get access to coverage is to invoke it as 'python-coverage'. Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2018-07-01Revert "fw_printenv: Don't bail out directly after one env read error"Tom Rini
As pointed out by Wolfgang Denk, the problem with this fix is that while interactive users will see that we have found one part of the environment failed and are using the other, progmatic use will not see this and can lead to problems. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-06-27fw_printenv: Don't bail out directly after one env read errorJoe Hershberger
When using a redundant environment a read error should simply mean to not use that copy instead of giving up completely. The other copy may be just fine. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
2018-06-23patman: Support using a particular SMTP serverSimon Glass
Some environments require providing the '--smtp-server' argument to 'git send-email'. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-23patman: add test for SPDX licenseChris Packham
Add a test to exercise the check for a valid SPDX license. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-06-23patman: add option for limiting the Cc listChris Packham
Many mailing-lists consider a long Cc list a sign of spam and will either drop the message or mark it for moderation. Because patman automatically invokes get_maintainer.pl the Cc list can expand unexpectedly. Allow the user to specify a limit for the Cc list. This limit is applied after removing any known bouncing addresses. By default no limit is applied. Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-06-19fdtgrep: Separate out checking of two allocationsSimon Glass
The current code might succeed on the first allocation and fail on the second. Separate the checks to avoid this problem. Of course, free() will never fail and the chances that (when allocating two small areas) one will succeed and one will fail are just as remote. But this keeps coverity happy. Reported-by: Coverity (CID: 131226) Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-19fdtgrep: Fix logic of free() in do_fdtgrep()Simon Glass
This loop never actually exits, but the way the code is written this is not obvious. Add an explicit error check. Reported-by: Coverity (CID: 131280) Signed-off-by: Simon Glass <sjg@chromium.org> [trini: Add explicit init of region to NULL per LLVM warning] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-06-13u-boot: Fix several typosShyam Saini
's/environemnt/environment/' and 's/Environemnt/Environment/' Signed-off-by: Shyam Saini <shyam@amarulasolutions.com>
2018-06-13tools: env: Use getline rather than fgets when reading config/scriptAlex Kiernan
When reading the config file, or a script file, use getline rather than fgets so line lengths aren't limited by the size of a compiled in buffer (128 characters for config, 1024 for scripts). Rename 'dump' to 'line' so it's clear we're working with a line of text. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-06-07binman: Mark 'align-end' as implementedSimon Glass
The documentation says this is not implemented, but it is. Update the documentation, and clarify its operation. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Add support for adding a name prefix to entriesSimon Glass
Sometimes we have several sections which repeat the same entries (e.g. for a read-only and read-write version of the same section). It is useful to be able to tell these entries apart by name. Add a new 'name-prefix' property for sections, which causes all entries within that section to have a given name prefix. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Add support for outputing a map fileSimon Glass
It is useful to be able to see a list of regions in each image produced by binman. Add a -m option to output this information in a '.map' file alongside the image file. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Tidy up some docs and commentsSimon Glass
Fix a few missing comments and tidy up some existing ones. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Allow a single test to be executedSimon Glass
Provide an easy way to execute a single binman test by specifying it on the command line. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Add documentation for pos-unset propertySimon Glass
This property is not documented. Add a note to the README. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Add support for sectionsSimon Glass
It is useful to be able to split an image into multiple sections, each with its own size and position, for cases where a flash device has read-only and read-write portions. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Avoid setting sys.path globallySimon Glass
At present we set the Python path at the start of binman so we can read modules in the 'etype' directory. This is a bit messy since it affects 'import' statements through binman. Adjust the code to set the path locally, just where it is needed. Move the 'entry' module in with the other base modules to help with this. It makes more sense here anyway since it does not implement an entry type. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Rename Entry property to 'section'Simon Glass
Entries are now passed a Section object rather than an Image. Rename this property to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Rename ELF parameters to 'section'Simon Glass
We now pass a Section object to these functions rather than an Image. Rename the parameters to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Refactor much of the image code into 'section'Simon Glass
We want to support multiple sections within a single image. To do this, move most of the Image class implementation into a new Section class. An Image contains only a single Section, but at some point we will support a new 'section' entry, thus allowing Sections within Sections. Use the name 'bsection' for the module so we can use 'section' for the etype module. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07binman: Allow unit addresses for binariesSimon Glass
Allow the same binary to appear multiple times in an image by using the device-tree unit-address feature (u-boot@0, u-boot@1). Signed-off-by: Simon Glass <sjg@chromium.org>
2018-06-07buildman: Add support for environment delta in summaryAlex Kiernan
When summarising the builds, add the -U option to emit delta lines for the default environment built into U-Boot at each commit. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-06-07buildman: Extract environment as part of each buildAlex Kiernan
As we're building the boards, extract the default U-Boot environment to uboot.env so we can interrogate it later. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-06-07patman: Fix unit tests for SPDXSimon Glass
The format of this line has changed. Update the patman test to suit. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Alex Kiernan <alex.kiernan@gmail.com>
2018-05-31logos: provide U-Boot logoHeinrich Schuchardt
Provide a logo showing a submarine. U-Boot currently lacks an icon identifying the project. The German word U-Boot translates to submarine. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2018-05-31scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987Rob Herring
This adds the following commits from upstream: aadd0b65c987 checks: centralize printing of property names in failure messages 88960e398907 checks: centralize printing of node path in check_msg f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt. 37dea76e9700 srcpos: drop special handling of tab 65893da4aee0 libfdt: overlay: Add missing license 962a45ca034d Avoid installing pylibfdt when dependencies are missing cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT} 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation e54388015af1 dtc: Bump version to v1.4.6 a1fe86f380cb fdtoverlay: Switch from using alloca to malloc c8d5472de3ff tests: Improve compatibility with other platforms c81d389a10cc checks: add chosen node checks e671852042a7 checks: add aliases node checks d0c44ebe3f42 checks: check for #{size,address}-cells without child nodes 18a3d84bb802 checks: add string list check for *-names properties 8fe94fd6f19f checks: add string list check 6c5730819604 checks: add a string check for 'label' property a384191eba09 checks: fix sound-dai phandle with arg property check b260c4f610c0 Fix ambiguous grammar for devicetree rule fe667e382bac tests: Add some basic tests for the pci_bridge checks 7975f6422260 Fix widespread incorrect use of strneq(), replace with new strprefixeq() fca296445eab Add strstarts() helper function cc392f089007 tests: Check non-matching cases for fdt_node_check_compatible() bba26a5291c8 livetree: avoid assertion of orphan phandles with overlays c8f8194d76cc implement strnlen for systems that need it c8b38f65fdec libfdt: Remove leading underscores from identifiers 3b62fdaebfe5 Remove leading underscores from identifiers 2d45d1c5c65e Replace FDT_VERSION() with stringify() 2e6fe5a107b5 Fix some errors in comments b0ae9e4b0ceb tests: Correct warning in sw_tree1.c Commit c8b38f65fdec upstream ("libfdt: Remove leading underscores from identifiers") changed the multiple inclusion define protection, so the kernel's libfdt_env.h needs the corresponding update. Signed-off-by: Rob Herring <robh@kernel.org> [ Linux commit: 9130ba884640328bb78aaa4840e5ddf06ccafb1c ] [erosca: - Fixup conflicts in include/linux/libfdt_env.h caused by v2018.03-rc4 commit b08c8c487083 ("libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>") - Fix build errors in lib/libfdt/fdt_ro.c, tools/libfdt/fdt_rw.c by: - s/_fdt_mem_rsv/fdt_mem_rsv_/ - s/_fdt_offset_ptr/fdt_offset_ptr_/ - s/_fdt_check_node_offset/fdt_check_node_offset_/ - s/_fdt_check_prop_offset/fdt_check_prop_offset_/ - s/_fdt_find_add_string/fdt_find_add_string_/] Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-05-22buildman: support newer gcc versions from kernel.orgDaniel Schwierzeck
Add support for gcc versions 7.3.0, 6.4.0 and 4.9.4. Also use a regex for matching the tarball names. Some gcc versions use '-ARCH-' instead of '_ARCH-'. As part of this, we switch TravisCI to also using these toolchains for all platforms. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-16tools: buildman: Don't use the working dir as build dirLothar Waßmann
When the U-Boot base directory happens to have the same name as the branch that buildman is directed to use via the '-b' option and no output directory is specified with '-o', buildman happily starts removing the whole U-Boot sources eventually only stopped with the error message: OSError: [Errno 20] Not a directory: '../<branch-name>/boards.cfg Add a check to avoid this and also deal with the case where '-o' points to the source directory, or any subdirectory of it. Finally, tidy up the confusing logic for removing the old tree when using -b. This is only done when building a branch. Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Lothar Waßmann <LW@KARO-electronics.de>
2018-05-11SPDX: Correct SPDX tags from recent xilinx mergeTom Rini
Correct the SPDX tag format. Fixes: 3b52847a451a ("Merge tag 'xilinx-for-v2018.07' of git://www.denx.de/git/u-boot-microblaze") Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-11Merge tag 'xilinx-for-v2018.07' of git://www.denx.de/git/u-boot-microblazeTom Rini
Xilinx changes for v2018.07 microblaze: - Align defconfig zynq: - Rework fpga initialization and cpuinfo handling zynqmp: - Add ZynqMP R5 support - Wire and enable watchdog on zcu100-revC - Setup MMU map for DDR at run time - Show board info based on DT and cleanup IDENT_STRING zynqmp tools: - Add read partition support - Add initial support for Xilinx bif format for boot.bin generation mmc: - Fix get_timer usage on 64bit cpus - Add support for SD3.0 UHS mode nand-zynq: - Add support for 16bit buswidth - Use address cycles from onfi params scsi: - convert ceva sata to UCLASS_AHCI timer: - Add Cadence TTC for ZynqMP r5 watchdog: - Minor cadence driver cleanup
2018-05-11tools: zynqmpimage: Add bif supportAlexander Graf
The officially described way to generate boot.bin files for ZynqMP is to describe the contents of the target binary using a file of the "bif" format. This file then links to other files that all get packed into a bootable image. This patch adds support to read such a .bif file and generate a respective ZynqMP boot.bin file that can include the normal image and pmu files, but also supports image partitions now. This makes it a handy replacement for the proprietary "bootgen" utility that is currently used to generate boot.bin files with FSBL. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-05-11tools: zynqmpimage: Move defines to headerAlexander Graf
We will add support for ZynqMP bif input files later, so let's move all structure definitions into a header file that can be used by that one as well. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>