Skip to content

Commit

Permalink
of/fdt: introduce of_get_flat_dt_size
Browse files Browse the repository at this point in the history
Add a wrapper function to retrieve the FDT size from the FDT header. This
is primarily to avoid libfdt include paths for the whole kernel.

Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Grant Likely <grant.likely@linaro.org>
Tested-by: Stephen Chivers <schivers@csc.com>
  • Loading branch information
Rob Herring committed Apr 30, 2014
1 parent 1d1a661 commit c0556d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,14 @@ unsigned long __init of_get_flat_dt_root(void)
return 0;
}

/**
* of_get_flat_dt_size - Return the total size of the FDT
*/
int __init of_get_flat_dt_size(void)
{
return fdt_totalsize(initial_boot_params);
}

/**
* of_get_flat_dt_prop - Given a node in the flat blob, return the property ptr
*
Expand Down
1 change: 1 addition & 0 deletions include/linux/of_fdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ extern const void *of_get_flat_dt_prop(unsigned long node, const char *name,
extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
extern int of_flat_dt_match(unsigned long node, const char *const *matches);
extern unsigned long of_get_flat_dt_root(void);
extern int of_get_flat_dt_size(void);

extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
int depth, void *data);
Expand Down

0 comments on commit c0556d3

Please sign in to comment.