Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce6a76e2 authored by Rob Herring's avatar Rob Herring Committed by Joonwoo Park
Browse files

of/fdt: introduce of_get_flat_dt_size



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: default avatarRob Herring <robh@kernel.org>
Tested-by: default avatarGrant Likely <grant.likely@linaro.org>
Tested-by: default avatarStephen Chivers <schivers@csc.com>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


Git-commit: c0556d3f2c3f42eaed049139ce6f0899ecdb0217
Signed-off-by: default avatarJoonwoo Park <joonwoop@codeaurora.org>
parent cba3b50c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -554,6 +554,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
 *
+1 −0
Original line number Diff line number Diff line
@@ -89,6 +89,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);

/*
 * early_init_dt_scan_chosen - scan the device tree for ramdisk and bootargs