|
|
@@ -1,12 +1,9 @@
|
|
|
+/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
/*
|
|
|
* Definitions for working with the Flattened Device Tree data format
|
|
|
*
|
|
|
* Copyright 2009 Benjamin Herrenschmidt, IBM Corp
|
|
|
* benh@kernel.crashing.org
|
|
|
- *
|
|
|
- * This program is free software; you can redistribute it and/or
|
|
|
- * modify it under the terms of the GNU General Public License
|
|
|
- * version 2 as published by the Free Software Foundation.
|
|
|
*/
|
|
|
|
|
|
#ifndef _LINUX_OF_FDT_H
|
|
|
@@ -47,6 +44,12 @@ extern void *initial_boot_params;
|
|
|
extern char __dtb_start[];
|
|
|
extern char __dtb_end[];
|
|
|
|
|
|
+/* Other Prototypes */
|
|
|
+extern u64 of_flat_dt_translate_address(unsigned long node);
|
|
|
+extern void of_fdt_limit_memory(int limit);
|
|
|
+#endif /* CONFIG_OF_FLATTREE */
|
|
|
+
|
|
|
+#ifdef CONFIG_OF_EARLY_FLATTREE
|
|
|
/* For scanning the flat device-tree at boot time */
|
|
|
extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname,
|
|
|
int depth, void *data),
|
|
|
@@ -77,7 +80,6 @@ extern void early_init_dt_add_memory_arch(u64 base, u64 size);
|
|
|
extern int early_init_dt_mark_hotplug_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, const __be32 **cellp);
|
|
|
|
|
|
/* Early flat tree scan hooks */
|
|
|
@@ -97,16 +99,14 @@ extern void unflatten_device_tree(void);
|
|
|
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 *);
|
|
|
-extern u64 of_flat_dt_translate_address(unsigned long node);
|
|
|
-extern void of_fdt_limit_memory(int limit);
|
|
|
-#else /* CONFIG_OF_FLATTREE */
|
|
|
+#else /* CONFIG_OF_EARLY_FLATTREE */
|
|
|
static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; }
|
|
|
static inline void early_init_fdt_scan_reserved_mem(void) {}
|
|
|
static inline void early_init_fdt_reserve_self(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) {}
|
|
|
-#endif /* CONFIG_OF_FLATTREE */
|
|
|
+#endif /* CONFIG_OF_EARLY_FLATTREE */
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
#endif /* _LINUX_OF_FDT_H */
|