Skip to content

Commit 1c64f9a

Browse files
committed
Add description of labels to source format chapter
The source format chapter was missing details about the characters that are valid for labels and what labels are for. Add a paragraph to cover those details. Signed-off-by: Grant Likely <[email protected]>
1 parent 2416cb8 commit 1c64f9a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

source/source-language.rst

100644100755
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@ additional files.
2222

2323
/include/ "FILE"
2424

25+
Labels
26+
------
27+
28+
The source format allows labels to be attached to any node or property value in the device tree.
29+
Phandle and path references can be automatically generated by referencing a label instead of
30+
explicitly specifying a phandle value or the full path to a node.
31+
Labels are only used in the devicetree source format and are not encoded into the DTB binary.
32+
33+
A label shall be between 1 to 31 characters in length,
34+
be composed only of the characters in the set :numref:`label-characters`,
35+
and must not start with a number.
36+
37+
Labels are created by appending a colon (':') to the label name.
38+
References are created by prefixing the label name with an ampersand ('&').
39+
40+
.. tabularcolumns:: | c p{8cm} |
41+
.. _label-characters:
42+
.. table:: Valid characters for DTS labels
43+
44+
========= ================
45+
Character Description
46+
========= ================
47+
``0-9`` digit
48+
``a-z`` lowercase letter
49+
``A-Z`` uppercase letter
50+
``_`` underscore
51+
========= ================
52+
2553
Node and property definitions
2654
-----------------------------
2755

0 commit comments

Comments
 (0)