aboutsummaryrefslogtreecommitdiff
path: root/dtc-parser.y
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2014-06-02 15:23:40 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2016-05-27 15:21:04 +1000
commitc4cb12e193e314226991deb468c1b397296dea53 (patch)
tree8e5ca4e71cc61217d222ea4b52c07f38c879b6a9 /dtc-parser.y
parentd71d25d76012896521f937bf0c69f27b1a37cdc2 (diff)
downloaddtc-c4cb12e193e314226991deb468c1b397296dea53.zip
dtc-c4cb12e193e314226991deb468c1b397296dea53.tar.gz
dtc-c4cb12e193e314226991deb468c1b397296dea53.tar.bz2
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>
Diffstat (limited to 'dtc-parser.y')
-rw-r--r--dtc-parser.y11
1 files changed, 8 insertions, 3 deletions
diff --git a/dtc-parser.y b/dtc-parser.y
index 000873f..14aaf2e 100644
--- a/dtc-parser.y
+++ b/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 */
{