Home
last modified time | relevance | path

Searched refs:fdt (Results 1 – 11 of 11) sorted by relevance

/scripts/dtc/libfdt/
Dfdt_sw.c13 static int fdt_sw_probe_(void *fdt) in fdt_sw_probe_() argument
15 if (fdt_magic(fdt) == FDT_MAGIC) in fdt_sw_probe_()
17 else if (fdt_magic(fdt) != FDT_SW_MAGIC) in fdt_sw_probe_()
22 #define FDT_SW_PROBE(fdt) \ argument
25 if ((err = fdt_sw_probe_(fdt)) != 0) \
35 static int fdt_sw_probe_memrsv_(void *fdt) in fdt_sw_probe_memrsv_() argument
37 int err = fdt_sw_probe_(fdt); in fdt_sw_probe_memrsv_()
41 if (fdt_off_dt_strings(fdt) != 0) in fdt_sw_probe_memrsv_()
46 #define FDT_SW_PROBE_MEMRSV(fdt) \ argument
49 if ((err = fdt_sw_probe_memrsv_(fdt)) != 0) \
[all …]
Dlibfdt.h111 const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
113 static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen) in fdt_offset_ptr_w() argument
115 return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen); in fdt_offset_ptr_w()
118 uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
179 int fdt_next_node(const void *fdt, int offset, int *depth);
188 int fdt_first_subnode(const void *fdt, int offset);
201 int fdt_next_subnode(const void *fdt, int offset);
226 #define fdt_for_each_subnode(node, fdt, parent) \ argument
227 for (node = fdt_first_subnode(fdt, parent); \
229 node = fdt_next_subnode(fdt, node))
[all …]
Dfdt_rw.c13 static int fdt_blocks_misordered_(const void *fdt, in fdt_blocks_misordered_() argument
16 return (fdt_off_mem_rsvmap(fdt) < FDT_ALIGN(sizeof(struct fdt_header), 8)) in fdt_blocks_misordered_()
17 || (fdt_off_dt_struct(fdt) < in fdt_blocks_misordered_()
18 (fdt_off_mem_rsvmap(fdt) + mem_rsv_size)) in fdt_blocks_misordered_()
19 || (fdt_off_dt_strings(fdt) < in fdt_blocks_misordered_()
20 (fdt_off_dt_struct(fdt) + struct_size)) in fdt_blocks_misordered_()
21 || (fdt_totalsize(fdt) < in fdt_blocks_misordered_()
22 (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt))); in fdt_blocks_misordered_()
25 static int fdt_rw_probe_(void *fdt) in fdt_rw_probe_() argument
27 FDT_RO_PROBE(fdt); in fdt_rw_probe_()
[all …]
Dfdt.c18 int fdt_ro_probe_(const void *fdt) in fdt_ro_probe_() argument
20 if (fdt_magic(fdt) == FDT_MAGIC) { in fdt_ro_probe_()
22 if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) in fdt_ro_probe_()
24 if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION) in fdt_ro_probe_()
26 } else if (fdt_magic(fdt) == FDT_SW_MAGIC) { in fdt_ro_probe_()
28 if (fdt_size_dt_struct(fdt) == 0) in fdt_ro_probe_()
68 int fdt_check_header(const void *fdt) in fdt_check_header() argument
72 if (fdt_magic(fdt) != FDT_MAGIC) in fdt_check_header()
74 hdrsize = fdt_header_size(fdt); in fdt_check_header()
75 if ((fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION) in fdt_check_header()
[all …]
Dfdt_ro.c13 static int fdt_nodename_eq_(const void *fdt, int offset, in fdt_nodename_eq_() argument
17 const char *p = fdt_get_name(fdt, offset, &olen); in fdt_nodename_eq_()
34 const char *fdt_get_string(const void *fdt, int stroffset, int *lenp) in fdt_get_string() argument
36 uint32_t absoffset = stroffset + fdt_off_dt_strings(fdt); in fdt_get_string()
41 err = fdt_ro_probe_(fdt); in fdt_get_string()
46 if (absoffset >= fdt_totalsize(fdt)) in fdt_get_string()
48 len = fdt_totalsize(fdt) - absoffset; in fdt_get_string()
50 if (fdt_magic(fdt) == FDT_MAGIC) { in fdt_get_string()
53 if (fdt_version(fdt) >= 17) { in fdt_get_string()
54 if (stroffset >= fdt_size_dt_strings(fdt)) in fdt_get_string()
[all …]
Dlibfdt_internal.h13 int fdt_ro_probe_(const void *fdt);
14 #define FDT_RO_PROBE(fdt) \ argument
17 if ((err_ = fdt_ro_probe_(fdt)) != 0) \
21 int fdt_check_node_offset_(const void *fdt, int offset);
22 int fdt_check_prop_offset_(const void *fdt, int offset);
24 int fdt_node_end_offset_(void *fdt, int nodeoffset);
26 static inline const void *fdt_offset_ptr_(const void *fdt, int offset) in fdt_offset_ptr_() argument
28 return (const char *)fdt + fdt_off_dt_struct(fdt) + offset; in fdt_offset_ptr_()
31 static inline void *fdt_offset_ptr_w_(void *fdt, int offset) in fdt_offset_ptr_w_() argument
33 return (void *)(uintptr_t)fdt_offset_ptr_(fdt, offset); in fdt_offset_ptr_w_()
[all …]
Dfdt_wip.c13 int fdt_setprop_inplace_namelen_partial(void *fdt, int nodeoffset, in fdt_setprop_inplace_namelen_partial() argument
21 propval = fdt_getprop_namelen_w(fdt, nodeoffset, name, namelen, in fdt_setprop_inplace_namelen_partial()
33 int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name, in fdt_setprop_inplace() argument
39 propval = fdt_getprop(fdt, nodeoffset, name, &proplen); in fdt_setprop_inplace()
46 return fdt_setprop_inplace_namelen_partial(fdt, nodeoffset, name, in fdt_setprop_inplace()
59 int fdt_nop_property(void *fdt, int nodeoffset, const char *name) in fdt_nop_property() argument
64 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); in fdt_nop_property()
73 int fdt_node_end_offset_(void *fdt, int offset) in fdt_node_end_offset_() argument
78 offset = fdt_next_node(fdt, offset, &depth); in fdt_node_end_offset_()
83 int fdt_nop_node(void *fdt, int nodeoffset) in fdt_nop_node() argument
[all …]
Dfdt_overlay.c58 static int overlay_get_target(const void *fdt, const void *fdto, in overlay_get_target() argument
75 ret = fdt_path_offset(fdt, path); in overlay_get_target()
79 ret = fdt_node_offset_by_phandle(fdt, phandle); in overlay_get_target()
116 static int overlay_phandle_add_offset(void *fdt, int node, in overlay_phandle_add_offset() argument
123 val = fdt_getprop(fdt, node, name, &len); in overlay_phandle_add_offset()
138 return fdt_setprop_inplace_u32(fdt, node, name, adj_val); in overlay_phandle_add_offset()
367 static int overlay_fixup_one_phandle(void *fdt, void *fdto, in overlay_fixup_one_phandle() argument
382 symbol_path = fdt_getprop(fdt, symbols_off, label, in overlay_fixup_one_phandle()
387 symbol_off = fdt_path_offset(fdt, symbol_path); in overlay_fixup_one_phandle()
391 phandle = fdt_get_phandle(fdt, symbol_off); in overlay_fixup_one_phandle()
[all …]
Dfdt_addresses.c14 static int fdt_cells(const void *fdt, int nodeoffset, const char *name) in fdt_cells() argument
20 c = fdt_getprop(fdt, nodeoffset, name, &len); in fdt_cells()
34 int fdt_address_cells(const void *fdt, int nodeoffset) in fdt_address_cells() argument
38 val = fdt_cells(fdt, nodeoffset, "#address-cells"); in fdt_address_cells()
44 int fdt_size_cells(const void *fdt, int nodeoffset) in fdt_size_cells() argument
48 val = fdt_cells(fdt, nodeoffset, "#size-cells"); in fdt_size_cells()
55 int fdt_appendprop_addrrange(void *fdt, int parent, int nodeoffset, in fdt_appendprop_addrrange() argument
61 ret = fdt_address_cells(fdt, parent); in fdt_appendprop_addrrange()
66 ret = fdt_size_cells(fdt, parent); in fdt_appendprop_addrrange()
97 return fdt_appendprop(fdt, nodeoffset, name, data, in fdt_appendprop_addrrange()
DMakefile.libfdt8 LIBFDT_INCLUDES = fdt.h libfdt.h libfdt_env.h
10 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/
Dflattree.c313 static void make_fdt_header(struct fdt_header *fdt, in make_fdt_header() argument
322 memset(fdt, 0xff, sizeof(*fdt)); in make_fdt_header()
324 fdt->magic = cpu_to_fdt32(FDT_MAGIC); in make_fdt_header()
325 fdt->version = cpu_to_fdt32(vi->version); in make_fdt_header()
326 fdt->last_comp_version = cpu_to_fdt32(vi->last_comp_version); in make_fdt_header()
331 fdt->off_mem_rsvmap = cpu_to_fdt32(reserve_off); in make_fdt_header()
332 fdt->off_dt_struct = cpu_to_fdt32(reserve_off + reservesize); in make_fdt_header()
333 fdt->off_dt_strings = cpu_to_fdt32(reserve_off + reservesize in make_fdt_header()
335 fdt->totalsize = cpu_to_fdt32(reserve_off + reservesize + dtsize + strsize); in make_fdt_header()
338 fdt->boot_cpuid_phys = cpu_to_fdt32(boot_cpuid_phys); in make_fdt_header()
[all …]