Lines Matching defs:node
22 * Read cells from a given property of the given node. Any number of 32-bit
26 int fdt_read_uint32_array(const void *dtb, int node, const char *prop_name,
35 assert(node >= 0);
38 prop = fdt_getprop(dtb, node, prop_name, &value_len);
57 int fdt_read_uint32(const void *dtb, int node, const char *prop_name,
60 return fdt_read_uint32_array(dtb, node, prop_name, 1, value);
63 uint32_t fdt_read_uint32_default(const void *dtb, int node,
67 int err = fdt_read_uint32(dtb, node, prop_name, &ret);
76 int fdt_read_uint64(const void *dtb, int node, const char *prop_name,
82 ret = fdt_read_uint32_array(dtb, node, prop_name, 2, array);
92 * Read bytes from a given property of the given node. Any number of
96 int fdtw_read_bytes(const void *dtb, int node, const char *prop,
105 assert(node >= 0);
108 ptr = fdt_getprop_namelen(dtb, node, prop, (int)strlen(prop),
127 * Read string from a given property of the given node. Up to 'size - 1'
131 int fdtw_read_string(const void *dtb, int node, const char *prop,
138 assert(node >= 0);
143 ptr = fdt_getprop_namelen(dtb, node, prop, (int)strlen(prop), NULL);
159 * Read UUID from a given property of the given node. Returns 0 on success,
162 int fdtw_read_uuid(const void *dtb, int node, const char *prop,
172 assert(node >= 0);
178 err = fdtw_read_string(dtb, node, prop, uuid_string,
192 * Write cells in place to a given property of the given node. At most 2 cells
195 int fdtw_write_inplace_cells(void *dtb, int node, const char *prop,
203 assert(node >= 0);
216 err = fdt_setprop_inplace(dtb, node, prop, value, len);
226 * Write bytes in place to a given property of the given node.
230 int fdtw_write_inplace_bytes(void *dtb, int node, const char *prop,
239 assert(node >= 0);
244 ptr = fdt_getprop_namelen(dtb, node, prop, namelen, &value_len);
257 err = fdt_setprop_inplace_namelen_partial(dtb, node, prop,
278 int fdt_get_reg_props_by_index(const void *dtb, int node, int index,
286 parent = fdt_parent_offset(dtb, node);
296 prop = fdt_getprop(dtb, node, "reg", &len);
318 * This function fills reg node info (base & size) with an index found by
319 * checking the reg-names node.
322 int fdt_get_reg_props_by_name(const void *dtb, int node, const char *name,
327 index = fdt_stringlist_search(dtb, node, "reg-names", name);
332 return fdt_get_reg_props_by_index(dtb, node, index, base, size);
336 * This function gets the stdout path node.
338 * Returns node offset on success and a negative FDT error code on failure.
342 int node;
346 /* The /secure-chosen node takes precedence over the standard one. */
347 node = fdt_path_offset(dtb, "/secure-chosen");
348 if (node < 0) {
349 node = fdt_path_offset(dtb, "/chosen");
350 if (node < 0) {
355 prop = fdt_getprop(dtb, node, "stdout-path", NULL);
384 * Only devices which are direct children of root node use CPU address domain.
385 * All other devices use addresses that are local to the device node and cannot
388 * parent address space. Since a device could be a child of a child node to the
389 * root node, there can be more than one level of address translation needed to
475 INFO("DT: No translation found for address %" PRIx64 " in node %s\n",
482 * address mapping needs to be done recursively starting from current node to
483 * root node through all intermediate parent nodes.
521 * `ranges` property denotes identity mapping (as seen in `motherboard` node).
524 * in the `smb` node which has 6 translation entries.
528 uint64_t fdtw_translate_address(const void *dtb, int node,
535 local_bus_node = fdt_parent_offset(dtb, node);
539 * In the example given above, starting from the leaf node:
540 * uart@a000 represents the current node
552 * root node doesn't have range property as addresses
557 INFO("DT: Couldn't find ranges property in node %s\n",
565 VERBOSE("DT: Translation lookup in node %s at offset %d\n", node_name,
579 * For every CPU node (`/cpus/cpu@n`) in an FDT, execute a callback passing a
580 * pointer to the FDT and the offset of the CPU node. If the return value of the
587 int (*callback)(const void *dtb, int node, uintptr_t mpidr))
590 int parent, node = 0;
597 fdt_for_each_subnode(node, dtb, parent) {
603 name = fdt_get_name(dtb, node, &len);
608 ret = fdt_get_reg_props_by_index(dtb, node, 0, &mpidr, NULL);
613 ret = callback(dtb, node, mpidr);
623 * Find a given node in device tree. If not present, add it.
624 * Returns offset of node found/added on success, and < 0 on error.