]> git.sur5r.net Git - u-boot/blobdiff - scripts/dtc/dtc-parser.y
uniphier: psci: save context id in cpu_on command
[u-boot] / scripts / dtc / dtc-parser.y
index ca3f5003427cb5e280eb6ec4343547f7f37bd428..affc81a8f9abedc2dec26bd8f713aac337e2ac6e 100644 (file)
@@ -182,10 +182,19 @@ devicetree:
                {
                        struct node *target = get_node_by_ref($1, $2);
 
-                       if (target)
+                       if (target) {
                                merge_nodes(target, $3);
-                       else
-                               ERROR(&@2, "Label or path %s not found", $2);
+                       } else {
+                               /*
+                                * We rely on the rule being always:
+                                *   versioninfo plugindecl memreserves devicetree
+                                * so $-1 is what we want (plugindecl)
+                                */
+                               if ($<flags>-1 & DTSF_PLUGIN)
+                                       add_orphan_node($1, $3, $2);
+                               else
+                                       ERROR(&@2, "Label or path %s not found", $2);
+                       }
                        $$ = $1;
                }
        | devicetree DT_DEL_NODE DT_REF ';'
@@ -200,6 +209,11 @@ devicetree:
 
                        $$ = $1;
                }
+       | /* empty */
+               {
+                       /* build empty node */
+                       $$ = name_node(build_node(NULL, NULL), "");
+               }
        ;
 
 nodedef: