Lines Matching refs:dtb

26 int fdt_read_uint32_array(const void *dtb, int node, const char *prop_name,  in fdt_read_uint32_array()  argument
32 assert(dtb != NULL); in fdt_read_uint32_array()
38 prop = fdt_getprop(dtb, node, prop_name, &value_len); in fdt_read_uint32_array()
57 int fdt_read_uint32(const void *dtb, int node, const char *prop_name, in fdt_read_uint32() argument
60 return fdt_read_uint32_array(dtb, node, prop_name, 1, value); in fdt_read_uint32()
63 uint32_t fdt_read_uint32_default(const void *dtb, int node, in fdt_read_uint32_default() argument
67 int err = fdt_read_uint32(dtb, node, prop_name, &ret); in fdt_read_uint32_default()
76 int fdt_read_uint64(const void *dtb, int node, const char *prop_name, in fdt_read_uint64() argument
82 ret = fdt_read_uint32_array(dtb, node, prop_name, 2, array); in fdt_read_uint64()
96 int fdtw_read_bytes(const void *dtb, int node, const char *prop, in fdtw_read_bytes() argument
102 assert(dtb != NULL); in fdtw_read_bytes()
108 ptr = fdt_getprop_namelen(dtb, node, prop, (int)strlen(prop), in fdtw_read_bytes()
131 int fdtw_read_string(const void *dtb, int node, const char *prop, in fdtw_read_string() argument
137 assert(dtb != NULL); in fdtw_read_string()
143 ptr = fdt_getprop_namelen(dtb, node, prop, (int)strlen(prop), NULL); in fdtw_read_string()
162 int fdtw_read_uuid(const void *dtb, int node, const char *prop, in fdtw_read_uuid() argument
169 assert(dtb != NULL); in fdtw_read_uuid()
178 err = fdtw_read_string(dtb, node, prop, uuid_string, in fdtw_read_uuid()
195 int fdtw_write_inplace_cells(void *dtb, int node, const char *prop, in fdtw_write_inplace_cells() argument
200 assert(dtb != NULL); in fdtw_write_inplace_cells()
216 err = fdt_setprop_inplace(dtb, node, prop, value, len); in fdtw_write_inplace_cells()
230 int fdtw_write_inplace_bytes(void *dtb, int node, const char *prop, in fdtw_write_inplace_bytes() argument
236 assert(dtb != NULL); in fdtw_write_inplace_bytes()
244 ptr = fdt_getprop_namelen(dtb, node, prop, namelen, &value_len); in fdtw_write_inplace_bytes()
257 err = fdt_setprop_inplace_namelen_partial(dtb, node, prop, in fdtw_write_inplace_bytes()
278 int fdt_get_reg_props_by_index(const void *dtb, int node, int index, in fdt_get_reg_props_by_index() argument
286 parent = fdt_parent_offset(dtb, node); in fdt_get_reg_props_by_index()
291 ac = fdt_address_cells(dtb, parent); in fdt_get_reg_props_by_index()
292 sc = fdt_size_cells(dtb, parent); in fdt_get_reg_props_by_index()
296 prop = fdt_getprop(dtb, node, "reg", &len); in fdt_get_reg_props_by_index()
322 int fdt_get_reg_props_by_name(const void *dtb, int node, const char *name, in fdt_get_reg_props_by_name() argument
327 index = fdt_stringlist_search(dtb, node, "reg-names", name); in fdt_get_reg_props_by_name()
332 return fdt_get_reg_props_by_index(dtb, node, index, base, size); in fdt_get_reg_props_by_name()
340 int fdt_get_stdout_node_offset(const void *dtb) in fdt_get_stdout_node_offset() argument
347 node = fdt_path_offset(dtb, "/secure-chosen"); in fdt_get_stdout_node_offset()
349 node = fdt_path_offset(dtb, "/chosen"); in fdt_get_stdout_node_offset()
355 prop = fdt_getprop(dtb, node, "stdout-path", NULL); in fdt_get_stdout_node_offset()
370 return fdt_path_offset_namelen(dtb, prop, len); in fdt_get_stdout_node_offset()
374 path = fdt_get_alias_namelen(dtb, prop, len); in fdt_get_stdout_node_offset()
379 return fdt_path_offset(dtb, path); in fdt_get_stdout_node_offset()
425 static uint64_t fdtw_search_all_xlat_entries(const void *dtb, in fdtw_search_all_xlat_entries() argument
443 parent_bus_node = fdt_parent_offset(dtb, local_bus); in fdtw_search_all_xlat_entries()
444 self_addr_cells = fdt_address_cells(dtb, local_bus); in fdtw_search_all_xlat_entries()
445 self_size_cells = fdt_size_cells(dtb, local_bus); in fdtw_search_all_xlat_entries()
446 parent_addr_cells = fdt_address_cells(dtb, parent_bus_node); in fdtw_search_all_xlat_entries()
476 base_address, fdt_get_name(dtb, local_bus, NULL)); in fdtw_search_all_xlat_entries()
528 uint64_t fdtw_translate_address(const void *dtb, int node, in fdtw_translate_address() argument
535 local_bus_node = fdt_parent_offset(dtb, node); in fdtw_translate_address()
536 node_name = fdt_get_name(dtb, local_bus_node, NULL); in fdtw_translate_address()
546 const struct fdt_property *property = fdt_get_property(dtb, in fdtw_translate_address()
562 return fdtw_translate_address(dtb, local_bus_node, base_address); in fdtw_translate_address()
567 global_address = fdtw_search_all_xlat_entries(dtb, property, in fdtw_translate_address()
575 return fdtw_translate_address(dtb, local_bus_node, global_address); in fdtw_translate_address()
586 int fdtw_for_each_cpu(const void *dtb, in fdtw_for_each_cpu() argument
587 int (*callback)(const void *dtb, int node, uintptr_t mpidr)) in fdtw_for_each_cpu() argument
592 parent = fdt_path_offset(dtb, "/cpus"); in fdtw_for_each_cpu()
597 fdt_for_each_subnode(node, dtb, parent) { in fdtw_for_each_cpu()
603 name = fdt_get_name(dtb, node, &len); in fdtw_for_each_cpu()
608 ret = fdt_get_reg_props_by_index(dtb, node, 0, &mpidr, NULL); in fdtw_for_each_cpu()
613 ret = callback(dtb, node, mpidr); in fdtw_for_each_cpu()