All of lore.kernel.org
 help / color / mirror / Atom feed
* [DTSpec PATCH] Add items to Devicetree Source Format chapter
@ 2016-06-03 19:29 Frank Rowand
       [not found] ` <5751DA8F.2090708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Rowand @ 2016-06-03 19:29 UTC (permalink / raw)
  To: devicetree-spec-u79uwXL29TY76Z2rM5mHXA

From: Frank Rowand <frank.rowand-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>

Add items to Devicetree Source Format chapter

- Add naming convention for DTS files and DTS include files
- Add /include/ compiler directive
- Add ";" to end of node definition
- Add /delete-node/ and /delete-property/
- Add arithmetic, bitwise, and logical expressions

Note that cpp directives are not included in this patch, and
are not yet specified in this appendix.

Signed-off-by: Frank Rowand <frank.rowand-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>
---
 source/source-language.rst |   60 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 59 insertions(+), 1 deletion(-)

Index: b/source/source-language.rst
===================================================================
--- a/source/source-language.rst
+++ b/source/source-language.rst
@@ -9,6 +9,19 @@ devicetree in the form expected by the k
 not a formal syntax definition of DTS, but describes the basic
 constructs used to represent devicetrees.
 
+The name of DTS files should end with ".dts".
+
+Compiler directives
+-------------------
+
+Other source files can be included from a DTS file.  The name of include
+files should end with ".dtsi".  Included files can in turn include
+additional files.
+
+::
+
+    /include/ "FILE"
+
 Node and property definitions
 -----------------------------
 
@@ -21,11 +34,18 @@ preceded by a label.
     [label:] node-name[@unit-address] {
         [properties definitions]
         [child nodes]
-    }
+    };
 
 Nodes may contain property definitions and/or child node definitions. If
 both are present, properties shall come before child nodes.
 
+Previously defined nodes may be deleted.
+
+::
+
+    /delete-node/ node-name;
+    /delete-node/ &label;
+
 Property definitions are name value pairs in the form:
 
 ::
@@ -39,6 +59,12 @@ form:
 
         [label:] property-name;
 
+Previously defined properties may be deleted.
+
+::
+
+    /delete-property/ property-name;
+
 Property values may be defined as an array of 32-bit integer cells, as
 null-terminated strings, as bytestrings or a combination of these.
 
@@ -48,6 +74,38 @@ null-terminated strings, as bytestrings
 ::
 
         interrupts = <17 0xc>;
+-  values may be represented as arithmetic, bitwise, or logical expressions
+   within parenthesis.
+
+::
+
+    Arithmetic operators
+
+    +   add
+    -   subtract
+    *   multiply
+    /   divide
+    <<  left shift
+    >>  right shift
+
+::
+
+    Bitwise operators
+
+    &&   and
+    ||   or
+
+::
+
+    Logical operators
+
+    <    less than
+    >    greater than
+    <=   less than or equal
+    >=   greater than or equal
+    ==   equal
+    !=   not equal
+
 
 -  A 64-bit value is represented with two 32-bit cells. Example:
 

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

* Re: [DTSpec PATCH] Add items to Devicetree Source Format chapter
       [not found] ` <5751DA8F.2090708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2016-06-07 14:31   ` Rob Herring
       [not found]     ` <CAL_JsqKi9fOz3CEK-os8WE4BEuYi28METxWN0GMpW95wAXYFMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2016-06-07 14:31 UTC (permalink / raw)
  To: Frank Rowand; +Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA

On Fri, Jun 3, 2016 at 2:29 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> From: Frank Rowand <frank.rowand-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>
>
> Add items to Devicetree Source Format chapter
>
> - Add naming convention for DTS files and DTS include files
> - Add /include/ compiler directive
> - Add ";" to end of node definition
> - Add /delete-node/ and /delete-property/
> - Add arithmetic, bitwise, and logical expressions
>
> Note that cpp directives are not included in this patch, and
> are not yet specified in this appendix.
>
> Signed-off-by: Frank Rowand <frank.rowand-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>
> ---
>  source/source-language.rst |   60 ++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 59 insertions(+), 1 deletion(-)
>
> Index: b/source/source-language.rst
> ===================================================================
> --- a/source/source-language.rst
> +++ b/source/source-language.rst
> @@ -9,6 +9,19 @@ devicetree in the form expected by the k
>  not a formal syntax definition of DTS, but describes the basic
>  constructs used to represent devicetrees.
>
> +The name of DTS files should end with ".dts".
> +
> +Compiler directives
> +-------------------
> +
> +Other source files can be included from a DTS file.  The name of include
> +files should end with ".dtsi".  Included files can in turn include
> +additional files.
> +
> +::
> +
> +    /include/ "FILE"
> +
>  Node and property definitions
>  -----------------------------
>
> @@ -21,11 +34,18 @@ preceded by a label.
>      [label:] node-name[@unit-address] {
>          [properties definitions]
>          [child nodes]
> -    }
> +    };
>
>  Nodes may contain property definitions and/or child node definitions. If
>  both are present, properties shall come before child nodes.
>
> +Previously defined nodes may be deleted.
> +
> +::
> +
> +    /delete-node/ node-name;
> +    /delete-node/ &label;
> +
>  Property definitions are name value pairs in the form:
>
>  ::
> @@ -39,6 +59,12 @@ form:
>
>          [label:] property-name;
>
> +Previously defined properties may be deleted.
> +
> +::
> +
> +    /delete-property/ property-name;
> +
>  Property values may be defined as an array of 32-bit integer cells, as
>  null-terminated strings, as bytestrings or a combination of these.
>
> @@ -48,6 +74,38 @@ null-terminated strings, as bytestrings
>  ::
>
>          interrupts = <17 0xc>;
> +-  values may be represented as arithmetic, bitwise, or logical expressions
> +   within parenthesis.
> +
> +::
> +
> +    Arithmetic operators
> +
> +    +   add
> +    -   subtract
> +    *   multiply
> +    /   divide
> +    <<  left shift
> +    >>  right shift
> +
> +::
> +
> +    Bitwise operators
> +
> +    &&   and
> +    ||   or

Is this correct that these are not logical operators? From the dtc
source in dtc-parser.y, it looks like both bitwise and logical ops are
supported and XOR.

> +
> +::
> +
> +    Logical operators
> +
> +    <    less than
> +    >    greater than
> +    <=   less than or equal
> +    >=   greater than or equal
> +    ==   equal
> +    !=   not equal
> +
>
>  -  A 64-bit value is represented with two 32-bit cells. Example:
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree-spec" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [DTSpec PATCH] Add items to Devicetree Source Format chapter
       [not found]     ` <CAL_JsqKi9fOz3CEK-os8WE4BEuYi28METxWN0GMpW95wAXYFMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2016-06-07 20:46       ` Frank Rowand
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Rowand @ 2016-06-07 20:46 UTC (permalink / raw)
  To: Rob Herring; +Cc: devicetree-spec-u79uwXL29TY76Z2rM5mHXA

On 06/07/16 07:31, Rob Herring wrote:
> On Fri, Jun 3, 2016 at 2:29 PM, Frank Rowand <frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> From: Frank Rowand <frank.rowand-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>
>>
>> Add items to Devicetree Source Format chapter
>>
>> - Add naming convention for DTS files and DTS include files
>> - Add /include/ compiler directive
>> - Add ";" to end of node definition
>> - Add /delete-node/ and /delete-property/
>> - Add arithmetic, bitwise, and logical expressions
>>
>> Note that cpp directives are not included in this patch, and
>> are not yet specified in this appendix.
>>
>> Signed-off-by: Frank Rowand <frank.rowand-mEdOJwZ7QcZBDgjK7y7TUQ@public.gmane.org>
>> ---
>>  source/source-language.rst |   60 ++++++++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 59 insertions(+), 1 deletion(-)
>>
>> Index: b/source/source-language.rst
>> ===================================================================
>> --- a/source/source-language.rst
>> +++ b/source/source-language.rst

< snip >

>> +
>> +    Bitwise operators
>> +
>> +    &&   and
>> +    ||   or
> 
> Is this correct that these are not logical operators? From the dtc
> source in dtc-parser.y, it looks like both bitwise and logical ops are
> supported and XOR.

Thanks for catching that.  It was a thinko, plus I did not catch the XOR.
I also missed NOT and TERNARY.  New patch on the way.

> 
>> +
>> +::
>> +
>> +    Logical operators
>> +
>> +    <    less than
>> +    >    greater than
>> +    <=   less than or equal
>> +    >=   greater than or equal
>> +    ==   equal
>> +    !=   not equal
>> +
>>
>>  -  A 64-bit value is represented with two 32-bit cells. Example:
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree-spec" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2016-06-07 20:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-03 19:29 [DTSpec PATCH] Add items to Devicetree Source Format chapter Frank Rowand
     [not found] ` <5751DA8F.2090708-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-07 14:31   ` Rob Herring
     [not found]     ` <CAL_JsqKi9fOz3CEK-os8WE4BEuYi28METxWN0GMpW95wAXYFMg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-07 20:46       ` Frank Rowand

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.