diff options
author | Rob Herring <robh@kernel.org> | 2017-10-03 12:37:04 -0400 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-10-03 16:03:47 -0400 |
commit | 4201d057ea91c3d6efd2db65219bc91fae413bc2 (patch) | |
tree | 8cb0f6ad01e4cb5d09c18d32931e7ea10a55df10 /scripts/dtc/livetree.c | |
parent | 4322323058f010274564006d61945187a15b6361 (diff) |
scripts/dtc: Update to upstream version v1.4.5-3-gb1a60033c110
This adds the following commits from upstream:
b1a60033c110 tests: Add a test for overlays syntactic sugar
737b2df39cc8 overlay: Add syntactic sugar version of overlays
497432fd2131 checks: Use proper format modifier for size_t
22a65c5331c2 dtc: Bump version to v1.4.5
c575d8059fff Add fdtoverlay to .gitignore
b6a6f9490d19 fdtoverlay: Sanity check blob size
8c1eb1526d2d pylibfdt: Use Python2 explicitly
ee3d26f6960b checks: add interrupts property check
c1e7738988f5 checks: add gpio binding properties check
b3bbac02d5e3 checks: add phandle with arg property checks
fe50bd1ecc1d fdtget: Split out cell list display into a new function
62d812308d11 README: Add a note about test_tree1.dts
5bed86aee9e8 pylibfdt: Add support for fdt_subnode_offset()
46f31b65b3b3 pylibfdt: Add support for fdt_node_offset_by_phandle()
a3ae43723687 pylibfdt: Add support for fdt_parent_offset()
a198af80344c pylibfdt: Add support for fdt_get_phandle()
b9eba92ea50f tests: Return a failure code when any tests fail
155faf6cc209 pylibfdt: Use local pylibfdt module
50e5cd07f325 pylibfdt: Add a test for use of uint32_t
ab78860f09f5 pylibfdt: Add stdint include to fix uint32_t
36f511fb1113 tests: Add stacked overlay tests on fdtoverlay
1bb00655d3e5 fdt: Allow stacked overlays phandle references
a33c2247ac8d Introduce fdt_setprop_placeholder() method
0016f8c2aa32 dtc: change default phandles to ePAPR style instead of both
e3b9a9588a35 tests: fdtoverlay unit test
42409146f2db fdtoverlay: A tool that applies overlays
aae22722fc8d manual: Document missing options
13ce6e1c2fc4 dtc: fix sprintf() format string error, again
d990b8013889 Makefile: Fix build on MSYS2 and Cygwin
51f56dedf8ea Clean up shared library compile/link options
21a2bc896e3d Suppress expected error message in fdtdump test
2a42b14d0d03 dtc: check.c fix compile error
a10cb3c818d3 Fix get_node_by_path string equality check
548aea2c436a fdtdump: Discourage use of fdtdump
c2258841a785 fdtdump: Fix over-zealous version check
9067ee4be0e6 Fix a few whitespace and style nits
e56f2b07be38 pylibfdt: Use setup.py to build the swig file
896f1c133265 pylibfdt: Use Makefile constructs to implement NO_PYTHON
90db6d9989ca pylibfdt: Allow setup.py to operate stand-alone
e20d9658cd8f Add Coverity Scan support
b04a2cf08862 pylibfdt: Fix code style in setup.py
1c5170d3a466 pylibfdt: Rename libfdt.swig to libfdt.i
580a9f6c2880 Add a libfdt function to write a property placeholder
ab15256d8d02 pylibfdt: Use the call function to simplify the Makefile
9f2e3a3a1f19 pylibfdt: Use the correct libfdt version in the module
e91c652af215 pylibfdt: Enable installation of Python module
8a892fd85d94 pylibfdt: Allow building to be disabled
741cdff85d3e .travis.yml: Add builds with and without Python library prerequisites
14c4171f4f9a pylibfdt: Use package_dir to set the package directory
89a5062ab231 pylibfdt: Use environment to pass C flags and files
4e0e0d049757 pylibfdt: Allow pkg-config to be supplied in the environment
6afd7d9688f5 Correct typo: s/pylibgfdt/pylibfdt/
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'scripts/dtc/livetree.c')
-rw-r--r-- | scripts/dtc/livetree.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/scripts/dtc/livetree.c b/scripts/dtc/livetree.c index 3673de07e4e5..6846ad2fd6d2 100644 --- a/scripts/dtc/livetree.c +++ b/scripts/dtc/livetree.c | |||
@@ -216,6 +216,28 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node) | |||
216 | return old_node; | 216 | return old_node; |
217 | } | 217 | } |
218 | 218 | ||
219 | void add_orphan_node(struct node *dt, struct node *new_node, char *ref) | ||
220 | { | ||
221 | static unsigned int next_orphan_fragment = 0; | ||
222 | struct node *node; | ||
223 | struct property *p; | ||
224 | struct data d = empty_data; | ||
225 | char *name; | ||
226 | |||
227 | d = data_add_marker(d, REF_PHANDLE, ref); | ||
228 | d = data_append_integer(d, 0xffffffff, 32); | ||
229 | |||
230 | p = build_property("target", d); | ||
231 | |||
232 | xasprintf(&name, "fragment@%u", | ||
233 | next_orphan_fragment++); | ||
234 | name_node(new_node, "__overlay__"); | ||
235 | node = build_node(p, new_node); | ||
236 | name_node(node, name); | ||
237 | |||
238 | add_child(dt, node); | ||
239 | } | ||
240 | |||
219 | struct node *chain_node(struct node *first, struct node *list) | 241 | struct node *chain_node(struct node *first, struct node *list) |
220 | { | 242 | { |
221 | assert(first->next_sibling == NULL); | 243 | assert(first->next_sibling == NULL); |
@@ -396,6 +418,12 @@ cell_t propval_cell(struct property *prop) | |||
396 | return fdt32_to_cpu(*((fdt32_t *)prop->val.val)); | 418 | return fdt32_to_cpu(*((fdt32_t *)prop->val.val)); |
397 | } | 419 | } |
398 | 420 | ||
421 | cell_t propval_cell_n(struct property *prop, int n) | ||
422 | { | ||
423 | assert(prop->val.len / sizeof(cell_t) >= n); | ||
424 | return fdt32_to_cpu(*((fdt32_t *)prop->val.val + n)); | ||
425 | } | ||
426 | |||
399 | struct property *get_property_by_label(struct node *tree, const char *label, | 427 | struct property *get_property_by_label(struct node *tree, const char *label, |
400 | struct node **node) | 428 | struct node **node) |
401 | { | 429 | { |
@@ -478,7 +506,8 @@ struct node *get_node_by_path(struct node *tree, const char *path) | |||
478 | p = strchr(path, '/'); | 506 | p = strchr(path, '/'); |
479 | 507 | ||
480 | for_each_child(tree, child) { | 508 | for_each_child(tree, child) { |
481 | if (p && strneq(path, child->name, p-path)) | 509 | if (p && (strlen(child->name) == p-path) && |
510 | strneq(path, child->name, p-path)) | ||
482 | return get_node_by_path(child, p+1); | 511 | return get_node_by_path(child, p+1); |
483 | else if (!p && streq(path, child->name)) | 512 | else if (!p && streq(path, child->name)) |
484 | return child; | 513 | return child; |