A Device Tree Node Example
A Simple Node
A very simple device tree[1] node sample.
/ {
node@0 {
a-string-property = "this is a string";
a-string-list-property = "a string", "b string";
a-byte-data-property = [0x01, 0x02, 0x03, 0x04];
a-cell-property = <1 2 3 4>;
child-node@0 {
first-child-property;
second-child-property = <1>;
reference-node = <&node1>; // a phandle which reference to another node.
};
};
}
- node@0 is a node called
node
with index0
. - &node1 is a phandle points to another node, which
node1
is a lable, not a node name. String
as a property- A string property use double quote to enclose string.
- e.g.
a-string-property = "this is a string"
String List
as a property- A string list contains a list of strings. Each string use comma to divide them into a list.
- e.g.
a-string-list-property = "a string", "b string";
Byte List
as a property- A byte list contains a list of bytes.
- e.g.
a-byte-list-property = [0x01, 0x02, 0x03, 0x04]
.
Syntqx Highlight !
Every end of bracket of a node needs a semicolon;