summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2019-08-12 18:47:53 -0400
committerTom Rini <[email protected]>2019-08-12 18:47:53 -0400
commit9c6115822e894ead72fa4c094bf718eaabb9e103 (patch)
tree4f8843a5cfbe2895a168d96dee111dd31e443b2a /include/dm
parent5939afc9611e8ba4a86b96e67670b765ee27668e (diff)
parent0805fe151d8c47cfbcfddf71c0891ed4f3c10b56 (diff)
Merge branch '2019-08-11-ti-imports'
- More DaVinci updates and fixes - PCIe support on am65x - Watchdog converted to DM - Assorted other bugfixes
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/fdtaddr.h18
-rw-r--r--include/dm/read.h41
2 files changed, 59 insertions, 0 deletions
diff --git a/include/dm/fdtaddr.h b/include/dm/fdtaddr.h
index 3bc2599b6cb..57b326cb336 100644
--- a/include/dm/fdtaddr.h
+++ b/include/dm/fdtaddr.h
@@ -120,4 +120,22 @@ fdt_addr_t devfdt_get_addr_size_index(struct udevice *dev, int index,
*/
fdt_addr_t devfdt_get_addr_name(struct udevice *dev, const char *name);
+/**
+ * devfdt_get_addr_size_name() - Get the reg property and its size for a device,
+ * indexed by name
+ *
+ * Returns the address and size specified in the 'reg' property of a device.
+ *
+ * @dev: Pointer to a device
+ * @name: the 'reg' property can hold a list of <addr, size> pairs, with the
+ * 'reg-names' property providing named-based identification. @index
+ * indicates the value to search for in 'reg-names'.
+ * @size: Pointer to size variable - this function returns the size
+ * specified in the 'reg' property here
+ *
+ * @return addr
+ */
+fdt_addr_t devfdt_get_addr_size_name(struct udevice *dev, const char *name,
+ fdt_size_t *size);
+
#endif
diff --git a/include/dm/read.h b/include/dm/read.h
index 6ecd062e200..0c62d62f114 100644
--- a/include/dm/read.h
+++ b/include/dm/read.h
@@ -145,6 +145,19 @@ int dev_read_size(struct udevice *dev, const char *propname);
fdt_addr_t dev_read_addr_index(struct udevice *dev, int index);
/**
+ * dev_read_addr_size_index() - Get the indexed reg property of a device
+ *
+ * @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
+ * @size: place to put size value (on success)
+ *
+ * @return address or FDT_ADDR_T_NONE if not found
+ */
+fdt_addr_t dev_read_addr_size_index(struct udevice *dev, int index,
+ fdt_size_t *size);
+
+/**
* dev_remap_addr_index() - Get the indexed reg property of a device
* as a memory-mapped I/O pointer
*
@@ -169,6 +182,20 @@ void *dev_remap_addr_index(struct udevice *dev, int index);
fdt_addr_t dev_read_addr_name(struct udevice *dev, const char* name);
/**
+ * dev_read_addr_size_name() - Get the reg property of a device, indexed by name
+ *
+ * @dev: Device to read from
+ * @name: the 'reg' property can hold a list of <addr, size> pairs, with the
+ * 'reg-names' property providing named-based identification. @index
+ * indicates the value to search for in 'reg-names'.
+ * @size: place to put size value (on success)
+ *
+ * @return address or FDT_ADDR_T_NONE if not found
+ */
+fdt_addr_t dev_read_addr_size_name(struct udevice *dev, const char *name,
+ fdt_size_t *size);
+
+/**
* dev_remap_addr_name() - Get the reg property of a device, indexed by name,
* as a memory-mapped I/O pointer
*
@@ -601,12 +628,26 @@ static inline fdt_addr_t dev_read_addr_index(struct udevice *dev, int index)
return devfdt_get_addr_index(dev, index);
}
+static inline fdt_addr_t dev_read_addr_size_index(struct udevice *dev,
+ int index,
+ fdt_size_t *size)
+{
+ return devfdt_get_addr_size_index(dev, index, size);
+}
+
static inline fdt_addr_t dev_read_addr_name(struct udevice *dev,
const char *name)
{
return devfdt_get_addr_name(dev, name);
}
+static inline fdt_addr_t dev_read_addr_size_name(struct udevice *dev,
+ const char *name,
+ fdt_size_t *size)
+{
+ return devfdt_get_addr_size_name(dev, name, size);
+}
+
static inline fdt_addr_t dev_read_addr(struct udevice *dev)
{
return devfdt_get_addr(dev);