mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
Alter grammar to allow multiple /dts-v1/ tags
This patch allows dtc to accept multiple /dts-v1/ tags (provided they're all at the beginning of the input), rather than giving a syntax error. This makes it more convenient to include one .dts file from another without having to be careful that the /dts-v1/ tag is in exactly one of them. We a couple of existing testcases to take advantage of this, which simplifies them slightly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d71d25d760
commit
c4cb12e193
4 changed files with 52 additions and 48 deletions
11
dtc-parser.y
11
dtc-parser.y
|
@ -101,13 +101,18 @@ extern bool treesource_error;
|
|||
%%
|
||||
|
||||
sourcefile:
|
||||
DT_V1 ';' memreserves devicetree
|
||||
v1tag memreserves devicetree
|
||||
{
|
||||
the_boot_info = build_boot_info($3, $4,
|
||||
guess_boot_cpuid($4));
|
||||
the_boot_info = build_boot_info($2, $3,
|
||||
guess_boot_cpuid($3));
|
||||
}
|
||||
;
|
||||
|
||||
v1tag:
|
||||
DT_V1 ';'
|
||||
| DT_V1 ';' v1tag
|
||||
;
|
||||
|
||||
memreserves:
|
||||
/* empty */
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue