devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* labels within a property value
@ 2016-12-12  1:26 Frank Rowand
       [not found] ` <584DFCB6.1070403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Rowand @ 2016-12-12  1:26 UTC (permalink / raw)
  To: David Gibson, Devicetree Compiler

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-12  3:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-12  1:26 labels within a property value Frank Rowand
     [not found] ` <584DFCB6.1070403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-12-12  3:23   ` David Gibson

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).