diff options
author | Tom Rini <trini@konsulko.com> | 2021-10-20 14:23:08 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-10-20 14:23:08 -0400 |
commit | 11c41192ec08ba6ded60b0d6e8257cfbd6ad1914 (patch) | |
tree | c704b0558d4ab6a32c95327865ebb7fa6b37208f /include | |
parent | fb1018106a7bbb1a0d723029f6760b1b1b4d306d (diff) | |
parent | ddf4972834fdf33f0a3360ff4a68fde333995113 (diff) | |
download | u-boot-11c41192ec08ba6ded60b0d6e8257cfbd6ad1914.zip u-boot-11c41192ec08ba6ded60b0d6e8257cfbd6ad1914.tar.gz u-boot-11c41192ec08ba6ded60b0d6e8257cfbd6ad1914.tar.bz2 |
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
- Assorted warning fixes, io read/write bugfix
Diffstat (limited to 'include')
-rw-r--r-- | include/dm/fdtaddr.h | 12 | ||||
-rw-r--r-- | include/dm/read.h | 18 |
2 files changed, 30 insertions, 0 deletions
diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h index a4fda58..d2c1994 100644 --- a/include/dm/fdtaddr.h +++ b/include/dm/fdtaddr.h @@ -93,6 +93,18 @@ void *devfdt_map_physmem(const struct udevice *dev, unsigned long size); fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index); /** + * devfdt_get_addr_index_ptr() - Return indexed pointer to the address of the + * reg property of a device + * + * @dev: Pointer to a device + * @index: the 'reg' property can hold a list of <addr, size> pairs + * and @index is used to select which one is required + * + * @return Pointer to addr, or NULL if there is no such property + */ +void *devfdt_get_addr_index_ptr(const struct udevice *dev, int index); + +/** * devfdt_get_addr_size_index() - Get the indexed reg property of a device * * Returns the address and size specified in the 'reg' property of a device. diff --git a/include/dm/read.h b/include/dm/read.h index 5bf3405..890bf3d 100644 --- a/include/dm/read.h +++ b/include/dm/read.h @@ -181,6 +181,18 @@ int dev_read_size(const struct udevice *dev, const char *propname); fdt_addr_t dev_read_addr_index(const struct udevice *dev, int index); /** + * dev_read_addr_index_ptr() - Get the indexed reg property of a device + * as a pointer + * + * @dev: Device to read from + * @index: the 'reg' property can hold a list of <addr, size> pairs + * and @index is used to select which one is required + * + * @return pointer or NULL if not found + */ +void *dev_read_addr_index_ptr(const struct udevice *dev, int index); + +/** * dev_read_addr_size_index() - Get the indexed reg property of a device * * @dev: Device to read from @@ -805,6 +817,12 @@ static inline fdt_addr_t dev_read_addr_index(const struct udevice *dev, return devfdt_get_addr_index(dev, index); } +static inline void *dev_read_addr_index_ptr(const struct udevice *dev, + int index) +{ + return devfdt_get_addr_index_ptr(dev, index); +} + static inline fdt_addr_t dev_read_addr_size_index(const struct udevice *dev, int index, fdt_size_t *size) |