/scripts/dtc/libfdt/ |
D | libfdt.h | 125 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen); 126 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) in fdt_offset_ptr_w() argument 128 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); in fdt_offset_ptr_w() 131 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset); 137 int fdt_next_node(const void *fdt, int offset, int *depth); 143 #define fdt_get_header(fdt, field) \ argument 144 (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field)) 145 #define fdt_magic(fdt) (fdt_get_header(fdt, magic)) argument 146 #define fdt_totalsize(fdt) (fdt_get_header(fdt, totalsize)) argument 147 #define fdt_off_dt_struct(fdt) (fdt_get_header(fdt, off_dt_struct)) argument [all …]
|
D | fdt_rw.c | 58 static int _fdt_blocks_misordered(const void *fdt, in _fdt_blocks_misordered() argument 61 return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8)) in _fdt_blocks_misordered() 62 || (fdt_off_dt_struct(fdt) < in _fdt_blocks_misordered() 63 (fdt_off_mem_rsvmap(fdt) + mem_rsv_size)) in _fdt_blocks_misordered() 64 || (fdt_off_dt_strings(fdt) < in _fdt_blocks_misordered() 65 (fdt_off_dt_struct(fdt) + struct_size)) in _fdt_blocks_misordered() 66 || (fdt_totalsize(fdt) < in _fdt_blocks_misordered() 67 (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt))); in _fdt_blocks_misordered() 70 static int _fdt_rw_check_header(void *fdt) in _fdt_rw_check_header() argument 72 FDT_CHECK_HEADER(fdt); in _fdt_rw_check_header() [all …]
|
D | fdt_sw.c | 58 static int _fdt_sw_check_header(void *fdt) in _fdt_sw_check_header() argument 60 if (fdt_magic(fdt) != FDT_SW_MAGIC) in _fdt_sw_check_header() 66 #define FDT_SW_CHECK_HEADER(fdt) \ argument 69 if ((err = _fdt_sw_check_header(fdt)) != 0) \ 73 static void *_fdt_grab_space(void *fdt, size_t len) in _fdt_grab_space() argument 75 int offset = fdt_size_dt_struct(fdt); in _fdt_grab_space() 78 spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt) in _fdt_grab_space() 79 - fdt_size_dt_strings(fdt); in _fdt_grab_space() 84 fdt_set_size_dt_struct(fdt, offset + len); in _fdt_grab_space() 85 return _fdt_offset_ptr_w(fdt, offset); in _fdt_grab_space() [all …]
|
D | fdt_ro.c | 58 static int _fdt_nodename_eq(const void *fdt, int offset, in _fdt_nodename_eq() argument 61 const char *p = fdt_offset_ptr(fdt, offset + FDT_TAGSIZE, len+1); in _fdt_nodename_eq() 78 const char *fdt_string(const void *fdt, int stroffset) in fdt_string() argument 80 return (const char *)fdt + fdt_off_dt_strings(fdt) + stroffset; in fdt_string() 83 static int _fdt_string_eq(const void *fdt, int stroffset, in _fdt_string_eq() argument 86 const char *p = fdt_string(fdt, stroffset); in _fdt_string_eq() 91 int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size) in fdt_get_mem_rsv() argument 93 FDT_CHECK_HEADER(fdt); in fdt_get_mem_rsv() 94 *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address); in fdt_get_mem_rsv() 95 *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size); in fdt_get_mem_rsv() [all …]
|
D | fdt.c | 58 int fdt_check_header(const void *fdt) in fdt_check_header() argument 60 if (fdt_magic(fdt) == FDT_MAGIC) { in fdt_check_header() 62 if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) in fdt_check_header() 64 if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION) in fdt_check_header() 66 } else if (fdt_magic(fdt) == FDT_SW_MAGIC) { in fdt_check_header() 68 if (fdt_size_dt_struct(fdt) == 0) in fdt_check_header() 77 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len) in fdt_offset_ptr() argument 81 if (fdt_version(fdt) >= 0x11) in fdt_offset_ptr() 83 || ((offset + len) > fdt_size_dt_struct(fdt))) in fdt_offset_ptr() 86 p = _fdt_offset_ptr(fdt, offset); in fdt_offset_ptr() [all …]
|
D | libfdt_internal.h | 58 #define FDT_CHECK_HEADER(fdt) \ argument 61 if ((err = fdt_check_header(fdt)) != 0) \ 65 int _fdt_check_node_offset(const void *fdt, int offset); 66 int _fdt_check_prop_offset(const void *fdt, int offset); 68 int _fdt_node_end_offset(void *fdt, int nodeoffset); 70 static inline const void *_fdt_offset_ptr(const void *fdt, int offset) in _fdt_offset_ptr() argument 72 return (const char *)fdt + fdt_off_dt_struct(fdt) + offset; in _fdt_offset_ptr() 75 static inline void *_fdt_offset_ptr_w(void *fdt, int offset) in _fdt_offset_ptr_w() argument 77 return (void *)(uintptr_t)_fdt_offset_ptr(fdt, offset); in _fdt_offset_ptr_w() 80 static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n) in _fdt_mem_rsv() argument [all …]
|
D | fdt_wip.c | 58 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, in fdt_setprop_inplace() argument 64 propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen); in fdt_setprop_inplace() 83 int fdt_nop_property(void *fdt, int nodeoffset, const char *name) in fdt_nop_property() argument 88 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); in fdt_nop_property() 97 int _fdt_node_end_offset(void *fdt, int offset) in _fdt_node_end_offset() argument 102 offset = fdt_next_node(fdt, offset, &depth); in _fdt_node_end_offset() 107 int fdt_nop_node(void *fdt, int nodeoffset) in fdt_nop_node() argument 111 endoffset = _fdt_node_end_offset(fdt, nodeoffset); in fdt_nop_node() 115 _fdt_nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), in fdt_nop_node()
|
D | Makefile.libfdt | 7 LIBFDT_INCLUDES = fdt.h libfdt.h libfdt_env.h 9 LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c
|
/scripts/dtc/ |
D | flattree.c | 337 static void make_fdt_header(struct fdt_header *fdt, in make_fdt_header() argument 346 memset(fdt, 0xff, sizeof(*fdt)); in make_fdt_header() 348 fdt->magic = cpu_to_fdt32(FDT_MAGIC); in make_fdt_header() 349 fdt->version = cpu_to_fdt32(vi->version); in make_fdt_header() 350 fdt->last_comp_version = cpu_to_fdt32(vi->last_comp_version); in make_fdt_header() 355 fdt->off_mem_rsvmap = cpu_to_fdt32(reserve_off); in make_fdt_header() 356 fdt->off_dt_struct = cpu_to_fdt32(reserve_off + reservesize); in make_fdt_header() 357 fdt->off_dt_strings = cpu_to_fdt32(reserve_off + reservesize in make_fdt_header() 359 fdt->totalsize = cpu_to_fdt32(reserve_off + reservesize + dtsize + strsize); in make_fdt_header() 362 fdt->boot_cpuid_phys = cpu_to_fdt32(boot_cpuid_phys); in make_fdt_header() [all …]
|