diff options
Diffstat (limited to 'include/linux/of_fdt.h')
| -rw-r--r-- | include/linux/of_fdt.h | 79 |
1 files changed, 50 insertions, 29 deletions
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 41d432b13553..71e1a916d3fa 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -42,45 +42,66 @@ | |||
| 42 | * ends when size is 0 | 42 | * ends when size is 0 |
| 43 | */ | 43 | */ |
| 44 | struct boot_param_header { | 44 | struct boot_param_header { |
| 45 | u32 magic; /* magic word OF_DT_HEADER */ | 45 | __be32 magic; /* magic word OF_DT_HEADER */ |
| 46 | u32 totalsize; /* total size of DT block */ | 46 | __be32 totalsize; /* total size of DT block */ |
| 47 | u32 off_dt_struct; /* offset to structure */ | 47 | __be32 off_dt_struct; /* offset to structure */ |
| 48 | u32 off_dt_strings; /* offset to strings */ | 48 | __be32 off_dt_strings; /* offset to strings */ |
| 49 | u32 off_mem_rsvmap; /* offset to memory reserve map */ | 49 | __be32 off_mem_rsvmap; /* offset to memory reserve map */ |
| 50 | u32 version; /* format version */ | 50 | __be32 version; /* format version */ |
| 51 | u32 last_comp_version; /* last compatible version */ | 51 | __be32 last_comp_version; /* last compatible version */ |
| 52 | /* version 2 fields below */ | 52 | /* version 2 fields below */ |
| 53 | u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ | 53 | __be32 boot_cpuid_phys; /* Physical CPU id we're booting on */ |
| 54 | /* version 3 fields below */ | 54 | /* version 3 fields below */ |
| 55 | u32 dt_strings_size; /* size of the DT strings block */ | 55 | __be32 dt_strings_size; /* size of the DT strings block */ |
| 56 | /* version 17 fields below */ | 56 | /* version 17 fields below */ |
| 57 | u32 dt_struct_size; /* size of the DT structure block */ | 57 | __be32 dt_struct_size; /* size of the DT structure block */ |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | #if defined(CONFIG_OF_FLATTREE) | ||
| 61 | /* TBD: Temporary export of fdt globals - remove when code fully merged */ | ||
| 62 | extern int __initdata dt_root_addr_cells; | ||
| 63 | extern int __initdata dt_root_size_cells; | ||
| 64 | extern struct boot_param_header *initial_boot_params; | ||
| 65 | |||
| 60 | /* For scanning the flat device-tree at boot time */ | 66 | /* For scanning the flat device-tree at boot time */ |
| 61 | extern int __init of_scan_flat_dt(int (*it)(unsigned long node, | 67 | extern char *find_flat_dt_string(u32 offset); |
| 62 | const char *uname, int depth, | 68 | extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, |
| 63 | void *data), | 69 | int depth, void *data), |
| 64 | void *data); | 70 | void *data); |
| 65 | extern void __init *of_get_flat_dt_prop(unsigned long node, const char *name, | 71 | extern void *of_get_flat_dt_prop(unsigned long node, const char *name, |
| 66 | unsigned long *size); | 72 | unsigned long *size); |
| 67 | extern int __init of_flat_dt_is_compatible(unsigned long node, | 73 | extern int of_flat_dt_is_compatible(unsigned long node, const char *name); |
| 68 | const char *name); | 74 | extern unsigned long of_get_flat_dt_root(void); |
| 69 | extern unsigned long __init of_get_flat_dt_root(void); | 75 | extern void early_init_dt_scan_chosen_arch(unsigned long node); |
| 76 | extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, | ||
| 77 | int depth, void *data); | ||
| 78 | extern void early_init_dt_check_for_initrd(unsigned long node); | ||
| 79 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | ||
| 80 | int depth, void *data); | ||
| 81 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | ||
| 82 | extern u64 early_init_dt_alloc_memory_arch(u64 size, u64 align); | ||
| 83 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | ||
| 84 | |||
| 85 | /* | ||
| 86 | * If BLK_DEV_INITRD, the fdt early init code will call this function, | ||
| 87 | * to be provided by the arch code. start and end are specified as | ||
| 88 | * physical addresses. | ||
| 89 | */ | ||
| 90 | #ifdef CONFIG_BLK_DEV_INITRD | ||
| 91 | extern void early_init_dt_setup_initrd_arch(unsigned long start, | ||
| 92 | unsigned long end); | ||
| 93 | #endif | ||
| 94 | |||
| 95 | /* Early flat tree scan hooks */ | ||
| 96 | extern int early_init_dt_scan_root(unsigned long node, const char *uname, | ||
| 97 | int depth, void *data); | ||
| 70 | 98 | ||
| 71 | /* Other Prototypes */ | 99 | /* Other Prototypes */ |
| 72 | extern void finish_device_tree(void); | ||
| 73 | extern void unflatten_device_tree(void); | 100 | extern void unflatten_device_tree(void); |
| 74 | extern void early_init_devtree(void *); | 101 | extern void early_init_devtree(void *); |
| 75 | extern int machine_is_compatible(const char *compat); | 102 | #else /* CONFIG_OF_FLATTREE */ |
| 76 | extern void print_properties(struct device_node *node); | 103 | static inline void unflatten_device_tree(void) {} |
| 77 | extern int prom_n_intr_cells(struct device_node* np); | 104 | #endif /* CONFIG_OF_FLATTREE */ |
| 78 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | ||
| 79 | extern int prom_add_property(struct device_node* np, struct property* prop); | ||
| 80 | extern int prom_remove_property(struct device_node *np, struct property *prop); | ||
| 81 | extern int prom_update_property(struct device_node *np, | ||
| 82 | struct property *newprop, | ||
| 83 | struct property *oldprop); | ||
| 84 | 105 | ||
| 85 | #endif /* __ASSEMBLY__ */ | 106 | #endif /* __ASSEMBLY__ */ |
| 86 | #endif /* _LINUX_OF_FDT_H */ | 107 | #endif /* _LINUX_OF_FDT_H */ |
