summaryrefslogtreecommitdiff
path: root/dtc-parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'dtc-parser.y')
-rw-r--r--dtc-parser.y28
1 files changed, 16 insertions, 12 deletions
diff --git a/dtc-parser.y b/dtc-parser.y
index dea19c1..0aaf8e8 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -75,7 +75,6 @@ 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
@@ -83,7 +82,7 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
%%
sourcefile:
- DT_V1 ';' memreserves devicetrees
+ DT_V1 ';' memreserves devicetree
{
the_boot_info = build_boot_info($3, $4,
guess_boot_cpuid($4));
@@ -120,21 +119,26 @@ addr:
}
;
-devicetrees:
- devicetree
+devicetree:
+ '/' nodedef
{
- $$ = $1;
+ $$ = name_node($2, "");
}
- | devicetrees devicetree
+ | devicetree '/' nodedef
{
- $$ = merge_nodes($1, $2);
+ $$ = merge_nodes($1, $3);
}
- ;
-
-devicetree:
- '/' nodedef
+ | devicetree DT_REF nodedef
{
- $$ = name_node($2, "");
+ struct node *target;
+
+ target = get_node_by_label($1, $2);
+ if (target)
+ merge_nodes(target, $3);
+ else
+ yyerror("label does not exist in "
+ " node redefinition");
+ $$ = $1;
}
;