aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-07-18Update to dtc-1.4.3-1.el7dtc-1.4.3-1.el7RHEL-7.4Miroslav Rezanina1-0/+5
2017-07-14redhat/Makefile: honor BREW_FLAGS like the kernelMiroslav Rezanina1-1/+1
When doing make rh-brew on a RHEL kernel one can set BREW_FLAGS to anything that 'brew build' accepts (see 'brew build -h'). This is useful to avoid wasting resources when only one arch needs to be compiled for a test, as the arch-override parameter can be set. For example, BREW_FLAGS='--arch-override=aarch64' make -C redhat rh-brew only builds for aarch64. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
2017-04-05script: update git-backport-diff to latestPeter Xu1-25/+50
RH-Author: Peter Xu <peterx@redhat.com> Message-id: <1490341487-21581-1-git-send-email-peterx@redhat.com> Patchwork-id: 74520 O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH] script: update git-backport-diff to latest Bugzilla: BZ: None Brew: None Upstream: Downstream only Upstream git-backport-diff (https://github.com/codyprime/git-scripts) has several enhancements. Let's sync up with that one. This patch will upgrade the script to the following commit on Apr 22th, 2016 (which is current latest): a7ccff88e (More fixes for printing literal strings) Signed-off-by: Peter Xu <peterx@redhat.com> --- redhat/scripts/git-backport-diff | 75 ++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 25 deletions(-) Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
2017-03-06Add redhat directoryMiroslav Rezanina15-0/+826
2017-02-28dtc: Bump version to v1.4.3v1.4.3David Gibson1-1/+1
Preparing for new release. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-28Add printf format attributesDavid Gibson2-1/+19
When compiling with gcc, we already include the attribute on check_msg() to give compiler warnings about mismatches between printf() like format strings and the corresponding arguments. This patch adds similar attributes for lexical_error() and die(). Suggested-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-28Correct some broken printf() like format mismatchesDavid Gibson2-2/+2
Fix two places where a printf()-style format string does not match the arguments passed. Reported-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-24libfdt: Add fdt_setprop_empty()David Gibson2-1/+31
Device trees can contain empty (zero length) properties, which are often used as boolean flags. These can already be created using fdt_setprop() passing a length of zero and a pointer which is ignored. It is safe to pass NULL, but that may not be obvious from the interface. To make it clearer, add an fdt_setprop_empty() helper macro. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-24libfdt: Remove undefined behaviour setting empty propertiesDavid Gibson1-1/+2
The standard way of setting an empty property using libfdt is: fdt_setprop(fdt, nodeoffset, propname, NULL, 0); However, the implementation of this includes an unconditional: memcpy(prop->data, NULL, 0); Which although it will be a no-op (which is what we want) on many platforms is technically undefined behaviour. Correct this, so that when passing a 0 length, passing a NULL pointer as the value to fdt_setprop() is definitely safe. This should quiet static checkers which complain about this. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-23Print output filename as part of warning messagesIan Campbell3-40/+46
For example: src/arm/at91-ariag25.dtb: Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name If output is to stdout then the prefix is "<stdout>: ". This helps to direct the developer to where to look when multiple files are being compiled in parallel. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-13dtc: Use streq() in preference to strcmp()David Gibson2-3/+3
dtc defines a streq() (string equality) macro to avoid the easy confusion of the sense of strcmp() comparison for equality. A few places where we don't use it have slipped in, so remove them. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-13checks: Add Warning for stricter node name character checkingRob Herring1-0/+12
While '#', '?', '.', '+', '*', and '_' are considered valid characters, their use is discouraged in recommended practices. Testing this found a few cases of '.'. The majority of the warnings were all from underscores. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-13checks: Add Warning for stricter property name character checkingRob Herring1-0/+35
While '?', '.', '+', '*', and '_' are considered valid characters their use is discouraged in recommended practices. '#' is also only recommended to be used at the beginning of property names. Testing this found one typo error with '.' used instead of ','. The rest of the warnings were all from underscores. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-08dtc: pos parameter to srcpos_string() can't be NULLDavid Gibson1-1/+1
None of the callers ever pass a NULL to srcpos_string(), so the check for it is not necessary. Furthermore, checking it make Coverity complain about the raw dereferences which follow later in the function. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-08livetree.c: Fix memory leakJean-Christophe Dubois1-0/+2
When running coverity on dtc source code the following error is reported. ========================================================================== *** CID 1370967: Resource leaks (RESOURCE_LEAK) /tools/dtc/livetree.c: 850 in add_fixup_entry() 844 if (strchr(node->fullpath, ':') || strchr(prop->name, ':')) 845 die("arguments should not contain ':'\n"); 846 847 xasprintf(&entry, "%s:%s:%u", 848 node->fullpath, prop->name, m->offset); 849 append_to_property(fn, m->ref, entry, strlen(entry) + 1); >>> CID 1370967: Resource leaks (RESOURCE_LEAK) >>> Variable "entry" going out of scope leaks the storage it points to. 850 } ========================================================================== Fix the leak. Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-01-31dtc: Fix NULL pointer use in dtlabel + dtref caseStephen Boyd3-3/+13
If we have a construct like this: label: &handle { ... }; Running dtc on it will cause a segfault, because we use 'target' when it could be NULL. Move the add_label() call into the if statement to fix this potentially bad use of a NULL pointer. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-01-30manual: Fix typo it -> inStephen Boyd1-1/+1
Two its in a row can't be right. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-01-30Makefile: Add tags ruleStephen Boyd1-0/+6
It's useful to have some tags to jump around sources. We don't include test sources in the toplevel Makefile because they probably aren't useful to main program development. Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-27dtc: fdtdump: check fdt if not in scanning modeHeinrich Schuchardt1-8/+19
Running fdtdump without scan mode for an invalid file often results in a segmentation fault because the fdt header is not checked. With the patch the header is checked both in scanning as well as in non-scanning mode. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [dwg: Removed unnecessary inline, changed type from int to bool] Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-12dtc: Fix memory leak in character literal parsingGabriel Smith1-8/+8
The data struct used for parsing character literals was never freed resulting in a few bytes leaked for every character. Signed-off-by: Gabriel Smith <ga29smith@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09Rename boot_infoDavid Gibson8-148/+147
struct boot_info is named that for historical reasons, and isn't particularly meaningful. Essentially it contains all the information - in "live" form from a single dts or dtb file. As we move towards support for dynamic dt overlays, that name will become increasingly bad. So, in preparation, rename it to dt_info. At the same time rename the 'the_boot_info' global to 'parser_output' since that's its actual purpose. Unfortunately we do need the global unless we switch to bison's re-entrant parser extensions, which would introduce its own complications. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09dtc: Clean up /dts-v1/ and /plugin/ handling in grammarDavid Gibson1-18/+17
First remove the non-terminal name 'versioninfo' - /plugin/ doesn't really indicate a "version" per se, and version could be confused with the dtb output version. Second allow the /dts-v1/; /plugin/; sequence to be repeated, for easier use of include files - but ensure that all copies match, so you can't include a file declaring /plugin/ in one that doesn't, or vice versa. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09dtc: Don't always generate __symbols__ for pluginsDavid Gibson2-9/+2
At the moment we generate a __symbols__ node if -@ is specified OR if the dts has the /plugin/ tag. That difference in behaviour from handling base trees is unnecessary and slightly confusing. It also means it's impossible to create a plugin without symbols. Since symbols in a plugin are only useful in the case of stacked plugins - and libfdt doesn't even support merging plugin symbols as part of overlay application yet - that's a thing that might be useful. So make __symbols__ generation depend only on -@. We also remove remove the testcases that checked explicitly for this not very useful behaviour. Instead we don't use -@ for our basic overlay testcase, and check that symbols are not generated. At some point in the future we should add support for symbol merging to libfdt and add testcases for stacked overlay application. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Don't use -@ on plugin de/recompile testsDavid Gibson1-2/+2
Using -@ again here obscures what's going on, because at the end we can't know which run actually generated the symbols node. We should just generate the symbols on the first run and leave it at that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Remove "suppression of fixups" testsDavid Gibson2-28/+0
I think these were for an additional command line option which got dropped during development. At this point all they're testing is that fixups don't get generated for a non /plugin/ tree, which is already tested with one of the simpler cases previously. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Clarify dtc overlay testsDavid Gibson2-11/+14
This changes the names of the testfiles for a number of the testcases of the dtc overlay generation functionality to make them shorter and a bit cleaerer what's going on. In addition we move some of the check_path sanity checks closer to the dtc commands they verify. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: More thorough tests of libfdt overlay application without dtcDavid Gibson4-2/+161
At the moment we have some rudimentary tests of the fdt_overlay_apply() function which don't rely on overlay generation support in dtc. This is done by avoiding any external references in the sample overlay, in particularly using the 'target-path' syntax instead of 'target' to avoid needing external references in the fragment targets. Thus this test case doesn't exercise libfdt's processing of the __fixups__ node at all. We do test that somewhat in combination with dtc's overlay support. However, in the interests of being able to quickly determine which side a bug is on, it would be nice to exercise this without requiring the dtc support. This adds testcases to do so, by making some examples with manually constructed __symbols__ and __fixups__ nodes. In addition we rename some of the test data files and add some extra check_path tests to make it a bit clearer what's going on here. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Correct fdt handling of overlays without fixups and base trees ↵David Gibson1-1/+6
without symbols The fdt_overlay_apply() function purports to support the edge cases where an overlay has no fixups to be applied, or a base tree which has no symbols (the latter can only work if the former is also true). However it gets it wrong in a couple of small ways: * In the no fixups case, it doesn't fail immediately, but will attempt fdt_for_each_property_offset() giving -FDT_ERR_NOTFOUND as the node offset, which will fail. Instead it should succeed immediately, since there's nothing to do. * In the case of no symbols, it again doesn't fail immediately. However if there is an actual fixup it will fail with an unexpected error, because -FDT_ERR_NOTFOUND is passed to fdt_getprop() when attempting to look up the symbols. We should instead return -FDT_ERR_NOTFOUND directly. Both of these errors lead to the code returning misleading error codes in failing cases. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Fix double expansion bugs in test codeDavid Gibson2-4/+6
Two test programs - check_path and overlay - define a CHECK() helper macro in such a way that in the case of an error it will re-execute the checked code fragment, instead of using the return value from the initial call. This can lead to misreporting errors, because the code may fail in a different way the second time around due to changes made during the first failing call. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Split overlay tests into those with do/don't exercise dtc plugin ↵David Gibson1-10/+16
generation The various tests for overlay/plugin support are currently lumped together in the overlay_tests shell function, which is executed by libfdt_tests. However, this includes both tests designed primarily to exercise libfdt's overlay application, and tests designed to exercise dtc's overlay generation. Split these up for improved clarity. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Test auto-alias generation on base tree, not overlayDavid Gibson1-5/+5
The current testcases for the -A "auto alias generation" option operate on a "plugin" tree. Although not technically wrong, this is an odd approach, since a plugin will almost certainly need the __symbols__ and/or __fixups__ syntax instead of aliases. On the other hand -A may be useful simply for generating aliases on a tree which is not using the overlay / plugin mechanism at all. Therefore change the tests to operate on a base tree example instead of a plugin. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Make overlay/plugin tests unconditionalDavid Gibson1-37/+34
When overlay apply supprt was added to libfdt the testcases included some which could only be executed with the (then) out of tree dtc with overlay output support. So, the test script automatically skipped those tests if it wasn't available. Now that the overlay support is merged into dtc mainline there's no reason to keep this logic. Instead run all the overlay tests unconditionally. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Add overlay testsPantelis Antoniou4-0/+64
Add a number of tests for dynamic objects/overlays. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09tests: Add check_path testPantelis Antoniou4-1/+88
Add a test that checks for existence or not of a node. It is useful for testing the various cases when generating symbols and fixups for dynamic device tree objects. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09dtc: Plugin and fixup supportPantelis Antoniou9-11/+373
This patch enable the generation of symbols & local fixup information for trees compiled with the -@ (--symbols) option. Using this patch labels in the tree and their users emit information in __symbols__ and __local_fixups__ nodes. The __fixups__ node make possible the dynamic resolution of phandle references which are present in the plugin tree but lie in the tree that are applying the overlay against. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09dtc: Document the dynamic plugin internalsPantelis Antoniou1-0/+310
Provides the document explaining the internal mechanics of plugins and options. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-11-28checks: Pass boot_info instead of root nodePantelis Antoniou1-36/+42
As preparation for overlay support we need to pass the boot info parameter instead of the root node to each check method. The root node can be retrieved by accessing boot info's dt member. No other functional changes are made. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-11-04libfdt: add missing errors to fdt_strerror()Benjamin Fair1-0/+3
Some error values were missing from the table which meant that they could not be translated by fdt_strerror(). Signed-off-by: Benjamin Fair <b-fair@ti.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-17libfdt: fix fdt_stringlist_search()Masahiro Yamada1-1/+1
If fdt_getprop() fails, negative error code should be returned. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-17libfdt: fix fdt_stringlist_count()Masahiro Yamada1-1/+1
If fdt_getprop() fails, negative error code should be returned. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-12tests: overlay: Rename the device tree blobs to be more explicitMaxime Ripard1-7/+7
Rename the blobs to have a more explicit output that will give us a clearer idea about whether a DT (and the test) has been compiled using a dtc with our without overlays support. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-11tests: overlay: Add test suffix to the compiled blobsMaxime Ripard1-8/+8
The compiled blobs in the overlay tests do not have the test suffix which is usually used to clean up and ignore the test artifacts. Let's add that suffix. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-11libfdt: Add fdt_overlay_apply to the exported symbolsMaxime Ripard1-0/+1
fdt_overlay_apply was not usable in the shared library. Export it to allow its use. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-11fdt: strerr: Remove spurious BADOVERLAYMaxime Ripard1-1/+0
There's one FDT_ERR_BADOVERLAY too many in the fdt error table. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-07tests: overlay: Move back the bad fixup testsMaxime Ripard1-7/+7
The bad fixups tests were meant to be usable even for a non-overlay-enabled dtc. Move them out of that check. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-07libfdt: overlay: Fix symbols and fixups nodes conditionMaxime Ripard1-4/+3
Some base device tree might not have any __symbols__ nodes, since they might not have any phandle at all. Similarly, if an overlay doesn't use any base device tree phandles, its __fixups__ node will be empty. In such cases, we don't want to stop the phandle parsing, but rather just ignore the error reported about the missing node. If it's actually an issue for the overlay we're trying to apply on a given base device tree, it will be caught later on, but we cannot make the assumption that early in the application process. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-07libfdt: overlay: Report a bad overlay for mismatching local fixupsMaxime Ripard1-0/+2
The __local_fixups__ node as a structure that mimics the structure of the main overlay part. This means that if we have a child node somewhere in the local fixups sub-tree and if that node is not present in the main tree, the overlay is poorly formatted, and we should report it as such. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-07libfdt: Add BADPHANDLE error stringMaxime Ripard1-0/+1
The BADPHANDLE error was missing a string, leading to an <unknown error> string being returned if you were to call fdt_strerror. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-06libfdt: Don't use 'index' as a local variable nameDavid Gibson2-25/+25
Using 'index' as a local variable name shadows the standard library index() function. This causes warnings on at least some compiler versions. The recently added overlay code has a number of instances of this. This patch replaces 'index' with 'poffset', since 'index' is being used to mean "offset within a property value" in these cases. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-10-06tests: Add tests cases for the overlay codeMaxime Ripard17-1/+656
Add some test infrastructure to test that the overlay can be merged, but also that poorly formatted fixups would fail as expected. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> [dwg: Don't execute bad overlay tests without overlay aware dtc] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>