aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-05-06Build the dtc binary as a static executableandroid-vts-8.0_r9android-vts-8.0_r8android-vts-8.0_r7android-vts-8.0_r6android-vts-8.0_r2android-vts-8.0_r13android-vts-8.0_r12android-vts-8.0_r11android-vts-8.0_r10android-vts-8.0_r1android-security-8.0.0_r54android-security-8.0.0_r53android-security-8.0.0_r52android-cts-8.0_r9android-cts-8.0_r8android-cts-8.0_r7android-cts-8.0_r6android-cts-8.0_r5android-cts-8.0_r4android-cts-8.0_r3android-cts-8.0_r26android-cts-8.0_r25android-cts-8.0_r24android-cts-8.0_r23android-cts-8.0_r22android-cts-8.0_r21android-cts-8.0_r20android-cts-8.0_r2android-cts-8.0_r19android-cts-8.0_r18android-cts-8.0_r17android-cts-8.0_r16android-cts-8.0_r15android-cts-8.0_r14android-cts-8.0_r13android-cts-8.0_r12android-cts-8.0_r11android-cts-8.0_r10android-cts-8.0_r1android-cts-7.1_r18android-8.0.0_r9android-8.0.0_r7android-8.0.0_r51android-8.0.0_r50android-8.0.0_r49android-8.0.0_r48android-8.0.0_r47android-8.0.0_r46android-8.0.0_r45android-8.0.0_r44android-8.0.0_r43android-8.0.0_r42android-8.0.0_r41android-8.0.0_r40android-8.0.0_r4android-8.0.0_r39android-8.0.0_r38android-8.0.0_r37android-8.0.0_r36android-8.0.0_r35android-8.0.0_r32android-8.0.0_r31android-8.0.0_r30android-8.0.0_r3android-8.0.0_r29android-8.0.0_r28android-8.0.0_r2android-8.0.0_r17android-8.0.0_r16android-8.0.0_r15android-8.0.0_r13android-8.0.0_r12android-8.0.0_r11android-8.0.0_r10android-8.0.0_r1security-oc-releaseoreo-vts-releaseoreo-security-releaseoreo-releaseoreo-r6-releaseoreo-r5-releaseoreo-r4-releaseoreo-r3-releaseoreo-r2-releaseoreo-devoreo-cts-releaseYueyao Zhu
This enables the dtc binary to be used without dependencies on shared libraries, for instance, when the binary is copied to be used in the Android kernel build process. Bug: 38007786 Test: mmm -j8 external/dtc , ldd out/host/linux-x86/bin/dtc Change-Id: Ic566104dc8064bdea12a9d3e0c442b518dc5d2ec Merged-In: Ic566104dc8064bdea12a9d3e0c442b518dc5d2ec (cherry picked from commit 9dfa11ddc415aec92f9ffed55d86cb3ba77c9a29)
2017-02-27Disable macro redefined warnings. am: 2a1020b73b am: 76f53c87dfChristopher Ferris
am: d55eeac324 Change-Id: Ic6c3f477acadff3927958f5e08f1972bbf57ecc0
2017-02-27Disable macro redefined warnings. am: 2a1020b73bChristopher Ferris
am: 76f53c87df Change-Id: I6762418a2a5300bce2a19f72f2c95220328923fd
2017-02-27Disable macro redefined warnings.Christopher Ferris
am: 2a1020b73b Change-Id: Idfd1f593b302343d9eca0951358690f924eb8cf0
2017-02-24Disable macro redefined warnings.android-o-preview-1android-n-mr2-preview-2o-previewChristopher Ferris
The new kernel headers do: #define __bitwise __bitwise__ However, the code redefines __bitwise without undef'ing it first. This is a temporary fix, b/35721782 filed to fix this. Change-Id: Ic16796a599dc577b4fef7f8e2a586162160955fb Test: Builds without warningers/errors.
2017-02-18overlay: Add syntactic sugar version of overlays am: ec2917363c am: c15ed6d6caPantelis Antoniou
am: d5cbea133f Change-Id: Id4b7246d8f686e1ef2afa0e4d8dd3b7b2fac00ce
2017-02-18overlay: Documentation for the overlay sugar syntax am: 8876e278cf am: ↵Pantelis Antoniou
784eabe1a6 am: 3d18b62367 Change-Id: I1625b4ee834629d4aa2183983c982d1dd162db26
2017-02-18Reset master to upstream am: 507cd9883a am: 4305ca9fb6SzuWei Lin
am: 34e67011b4 Change-Id: Ia4507b10f8c8fe633eede7a5b387888cf41c0cd8
2017-02-18overlay: Add syntactic sugar version of overlays am: ec2917363cPantelis Antoniou
am: c15ed6d6ca Change-Id: I5ae016a4b67b955ed3f65d8c61b40daf6b7931db
2017-02-18overlay: Documentation for the overlay sugar syntax am: 8876e278cfPantelis Antoniou
am: 784eabe1a6 Change-Id: I7997d426221643fa7907c0919c2a75e86ee2692f
2017-02-18Reset master to upstream am: 507cd9883aSzuWei Lin
am: 4305ca9fb6 Change-Id: I30f79810815230d4734ac5cad0c7de260c1fcbef
2017-02-18overlay: Add syntactic sugar version of overlaysPantelis Antoniou
am: ec2917363c Change-Id: I04d6c96d87c8ed847e3fc2d60ab0a0102fa70399
2017-02-18overlay: Documentation for the overlay sugar syntaxPantelis Antoniou
am: 8876e278cf Change-Id: Ib49faed8ef307bb2b6db54e36e6547f48c9e3098
2017-02-18Reset master to upstreamSzuWei Lin
am: 507cd9883a Change-Id: I3fd4b4c61f5c668fb75f74417163738b904f6e0d
2017-02-17overlay: Add syntactic sugar version of overlaysPantelis Antoniou
For simple overlays that use a single target there exists a simpler syntax version. &foo { }; generates an overlay with a single target at foo. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Downloaded from https://marc.info/?l=devicetree&m=148111493325866&w=4 Change-Id: I7bf2ff20133ee37888e8dc6031b5539b0d6168e7
2017-02-17overlay: Documentation for the overlay sugar syntaxPantelis Antoniou
There exists a syntactic sugar version of overlays which make them simpler to write for the trivial case of a single target. Document it in the device tree object internals. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Downloaded from https://marc.info/?l=devicetree&m=148111492925863&w=4 Change-Id: Iac4cb844f655516022926e7c18e7de3ae384e5e8
2017-02-17Reset master to upstreamSzuWei Lin
Reset master to upstream 120775eb1cf39f8dcecd695c3ff1cfef8aeb669d and merge history. Bug: 35151782 Test: Build dtc, use output dtc to build dts, can output correct dtb. Change-Id: I4d3ef31a8597f7b214fea2d70ceb99a08d57d925
2017-02-13dtc: Use streq() in preference to strcmp()David Gibson
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 Herring
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 Herring
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 Gibson
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 Dubois
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 Boyd
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 Boyd
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 Boyd
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 Schuchardt
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 Smith
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Gibson
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 Antoniou
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 Antoniou
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 Antoniou
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 Antoniou
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 Antoniou
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 Fair
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 Yamada
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 Yamada
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 Ripard
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 Ripard
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 Ripard
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>