diff options
author | Tom Rini <trini@konsulko.com> | 2019-05-22 12:58:58 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-05-22 12:58:58 -0400 |
commit | 40920bdecc4e1b7096de6f546d7b5c2185554ba6 (patch) | |
tree | aa3c93ff5606eaed9c93618c2691697b0da483cc /include | |
parent | 7e090b466c5ba874d31c1bf22c3a130d516cdc32 (diff) | |
parent | ee730a7cd2afe445e53e92b5c37396a5b118f7af (diff) | |
download | u-boot-40920bdecc4e1b7096de6f546d7b5c2185554ba6.tar.gz |
Merge tag 'dm-pull-22may19' of git://git.denx.de/u-boot-dm
Various DM fixes
Addition of ofnode_get_addr_size_index()
Diffstat (limited to 'include')
-rw-r--r-- | include/dm/ofnode.h | 16 | ||||
-rw-r--r-- | include/fdtdec.h | 24 | ||||
-rw-r--r-- | include/stdint.h | 7 |
3 files changed, 22 insertions, 25 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index d206ee2caa..4ab2ae1ba5 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -224,7 +224,7 @@ static inline int ofnode_read_s32(ofnode node, const char *propname, * @def: default value to return if the property has no value * @return property value, or @def if not found */ -int ofnode_read_u32_default(ofnode ref, const char *propname, u32 def); +u32 ofnode_read_u32_default(ofnode ref, const char *propname, u32 def); /** * ofnode_read_s32_default() - Read a 32-bit integer from a property @@ -355,6 +355,20 @@ ofnode ofnode_get_by_phandle(uint phandle); int ofnode_read_size(ofnode node, const char *propname); /** + * ofnode_get_addr_size_index() - get an address/size from a node + * based on index + * + * This reads the register address/size from a node based on index + * + * @node: node to read from + * @index: Index of address to read (0 for first) + * @size: Pointer to size of the address + * @return address, or FDT_ADDR_T_NONE if not present or invalid + */ +phys_addr_t ofnode_get_addr_size_index(ofnode node, int index, + fdt_size_t *size); + +/** * ofnode_get_addr_index() - get an address from a node * * This reads the register address from a node diff --git a/include/fdtdec.h b/include/fdtdec.h index 110aa6ab6d..fa8e34f6f9 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -24,30 +24,6 @@ typedef phys_addr_t fdt_addr_t; typedef phys_size_t fdt_size_t; -static inline fdt32_t fdt_addr_unpack(fdt_addr_t addr, fdt32_t *upper) -{ - if (upper) -#ifdef CONFIG_PHYS_64BIT - *upper = addr >> 32; -#else - *upper = 0; -#endif - - return addr; -} - -static inline fdt32_t fdt_size_unpack(fdt_size_t size, fdt32_t *upper) -{ - if (upper) -#ifdef CONFIG_PHYS_64BIT - *upper = size >> 32; -#else - *upper = 0; -#endif - - return size; -} - #ifdef CONFIG_PHYS_64BIT #define FDT_ADDR_T_NONE (-1U) #define fdt_addr_to_cpu(reg) be64_to_cpu(reg) diff --git a/include/stdint.h b/include/stdint.h new file mode 100644 index 0000000000..2e126d14bd --- /dev/null +++ b/include/stdint.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Dummy file to allow libraries linked with U-Boot to include stdint.h without + * getting the system version. + * + * U-Boot uses linux types (linux/types.h) so does not make use of stdint.h + */ |