From: Grant Likely Subject: [PATCH] Add description of labels to source format chapter Date: Mon, 27 Nov 2017 16:14:01 +0000 Message-ID: <20171127161401.20586-1-grant.likely@arm.com> Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secretlab-ca.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=Mh9XKz1cURTraSyTEx7qNXEuOrBQaXntlI2ckDspay8=; b=qPqt2e+98tzY00XLzvTGFZor5koIkaK1KPSNTswCedbOxsww+sEO34oHx/ggS8G4Co 2sddYudtiGDpALTVxhbzzWUyTcfaMCMLELG/BrXZ+hgIxxsmbMmfR3r+ehSgSwDqo8Pb R4yVvqvFB3k6j0CMu+IWyJtm1LWl9j0fBXrJSvCXSXaI8yyaVRrewyafMbUh4kzDtIuc RkcYGh1J/PB0ft6aE5om6osfGo9IZnxNB6b/QQbcUUp+DhecFdEeb/6sz0SZyz0qo/bZ 8wARPsVQsQ/TNGdBtFgy2imlncArYEn5bV0HzEm3vX6mC1y5JYJaF+B5aVL3xqv1IRmb xhmg== Sender: devicetree-spec-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Cc: Grant Likely 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 --- source/source-language.rst | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) mode change 100644 => 100755 source/source-language.rst diff --git a/source/source-language.rst b/source/source-language.rst old mode 100644 new mode 100755 index cefbbd8..c17aab0 --- a/source/source-language.rst +++ b/source/source-language.rst @@ -22,6 +22,33 @@ additional files. /include/ "FILE" +Labels +------ +The source format support attaching labels to any node or property data in the device tree. +Phandle and path references can be automatically generated by referencing the label instead of +explicitly specifying the phandle value or the full path to a node. +Labels are only used in the devicetree source format and are not encoded into the binary format. + +A label shall be between 1 to 31 characters in length, +be composed only of the characters in the set :numref:`label-characters`, +and must not start with a number. + +Labels are created by appending a colon (':') to the label name. +References are created by adding an ampersand ('&') suffix to the label name. + +.. tabularcolumns:: | c p{8cm} | +.. _label-characters: +.. table:: Valid characters for DTS labels + + ========= ================ + Character Description + ========= ================ + ``0-9`` digit + ``a-z`` lowercase letter + ``A-Z`` uppercase letter + ``_`` underscore + ========= ================ + Node and property definitions ----------------------------- -- 2.11.0