BSDL Device Tree Compiler
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | List of all members
dtc::fdt::device_tree Class Reference

Public Types

enum  phandle_format { LINUX, EPAPR, BOTH }
 
typedef std::vector< std::pair
< string, string > > 
node_path
 

Public Member Functions

nodereferenced_node (property_value &v)
 
void write_binary (int fd)
 
void write_asm (int fd)
 
void write_dts (int fd)
 
 device_tree ()
 
void parse_dtb (const char *fn, FILE *depfile)
 
void parse_dts (const char *fn, FILE *depfile)
 
 ~device_tree ()
 
bool is_valid ()
 
void set_phandle_format (phandle_format f)
 
nodeget_root () const
 
void set_boot_cpu (uint32_t cpu)
 
void sort ()
 
void add_include_path (const char *path)
 
void set_empty_reserve_map_entries (uint32_t e)
 
void set_blob_minimum_size (uint32_t s)
 
void set_blob_padding (uint32_t p)
 

Detailed Description

Class encapsulating the entire parsed FDT. This is the top-level class, which parses the entire DTS representation and write out the finished version.

Member Typedef Documentation

typedef std::vector<std::pair<string,string> > dtc::fdt::device_tree::node_path

Type used for node paths. A node path is sequence of names and unit addresses.

Member Enumeration Documentation

Name that we should use for phandle nodes.

Enumerator:
LINUX 

linux,phandle

EPAPR 

phandle

BOTH 

Create both nodes.

Constructor & Destructor Documentation

dtc::fdt::device_tree::device_tree ( )
inline

Default constructor. Creates a valid, but empty FDT.

dtc::fdt::device_tree::~device_tree ( )
inline

Destroy the tree and any input buffers that it holds.

Member Function Documentation

void dtc::fdt::device_tree::add_include_path ( const char *  path)
inline

Adds a path to search for include files. The argument must be a nul-terminated string representing the path. The device tree keeps a pointer to this string, but does not own it: the caller is responsible for freeing it if required.

node* dtc::fdt::device_tree::get_root ( ) const
inline

Returns a pointer to the root node of this tree. No ownership transfer.

bool dtc::fdt::device_tree::is_valid ( )
inline

Returns whether this tree is valid.

void dtc::fdt::device_tree::parse_dtb ( const char *  fn,
FILE *  depfile 
)
inline

Constructs a device tree from the specified file name, referring to a file that contains a device tree blob.

void dtc::fdt::device_tree::parse_dts ( const char *  fn,
FILE *  depfile 
)
inline

Constructs a device tree from the specified file name, referring to a file that contains device tree source.

node* dtc::fdt::device_tree::referenced_node ( property_value v)
inline

Returns the node referenced by the property. If this is a tree that is in source form, then we have a string that we can use to index the cross_references array and so we can just look that up.

void dtc::fdt::device_tree::set_blob_minimum_size ( uint32_t  s)
inline

Sets the minimum size, in bytes, of the blob.

void dtc::fdt::device_tree::set_blob_padding ( uint32_t  p)
inline

Sets the amount of padding to add to the blob.

void dtc::fdt::device_tree::set_boot_cpu ( uint32_t  cpu)
inline

Sets the physical boot CPU.

void dtc::fdt::device_tree::set_empty_reserve_map_entries ( uint32_t  e)
inline

Sets the number of empty reserve map entries to add.

void dtc::fdt::device_tree::set_phandle_format ( phandle_format  f)
inline

Sets the format for writing phandle properties.

void dtc::fdt::device_tree::sort ( )
inline

Sorts the tree. Useful for debugging device trees.

void dtc::fdt::device_tree::write_asm ( int  fd)
inline

Writes this FDT as an assembly representation of the DTB to the specified output. The result can then be assembled and linked into a program.

void dtc::fdt::device_tree::write_binary ( int  fd)
inline

Writes this FDT as a DTB to the specified output.

void dtc::fdt::device_tree::write_dts ( int  fd)
inline

Writes the tree in DTS (source) format.


The documentation for this class was generated from the following file: