Lines Matching full:node
21 * ofnode - reference to a device tree node
35 * There is no ambiguity as to whether ofnode holds an offset or a node
36 * pointer: when the live tree is active it holds a node pointer, otherwise it
38 * the same value could point to a valid device node or a valid offset. We
47 * @np: Pointer to device node, used for live tree
49 * is not a really a pointer to a node: it is an offset value. See above.
57 ofnode node; member
63 * ofprop - reference to a property of a device tree node
65 * This struct hold the reference on one property of one node,
74 * @node: Pointer to device node
80 ofnode node; member
88 * _ofnode_to_np() - convert an ofnode to a live DT node pointer
92 * @node: Reference containing struct device_node * (possibly invalid)
93 * @return pointer to device node (can be NULL)
95 static inline const struct device_node *ofnode_to_np(ofnode node) in ofnode_to_np() argument
101 return node.np; in ofnode_to_np()
107 * This cannot be called if the reference contains a node pointer.
109 * @node: Reference containing offset (possibly invalid)
112 static inline int ofnode_to_offset(ofnode node) in ofnode_to_offset() argument
118 return node.of_offset; in ofnode_to_offset()
126 static inline bool ofnode_valid(ofnode node) in ofnode_valid() argument
129 return node.np != NULL; in ofnode_valid()
131 return node.of_offset != -1; in ofnode_valid()
142 ofnode node; in offset_to_ofnode() local
145 node.np = NULL; in offset_to_ofnode()
147 node.of_offset = of_offset; in offset_to_ofnode()
149 return node; in offset_to_ofnode()
153 * np_to_ofnode() - convert a node pointer to an ofnode
155 * @np: Live node pointer (can be NULL)
156 * @return reference to the associated node pointer
160 ofnode node; in np_to_ofnode() local
162 node.np = np; in np_to_ofnode()
164 return node; in np_to_ofnode()
168 * ofnode_is_np() - check if a reference is a node pointer
174 * @node: reference to check (possibly invalid)
175 * @return true if the reference is a live node pointer, false if it is a DT
178 static inline bool ofnode_is_np(ofnode node) in ofnode_is_np() argument
185 assert(!ofnode_valid(node) || in ofnode_is_np()
186 (of_live_active() ? _ofnode_to_np(node) in ofnode_is_np()
187 : _ofnode_to_np(node))); in ofnode_is_np()
189 return of_live_active() && ofnode_valid(node); in ofnode_is_np()
206 * This returns an ofnode which points to no node. It works both with the flat
211 ofnode node; in ofnode_null() local
214 node.np = NULL; in ofnode_null()
216 node.of_offset = -1; in ofnode_null()
218 return node; in ofnode_null()
224 * @ref: valid node reference to read property from
229 int ofnode_read_u32(ofnode node, const char *propname, u32 *outp);
234 * @ref: valid node reference to read property from
239 static inline int ofnode_read_s32(ofnode node, const char *propname, in ofnode_read_s32() argument
242 return ofnode_read_u32(node, propname, (u32 *)out_value); in ofnode_read_s32()
248 * @ref: valid node reference to read property from
258 * @ref: valid node reference to read property from
263 int ofnode_read_u64(ofnode node, const char *propname, u64 *outp);
268 * @ref: valid node reference to read property from
273 int ofnode_read_s32_default(ofnode node, const char *propname, s32 def);
278 * @ref: valid node reference to read property from
282 const char *ofnode_read_string(ofnode node, const char *propname);
287 * @node: valid node reference to read property from
292 * Search for a property in a device node and read 32-bit value(s) from
299 int ofnode_read_u32_array(ofnode node, const char *propname,
305 * @node: valid node reference to read property from
312 int ofnode_write_u32_array(ofnode node, const char *propname,
318 * @node: valid node reference to read property from
322 bool ofnode_read_bool(ofnode node, const char *propname);
325 * ofnode_find_subnode() - find a named subnode of a parent node
327 * @node: valid reference to parent node
332 ofnode ofnode_find_subnode(ofnode node, const char *subnode_name);
335 * ofnode_first_subnode() - find the first subnode of a parent node
337 * @node: valid reference to a valid parent node
339 * node has no subnodes)
341 ofnode ofnode_first_subnode(ofnode node);
346 * @node: valid reference to previous node (sibling)
347 * @return reference to the next subnode (which can be invalid if the node
350 ofnode ofnode_next_subnode(ofnode node);
355 * @node: valid node to look up
356 * @return ofnode reference of the parent node
358 ofnode ofnode_get_parent(ofnode node);
361 * ofnode_get_name() - get the name of a node
363 * @node: valid node to look up
364 * @return name or node
366 const char *ofnode_get_name(ofnode node);
379 * @node: node to check
383 int ofnode_read_size(ofnode node, const char *propname);
386 * ofnode_get_addr_index() - get an address from a node
388 * This reads the register address from a node
390 * @node: node to read from
394 phys_addr_t ofnode_get_addr_index(ofnode node, int index);
397 * ofnode_get_addr() - get an address from a node
399 * This reads the register address from a node
401 * @node: node to read from
404 phys_addr_t ofnode_get_addr(ofnode node);
415 * @node: node to check
424 int ofnode_stringlist_search(ofnode node, const char *propname,
437 * @node: node to check
445 int ofnode_read_string_index(ofnode node, const char *propname, int index,
451 * @node: node to check
456 int ofnode_read_string_count(ofnode node, const char *property);
459 * ofnode_parse_phandle_with_args() - Find a node pointed by phandle in a list
482 * To get a device_node of the `node2' node you may call this:
485 * @node: device tree node containing a list
496 int ofnode_parse_phandle_with_args(ofnode node, const char *list_name,
508 * @node: device tree node containing a list
515 int ofnode_count_phandle_with_args(ofnode node, const char *list_name,
519 * ofnode_path() - find a node by full path
521 * @path: Full path to node, e.g. "/bus/spi@1"
522 * @return reference to the node found. Use ofnode_valid() to check if it exists
529 * This looks for a property within the /chosen node and returns its value
536 * ofnode_get_chosen_node() - get the chosen node
538 * @return the chosen node if present, else ofnode_null()
546 * Decode display timings from the supplied 'display-timings' node.
550 * @node 'display-timing' node containing the timing subnodes
555 int ofnode_decode_display_timing(ofnode node, int index,
559 * ofnode_get_property() - get a pointer to the value of a node property
561 * @node: node to read
566 const void *ofnode_get_property(ofnode node, const char *propname, int *lenp);
571 * Get reference to the first property of the node, it is used to iterate
574 * @node: node to read
578 int ofnode_get_first_property(ofnode node, struct ofprop *prop);
583 * Get reference to the next property of the node, it is used to iterate
605 * ofnode_is_available() - check if a node is marked available
607 * @node: node to check
608 * @return true if node's 'status' property is "okay" (or is missing)
610 bool ofnode_is_available(ofnode node);
618 * @node: node to read from
623 phys_addr_t ofnode_get_addr_size(ofnode node, const char *propname,
629 * Look up a property in a node and return a pointer to its contents as a
634 * @node node to examine
640 const uint8_t *ofnode_read_u8_array_ptr(ofnode node, const char *propname,
646 * Look at an address property in a node and return the PCI address which
650 * @node node to examine
658 int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type,
662 * ofnode_read_addr_cells() - Get the number of address cells for a node
665 * which controls the given node.
667 * @node: Node to check
668 * @return number of address cells this node uses
670 int ofnode_read_addr_cells(ofnode node);
673 * ofnode_read_size_cells() - Get the number of size cells for a node
676 * which controls the given node.
678 * @node: Node to check
679 * @return number of size cells this node uses
681 int ofnode_read_size_cells(ofnode node);
684 * ofnode_read_simple_addr_cells() - Get the address cells property in a node
688 * @np: Node pointer to check
689 * @return value of #address-cells property in this node, or 2 if none
691 int ofnode_read_simple_addr_cells(ofnode node);
694 * ofnode_read_simple_size_cells() - Get the size cells property in a node
698 * @np: Node pointer to check
699 * @return value of #size-cells property in this node, or 2 if none
701 int ofnode_read_simple_size_cells(ofnode node);
704 * ofnode_pre_reloc() - check if a node should be bound before relocation
713 * determine if a node was bound in one of SPL/TPL stages.
722 * @node: node to check
723 * @eturns true if node is needed in SPL/TL, false otherwise
725 bool ofnode_pre_reloc(ofnode node);
727 int ofnode_read_resource(ofnode node, uint index, struct resource *res);
728 int ofnode_read_resource_byname(ofnode node, const char *name,
734 * @node: child node (ofnode, lvalue)
735 * @parent: parent node (ofnode)
739 * ofnode node;
741 * ofnode_for_each_subnode(node, parent) {
742 * Use node
746 * Note that this is implemented as a macro and @node is used as
750 #define ofnode_for_each_subnode(node, parent) \ argument
751 for (node = ofnode_first_subnode(parent); \
752 ofnode_valid(node); \
753 node = ofnode_next_subnode(node))
762 * @ofnode: Device tree node giving the context in which to translate the
767 u64 ofnode_translate_address(ofnode node, const fdt32_t *in_addr);