]> git.karo-electronics.de Git - linux-beck.git/commitdiff
of/fdt: introduce of_get_flat_dt_size
authorRob Herring <robh@kernel.org>
Tue, 22 Apr 2014 17:55:10 +0000 (12:55 -0500)
committerRob Herring <robh@kernel.org>
Wed, 30 Apr 2014 05:59:18 +0000 (00:59 -0500)
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>
drivers/of/fdt.c
include/linux/of_fdt.h

index d9e64504cda06970479625e39ca2e72001cd86b4..358bcf0500d25bc5966fc8f5aa227b1eeb25ad63 100644 (file)
@@ -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
  *
index 348dae2c8a3c67a2a13135c4a7e5b05f67097a7d..e10099c95999bd255561ec5cece1aafdf3c9dbb2 100644 (file)
@@ -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);