MOS Source Code
Loading...
Searching...
No Matches
fdt.c File Reference
#include "libfdt_env.h"
#include <fdt.h>
#include <libfdt.h>
#include "libfdt_internal.h"
+ Include dependency graph for fdt.c:

Go to the source code of this file.

Functions

int32_t fdt_ro_probe_ (const void *fdt)
 
static int check_off_ (uint32_t hdrsize, uint32_t totalsize, uint32_t off)
 
static int check_block_ (uint32_t hdrsize, uint32_t totalsize, uint32_t base, uint32_t size)
 
size_t fdt_header_size_ (uint32_t version)
 
size_t fdt_header_size (const void *fdt)
 
int fdt_check_header (const void *fdt)
 
const voidfdt_offset_ptr (const void *fdt, int offset, unsigned int len)
 
uint32_t fdt_next_tag (const void *fdt, int startoffset, int *nextoffset)
 
int fdt_check_node_offset_ (const void *fdt, int offset)
 
int fdt_check_prop_offset_ (const void *fdt, int offset)
 
int fdt_next_node (const void *fdt, int offset, int *depth)
 
int fdt_first_subnode (const void *fdt, int offset)
 
int fdt_next_subnode (const void *fdt, int offset)
 
const char * fdt_find_string_ (const char *strtab, int tabsize, const char *s)
 
int fdt_move (const void *fdt, void *buf, int bufsize)
 

Function Documentation

◆ fdt_ro_probe_()

int32_t fdt_ro_probe_ ( const void * fdt)

Definition at line 18 of file fdt.c.

Referenced by fdt_get_name(), and fdt_get_string().

◆ check_off_()

static int check_off_ ( uint32_t hdrsize,
uint32_t totalsize,
uint32_t off )
static

Definition at line 52 of file fdt.c.

Referenced by check_block_(), and fdt_check_header().

◆ check_block_()

static int check_block_ ( uint32_t hdrsize,
uint32_t totalsize,
uint32_t base,
uint32_t size )
static

Definition at line 57 of file fdt.c.

Referenced by fdt_check_header().

+ Here is the call graph for this function:

◆ fdt_header_size_()

size_t fdt_header_size_ ( uint32_t version)

fdt_header_size_ - internal function to get header size from a version number

Version
: devicetree version number

Return: size of DTB header in bytes

Definition at line 69 of file fdt.c.

Referenced by fdt_header_size().

◆ fdt_header_size()

size_t fdt_header_size ( const void * fdt)

fdt_header_size - return the size of the tree's header @fdt: pointer to a flattened device tree

Return: size of DTB header in bytes

Definition at line 83 of file fdt.c.

Referenced by fdt_check_header().

+ Here is the call graph for this function:

◆ fdt_check_header()

int fdt_check_header ( const void * fdt)

fdt_check_header - sanity check a device tree header @fdt: pointer to data which might be a flattened device tree

fdt_check_header() checks that the given buffer contains what appears to be a flattened device tree, and that the header contains valid information (to the extent that can be determined from the header alone).

returns: 0, if the buffer appears to contain a valid device tree -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_TRUNCATED, standard meanings, as above

Definition at line 89 of file fdt.c.

+ Here is the call graph for this function:

◆ fdt_offset_ptr()

const void * fdt_offset_ptr ( const void * fdt,
int offset,
unsigned int len )

Definition at line 140 of file fdt.c.

Referenced by fdt_next_tag(), and fdt_offset_ptr_w().

+ Here is the call graph for this function:

◆ fdt_next_tag()

uint32_t fdt_next_tag ( const void * fdt,
int startoffset,
int * nextoffset )

Definition at line 162 of file fdt.c.

Referenced by fdt_add_subnode_namelen(), fdt_check_node_offset_(), fdt_check_prop_offset_(), fdt_finish(), fdt_next_node(), fdt_open_into(), and nextprop_().

+ Here is the call graph for this function:

◆ fdt_check_node_offset_()

int fdt_check_node_offset_ ( const void * fdt,
int offset )

Definition at line 223 of file fdt.c.

Referenced by fdt_add_property_(), fdt_first_property_offset(), fdt_get_name(), and fdt_next_node().

+ Here is the call graph for this function:

◆ fdt_check_prop_offset_()

int fdt_check_prop_offset_ ( const void * fdt,
int offset )

Definition at line 235 of file fdt.c.

Referenced by fdt_get_property_by_offset_(), and fdt_next_property_offset().

+ Here is the call graph for this function:

◆ fdt_next_node()

◆ fdt_first_subnode()

int fdt_first_subnode ( const void * fdt,
int offset )

fdt_first_subnode() - get offset of first direct subnode @fdt: FDT blob @offset: Offset of node to check

Return: offset of first subnode, or -FDT_ERR_NOTFOUND if there is none

Definition at line 287 of file fdt.c.

Referenced by dt_node::begin().

+ Here is the call graph for this function:

◆ fdt_next_subnode()

int fdt_next_subnode ( const void * fdt,
int offset )

fdt_next_subnode() - get offset of next direct subnode @fdt: FDT blob @offset: Offset of previous subnode

After first calling fdt_first_subnode(), call this function repeatedly to get direct subnodes of a parent node.

Return: offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more subnodes

Definition at line 298 of file fdt.c.

Referenced by dt_node::iterator::operator++().

+ Here is the call graph for this function:

◆ fdt_find_string_()

const char * fdt_find_string_ ( const char * strtab,
int tabsize,
const char * s )

Definition at line 315 of file fdt.c.

Referenced by fdt_find_add_string_(), and fdt_find_add_string_().

+ Here is the call graph for this function:

◆ fdt_move()

int fdt_move ( const void * fdt,
void * buf,
int bufsize )

fdt_move - move a device tree around in memory @fdt: pointer to the device tree to move @buf: pointer to memory where the device is to be moved @bufsize: size of the memory space at buf

fdt_move() relocates, if possible, the device tree blob located at fdt to the buffer at buf of size bufsize. The buffer may overlap with the existing device tree blob at fdt. Therefore, fdt_move(fdt, fdt, fdt_totalsize(fdt)) should always succeed.

returns: 0, on success -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, standard meanings

Definition at line 327 of file fdt.c.

Referenced by fdt_open_into().

+ Here is the call graph for this function: