mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
drivers: of: add initialization code for dynamic reserved memory
This patch adds support for dynamically allocated reserved memory regions declared in device tree. Such regions are defined by 'size', 'alignment' and 'alloc-ranges' properties. 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>
This commit is contained in:
parent
e8d9d1f548
commit
3f0c820664
5 changed files with 227 additions and 2 deletions
21
include/linux/of_reserved_mem.h
Normal file
21
include/linux/of_reserved_mem.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#ifndef __OF_RESERVED_MEM_H
|
||||
#define __OF_RESERVED_MEM_H
|
||||
|
||||
struct reserved_mem {
|
||||
const char *name;
|
||||
unsigned long fdt_node;
|
||||
phys_addr_t base;
|
||||
phys_addr_t size;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_OF_RESERVED_MEM
|
||||
void fdt_init_reserved_mem(void);
|
||||
void fdt_reserved_mem_save_node(unsigned long node, const char *uname,
|
||||
phys_addr_t base, phys_addr_t size);
|
||||
#else
|
||||
static inline void fdt_init_reserved_mem(void) { }
|
||||
static inline void fdt_reserved_mem_save_node(unsigned long node,
|
||||
const char *uname, phys_addr_t base, phys_addr_t size) { }
|
||||
#endif
|
||||
|
||||
#endif /* __OF_RESERVED_MEM_H */
|
Loading…
Add table
Add a link
Reference in a new issue