summaryrefslogtreecommitdiff
path: root/dtc-parser.y
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-02-25 09:58:29 -0700
committerJon Loeliger <jdl@jdl.com>2010-02-25 11:46:01 -0600
commit83da1b2a4ee272ac97647a82fc652d9b4b1505ee (patch)
tree37673dc8cf18212c20b497b4e030b0370d240ad5 /dtc-parser.y
parent716418849a0ed4cc7689d4b82a73597a8726de92 (diff)
downloaddtc-83da1b2a4ee272ac97647a82fc652d9b4b1505ee.tar.gz
Allow device tree to be modified by additonal device tree sections
This patch allows the following construct: / { property-a = "old"; property-b = "does not change"; }; / { property-a = "changed"; property-c = "new"; node-a { }; }; Where the later device tree overrides the properties found in the earlier tree. This is useful for laying down a template device tree in an include file and modifying it for a specific board without having to clone the entire tree. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r--dtc-parser.y14
1 files changed, 13 insertions, 1 deletions
diff --git a/dtc-parser.y b/dtc-parser.y
index 8fa1e4f..dea19c1 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -75,6 +75,7 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
%type <proplist> proplist
%type <node> devicetree
+%type <node> devicetrees
%type <node> nodedef
%type <node> subnode
%type <nodelist> subnodes
@@ -82,7 +83,7 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
%%
sourcefile:
- DT_V1 ';' memreserves devicetree
+ DT_V1 ';' memreserves devicetrees
{
the_boot_info = build_boot_info($3, $4,
guess_boot_cpuid($4));
@@ -119,6 +120,17 @@ addr:
}
;
+devicetrees:
+ devicetree
+ {
+ $$ = $1;
+ }
+ | devicetrees devicetree
+ {
+ $$ = merge_nodes($1, $2);
+ }
+ ;
+
devicetree:
'/' nodedef
{