summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorStefano Babic <[email protected]>2021-10-21 13:57:38 +0200
committerStefano Babic <[email protected]>2021-10-21 13:58:13 +0200
commit5fac11e6d5ab350429b8c8ddf47d3d3877ca89d1 (patch)
treea6fd50ca6f8a79b0647469871fa99223a55d8a96 /include/dm
parente03aa34bdf97f96ad478f7a105482d8231b98aa6 (diff)
parent79b8849d4c1e73df2a79a1d5a5f6166d0dd67a12 (diff)
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <[email protected]>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/fdtaddr.h12
-rw-r--r--include/dm/lists.h3
-rw-r--r--include/dm/read.h18
3 files changed, 32 insertions, 1 deletions
diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h
index a4fda581a77..d2c19942916 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/lists.h b/include/dm/lists.h
index 1a865525461..5896ae36583 100644
--- a/include/dm/lists.h
+++ b/include/dm/lists.h
@@ -53,13 +53,14 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only);
* @parent: parent device (root)
* @node: device tree node to bind
* @devp: if non-NULL, returns a pointer to the bound device
+ * @drv: if non-NULL, force this driver to be bound
* @pre_reloc_only: If true, bind only nodes with special devicetree properties,
* or drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers.
* @return 0 if device was bound, -EINVAL if the device tree is invalid,
* other -ve value on error
*/
int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
- bool pre_reloc_only);
+ struct driver *drv, bool pre_reloc_only);
/**
* device_bind_driver() - bind a device to a driver
diff --git a/include/dm/read.h b/include/dm/read.h
index 5bf34056147..890bf3d8472 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)