summaryrefslogtreecommitdiffstats
path: root/include/linux/of_fdt.h
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2014-02-28 14:42:47 +0100
committerGrant Likely <grant.likely@linaro.org>2014-03-11 17:26:47 +0000
commite8d9d1f5485b52ec3c4d7af839e6914438f6c285 (patch)
tree40ee498612d54b3983a96406b1897dd875376cf5 /include/linux/of_fdt.h
parentf08ad1deaaf83b7e7369716949b34dadc530be01 (diff)
downloadlinux-e8d9d1f5485b52ec3c4d7af839e6914438f6c285.tar.gz
linux-e8d9d1f5485b52ec3c4d7af839e6914438f6c285.tar.bz2
linux-e8d9d1f5485b52ec3c4d7af839e6914438f6c285.zip
drivers: of: add initialization code for static reserved memory
This patch adds support for static (defined by 'reg' property) reserved memory regions declared in device tree. Memory blocks can be reliably reserved only during early boot. This must happen before the whole memory management subsystem is initialized, because we need to ensure that the given contiguous blocks are not yet allocated by kernel. Also it must happen before kernel mappings for the whole low memory are created, to ensure that there will be no mappings (for reserved blocks). Typically, all this happens before device tree structures are unflattened, so we need to get reserved memory layout directly from fdt. Based on previous code provided by Josh Cartwright <joshc@codeaurora.org> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'include/linux/of_fdt.h')
-rw-r--r--include/linux/of_fdt.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 2b77058a7335..ddd7219af8ac 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -98,7 +98,10 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
int depth, void *data);
extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
int depth, void *data);
+extern void early_init_fdt_scan_reserved_mem(void);
extern void early_init_dt_add_memory_arch(u64 base, u64 size);
+extern int early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size,
+ bool no_map);
extern void * early_init_dt_alloc_memory_arch(u64 size, u64 align);
extern u64 dt_mem_next_cell(int s, __be32 **cellp);
@@ -118,6 +121,7 @@ extern void unflatten_and_copy_device_tree(void);
extern void early_init_devtree(void *);
extern void early_get_first_memblock_info(void *, phys_addr_t *);
#else /* CONFIG_OF_FLATTREE */
+static inline void early_init_fdt_scan_reserved_mem(void) {}
static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
static inline void unflatten_device_tree(void) {}
static inline void unflatten_and_copy_device_tree(void) {}