aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index f2dd23a32267..07496560e5b9 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -164,11 +164,14 @@ static void *unflatten_dt_alloc(void **mem, unsigned long size,
164 * unflatten_dt_node - Alloc and populate a device_node from the flat tree 164 * unflatten_dt_node - Alloc and populate a device_node from the flat tree
165 * @blob: The parent device tree blob 165 * @blob: The parent device tree blob
166 * @mem: Memory chunk to use for allocating device nodes and properties 166 * @mem: Memory chunk to use for allocating device nodes and properties
167 * @p: pointer to node in flat tree 167 * @poffset: pointer to node in flat tree
168 * @dad: Parent struct device_node 168 * @dad: Parent struct device_node
169 * @nodepp: The device_node tree created by the call
169 * @fpsize: Size of the node path up at the current depth. 170 * @fpsize: Size of the node path up at the current depth.
171 * @dryrun: If true, do not allocate device nodes but still calculate needed
172 * memory size
170 */ 173 */
171static void * unflatten_dt_node(void *blob, 174static void * unflatten_dt_node(const void *blob,
172 void *mem, 175 void *mem,
173 int *poffset, 176 int *poffset,
174 struct device_node *dad, 177 struct device_node *dad,
@@ -378,7 +381,7 @@ static void * unflatten_dt_node(void *blob,
378 * @dt_alloc: An allocator that provides a virtual address to memory 381 * @dt_alloc: An allocator that provides a virtual address to memory
379 * for the resulting tree 382 * for the resulting tree
380 */ 383 */
381static void __unflatten_device_tree(void *blob, 384static void __unflatten_device_tree(const void *blob,
382 struct device_node **mynodes, 385 struct device_node **mynodes,
383 void * (*dt_alloc)(u64 size, u64 align)) 386 void * (*dt_alloc)(u64 size, u64 align))
384{ 387{
@@ -441,7 +444,7 @@ static void *kernel_tree_alloc(u64 size, u64 align)
441 * pointers of the nodes so the normal device-tree walking functions 444 * pointers of the nodes so the normal device-tree walking functions
442 * can be used. 445 * can be used.
443 */ 446 */
444void of_fdt_unflatten_tree(unsigned long *blob, 447void of_fdt_unflatten_tree(const unsigned long *blob,
445 struct device_node **mynodes) 448 struct device_node **mynodes)
446{ 449{
447 __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc); 450 __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc);
@@ -1024,6 +1027,11 @@ void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
1024 return __va(memblock_alloc(size, align)); 1027 return __va(memblock_alloc(size, align));
1025} 1028}
1026#else 1029#else
1030void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
1031{
1032 WARN_ON(1);
1033}
1034
1027int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, 1035int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
1028 phys_addr_t size, bool nomap) 1036 phys_addr_t size, bool nomap)
1029{ 1037{
@@ -1031,6 +1039,12 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
1031 &base, &size, nomap ? " (nomap)" : ""); 1039 &base, &size, nomap ? " (nomap)" : "");
1032 return -ENOSYS; 1040 return -ENOSYS;
1033} 1041}
1042
1043void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
1044{
1045 WARN_ON(1);
1046 return NULL;
1047}
1034#endif 1048#endif
1035 1049
1036bool __init early_init_dt_verify(void *params) 1050bool __init early_init_dt_verify(void *params)