Lines Matching +full:int +full:- +full:property

3  * SPDX-License-Identifier:	GPL-2.0+
12 * drivers and board-specific code within U-Boot. It aims to reduce the
13 * amount of FDT munging required within U-Boot itself, so that driver code
27 #define FDT_ADDR_T_NONE (-1ULL)
32 #define FDT_ADDR_T_NONE (-1U)
57 * be equal to: end - start + 1.
91 * t: is 1 if the address is aliased (for non-relocatable I/O) below 1MB
94 * bbbbbbbb: is the 8-bit Bus Number
95 * ddddd: is the 5-bit Device Number
96 * fff: is the 3-bit Function Number
97 * rrrrrrrr: is the 8-bit Register Number
98 * hhhhhhhh: is a 32-bit unsigned number
99 * llllllll: is a 32-bit unsigned number
115 return res->end - res->start + 1; in fdt_resource_size()
155 COMPAT_INTEL_BAYTRAIL_FSP_MDP, /* Intel FSP memory-down params */
159 COMPAT_ALTERA_SOCFPGA_PINCTRL_SINGLE, /* SoCFPGA pinctrl-single */
173 int node;
174 int args_count;
179 * fdtdec_parse_phandle_with_args() - Find a node pointed by phandle in a list
186 * #list-cells = <2>;
190 * #list-cells = <1>;
198 * fdtdec_parse_phandle_with_args(blob, node3, "list", "#list-cells", 0, 1,
206 * @list_name: property name that contains a list
207 * @cells_name: property name that specifies the phandles' arguments count,
212 * @return 0 on success (with @out_args filled out if not NULL), -ENOENT if
218 int fdtdec_parse_phandle_with_args(const void *blob, int src_node,
221 int cell_count, int index,
239 * @return offset of next compatible node, or -FDT_ERR_NOTFOUND if no more
241 int fdtdec_next_alias(const void *blob, const char *name,
242 enum fdt_compat_id id, int *upto);
255 enum fdt_compat_id fdtdec_lookup(const void *blob, int node);
267 * @return offset of next compatible node, or -FDT_ERR_NOTFOUND if no more
269 int fdtdec_next_compatible(const void *blob, int node,
284 * @return offset of next compatible node, or -FDT_ERR_NOTFOUND if no more
286 int fdtdec_next_compatible_subnode(const void *blob, int node,
287 enum fdt_compat_id id, int *depthp);
290 * Look up an address property in a node and return the parsed address, and
297 * non-standard properties, and never to parse the "reg" property. Instead,
299 * #address-cells and #size-cells properties in the parent node.
303 * @param prop_name name of property to find
309 * using the parent node's ranges property.
312 fdt_addr_t fdtdec_get_addr_size_fixed(const void *blob, int node,
313 const char *prop_name, int index, int na, int ns,
317 * Look up an address property in a node and return the parsed address, and
321 * the address and size by parsing the provided parent node's #address-cells
322 * and #size-cells properties.
327 * @param prop_name name of property to find
331 * using the parent node's ranges property.
334 fdt_addr_t fdtdec_get_addr_size_auto_parent(const void *blob, int parent,
335 int node, const char *prop_name, int index, fdt_size_t *sizep,
339 * Look up an address property in a node and return the parsed address, and
343 * the address and size by parsing the parent node's #address-cells
344 * and #size-cells properties. The parent node is automatically found.
353 * @param prop_name name of property to find
357 * using the parent node's ranges property.
360 fdt_addr_t fdtdec_get_addr_size_auto_noparent(const void *blob, int node,
361 const char *prop_name, int index, fdt_size_t *sizep,
365 * Look up an address property in a node and return the parsed address.
367 * This variant hard-codes the number of cells used to represent the address
369 * always returns the first address value in the property (index 0).
371 * Use of this function is not recommended due to the hard-coding of cell
372 * counts. There is no programmatic validation that these hard-coded values
375 * set in the U-Boot build and exercising strict control over DT content to
376 * ensure use of matching #address-cells/#size-cells properties. However, this
377 * approach is error-prone; those familiar with DT will not expect the
384 * @param prop_name name of property to find
387 fdt_addr_t fdtdec_get_addr(const void *blob, int node,
391 * Look up an address property in a node and return the parsed address, and
394 * This variant hard-codes the number of cells used to represent the address
396 * always returns the first address value in the property (index 0).
398 * Use of this function is not recommended due to the hard-coding of cell
399 * counts. There is no programmatic validation that these hard-coded values
402 * set in the U-Boot build and exercising strict control over DT content to
403 * ensure use of matching #address-cells/#size-cells properties. However, this
404 * approach is error-prone; those familiar with DT will not expect the
411 * @param prop_name name of property to find
415 fdt_addr_t fdtdec_get_addr_size(const void *blob, int node,
419 * Look at an address property in a node and return the pci address which
421 * The property must hold one fdt_pci_addr with a lengh.
426 * @param prop_name name of property to find
428 * @return 0 if ok, -ENOENT if the property did not exist, -EINVAL if the
429 * format of the property was invalid, -ENXIO if the requested
432 int fdtdec_get_pci_addr(const void *blob, int node, enum fdt_pci_space type,
436 * Look at the compatible property of a device node that represents a PCI
445 int fdtdec_get_pci_vendev(const void *blob, int node,
457 int fdtdec_get_pci_bar32(struct udevice *dev, struct fdt_pci_addr *addr,
461 * Look up a 32-bit integer property in a node and return it. The property
467 * @param prop_name name of property to find
468 * @param default_val default value to return if the property is not found
471 s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
475 * Unsigned version of fdtdec_get_int. The property must have at least
480 * @param prop_name name of property to find
481 * @param default_val default value to return if the property is not found
484 unsigned int fdtdec_get_uint(const void *blob, int node, const char *prop_name,
485 unsigned int default_val);
488 * Get a variable-sized number from a property
492 * @param ptr Pointer to property
496 u64 fdtdec_get_number(const fdt32_t *ptr, unsigned int cells);
499 * Look up a 64-bit integer property in a node and return it. The property
506 * @param prop_name name of property to find
507 * @param default_val default value to return if the property is not found
510 uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name,
515 * This looks for a 'status' property. If this exists, then returns 1 if
516 * the status is 'ok' and 0 otherwise. If there is no status property,
524 int fdtdec_get_is_enabled(const void *blob, int node);
527 * Make sure we have a valid fdt available to control U-Boot.
531 * @return 0 if all ok, -1 if not
533 int fdtdec_prepare_fdt(void);
536 * Checks that we have a valid fdt available to control U-Boot.
543 int fdtdec_check_fdt(void);
581 int fdtdec_find_aliases_for_id(const void *blob, const char *name,
582 enum fdt_compat_id id, int *node_list, int maxcount);
587 * available for allocation - others are considered already used and are
591 * uninitialised array, then setting the elements that are returned to -1,
604 int fdtdec_add_aliases_for_id(const void *blob, const char *name,
605 enum fdt_compat_id id, int *node_list, int maxcount);
620 * @return 0 if a sequence was found, -ve if not
622 int fdtdec_get_alias_seq(const void *blob, const char *base, int node,
623 int *seqp);
626 * Get a property from the /chosen node
629 * @param name Property name to look up
630 * @return Value of property, or NULL if it does not exist
637 * This looks up a property in /chosen containing the path to another node,
641 * @param name Property name, e.g. "stdout-path"
642 * @return Node offset referred to by that chosen node, or -ve FDT_ERR_...
644 int fdtdec_get_chosen_node(const void *blob, const char *name);
659 * @param prop_name name of property to find
660 * @return node offset if found, -ve error code on error
662 int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name);
665 * Look up a property in a node and return its contents in an integer
666 * array of given length. The property must have at least enough data for
671 * @param prop_name name of property to find
674 * @return 0 if ok, or -FDT_ERR_NOTFOUND if the property is not found,
675 * or -FDT_ERR_BADLAYOUT if not enough data
677 int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
678 u32 *array, int count);
681 * Look up a property in a node and return its contents in an integer
682 * array of given length. The property must exist but may have less data that
687 * @param prop_name name of property to find
690 * @return number of array elements if ok, or -FDT_ERR_NOTFOUND if the
691 * property is not found
693 int fdtdec_get_int_array_count(const void *blob, int node,
694 const char *prop_name, u32 *array, int count);
697 * Look up a property in a node and return a pointer to its contents as a
698 * unsigned int array of given length. The property must have at least enough
707 * @param prop_name name of property to find
709 * @return pointer to array if found, or NULL if the property is not
712 const u32 *fdtdec_locate_array(const void *blob, int node,
713 const char *prop_name, int count);
716 * Look up a boolean property in a node and return it.
723 * @param prop_name name of property to find
726 int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
735 int fdtdec_get_child_count(const void *blob, int node);
739 * as a 32-bit integer. The property must have at least 4 bytes of data. The
743 * @param prop_name Node property name
744 * @param default_val default value to return if the property is not found
747 int fdtdec_get_config_int(const void *blob, const char *prop_name,
748 int default_val);
755 * @param prop_name property name to look up
758 int fdtdec_get_config_bool(const void *blob, const char *prop_name);
765 * @param prop_name property name to look up
766 * @returns property string, NULL on error.
771 * Look up a property in a node and return its contents in a byte
772 * array of given length. The property must have at least enough data for
777 * @param prop_name name of property to find
780 * @return 0 if ok, or -FDT_ERR_MISSING if the property is not found,
781 * or -FDT_ERR_BADLAYOUT if not enough data
783 int fdtdec_get_byte_array(const void *blob, int node, const char *prop_name,
784 u8 *array, int count);
787 * Look up a property in a node and return a pointer to its contents as a
788 * byte array of given length. The property must have at least enough data
794 * @param prop_name name of property to find
796 * @return pointer to byte array if found, or NULL if the property is not
799 const u8 *fdtdec_locate_byte_array(const void *blob, int node,
800 const char *prop_name, int count);
803 * Look up a property in a node which contains a memory region address and
806 * The property must hold one address with a length. This is only tested on
807 * 32-bit machines.
811 * @param prop_name name of property to find
814 * @return 0 if ok, -1 on error (property not found)
816 int fdtdec_decode_region(const void *blob, int node, const char *prop_name,
820 * Obtain an indexed resource from a device property.
824 * @param property name of the property to parse
829 int fdt_get_resource(const void *fdt, int node, const char *property,
830 unsigned int index, struct fdt_resource *res);
833 * Obtain a named resource from a device property.
840 * @param property name of the property to parse
841 * @param prop_names name of the property containing the list of names
845 int fdt_get_named_resource(const void *fdt, int node, const char *property,
857 * <mem_type>-memory<suffix> for the name of the memory bank
858 * <mem_type>-offset<suffix> for the offset in that bank
860 * The property value must have an offset and a size. The function checks
864 * @param node Node containing the properties (-1 for /config)
866 * "u-boot" or "kernel".
868 * property names
871 * @return 0 if OK, -ive on error
873 int fdtdec_decode_memory_region(const void *blob, int node,
916 * |<- sync ->|<- back ->|<----- active ----->|<- front ->|<- sync..
941 * fdtdec_decode_display_timing() - decode display timings
943 * Decode display timings from the supplied 'display-timings' node.
944 * See doc/device-tree-bindings/video/display-timing.txt for binding
948 * @param node 'display-timing' node containing the timing subnodes
951 * @return 0 if OK, -FDT_ERR_NOTFOUND if not found
953 int fdtdec_decode_display_timing(const void *blob, int node, int index,
957 * fdtdec_setup_memory_size() - decode and setup gd->ram_size
959 * Decode the /memory 'reg' property to determine the size of the first memory
967 * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or
970 int fdtdec_setup_memory_size(void);
973 * fdtdec_setup_memory_banksize() - decode and populate gd->bd->bi_dram
975 * Decode the /memory 'reg' property to determine the address and size of the
984 * @return 0 if OK, -EINVAL if the /memory node or reg property is missing or
987 int fdtdec_setup_memory_banksize(void);
992 int fdtdec_setup(void);
995 * Board-specific FDT initialization. Returns the address to a device tree blob.