mirror of
https://github.com/dgibson/dtc.git
synced 2026-01-22 01:30:34 -05:00
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>
This commit is contained in:
parent
716418849a
commit
83da1b2a4e
7 changed files with 214 additions and 6 deletions
14
dtc-parser.y
14
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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue