From: Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: David Gibson
<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>,
Devicetree Compiler
<devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: labels within a property value
Date: Sun, 11 Dec 2016 17:26:14 -0800 [thread overview]
Message-ID: <584DFCB6.1070403@gmail.com> (raw)
Hi David,
The ePAPR in Appendix A (page 96) says:
Labels may also appear before or after any component of a property value, or between cells of
a cell array, or between bytes of a bytestring. Examples:
reg = reglabel: <0 sizelabel: 0x1000000>;
prop = [ab cd ef byte4: 00 ff fe];
str = start: "string value" end: ;
The dtc compiler indeed allows placing a label inside a property value.
But when I try to use that label I get the error:
ERROR (phandle_references): Reference to non-existent node or label "DATA_1"
or
ERROR (path_references): Reference to non-existent node or label "DATA_1"
The three test dts files are below.
test_label_b.dts has the usage of the label commented out (compiles ok).
test_label_c.dts tries to use the data label as a phandle (gets first error).
test_label_d.dts tries to use the data label as a path (gets second error).
I am trying to figure out how a data label could be used in a
reasonable manner. Is this maybe a construct left over from
open firmware? Or am I trying to use it incorrectly? If there
is a valid use, can you provide an example?
$ cat test_label_b.dts
/dts-v1/;
/ {
#address-cells = < 0x1 >;
#size-cells = <0x1>;
soc {
#address-cells = < 0x1 >;
#size-cells = <0x1>;
PIC_3: pic@100 {
reg = < DATA_1: 0x100 DATA_2: 0x20 >;
interrupt-controller;
};
};
uart@200 {
reg = <0x200 0x10>;
interrupt-parent = < &PIC_3 >;
/* my_prop = < &DATA_1 >; */
};
};
$ cat test_label_c.dts
/dts-v1/;
/ {
#address-cells = < 0x1 >;
#size-cells = <0x1>;
soc {
#address-cells = < 0x1 >;
#size-cells = <0x1>;
PIC_3: pic@100 {
reg = < DATA_1: 0x100 DATA_2: 0x20 >;
interrupt-controller;
};
};
uart@200 {
reg = <0x200 0x10>;
interrupt-parent = < &PIC_3 >;
my_prop = < &DATA_1 >;
};
};
Thanks,
Frank
next reply other threads:[~2016-12-12 1:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-12 1:26 Frank Rowand [this message]
[not found] ` <584DFCB6.1070403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-12-12 3:23 ` labels within a property value David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=584DFCB6.1070403@gmail.com \
--to=frowand.list-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).