BSDL Device Tree Compiler
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Classes | Enumerations | Functions
dtc::dtb Namespace Reference

Classes

struct  output_writer
 
class  binary_writer
 
class  asm_writer
 
struct  header
 

Enumerations

enum  token_type {
  FDT_BEGIN_NODE = 0x00000001, FDT_END_NODE = 0x00000002, FDT_PROP = 0x00000003, FDT_NOP = 0x00000004,
  FDT_END = 0x00000009
}
 

Functions

const char * token_type_name (token_type t)
 

Detailed Description

The dtb namespace contains code related to the generation of device tree blobs, the binary representation of flattened device trees. The abstract tree representation calls into this code to generate the output.

Enumeration Type Documentation

The token types in the DTB, as defined by ยง7.4.1 of the ePAPR specification. All of these values are written in big-endian format in the output.

Enumerator:
FDT_BEGIN_NODE 

Marker indicating the start of a node in the tree. This is followed by the nul-terminated name. If a unit address is specified, then the name also contains the address, with an @ symbol between the end of the name and the start of the address.

The name is then padded such that the next token begins on a 4-byte boundary. The node may contain properties, other nodes, both, or be empty.

FDT_END_NODE 

Marker indicating the end of a node.

FDT_PROP 

The start of a property. This is followed by two 32-bit big-endian values. The first indicates the length of the property value, the second its index in the strings table. It is then followed by the property value, if the value is of non-zero length.

FDT_NOP 

Ignored token. May be used for padding inside DTB nodes.

FDT_END 

Marker indicating the end of the tree.

Function Documentation

const char* dtc::dtb::token_type_name ( token_type  t)

Returns the token as a string. This is used for debugging and for printing human-friendly error messages about malformed DTB input.