hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
u-boot/include/dm/read.h
....@@ -271,6 +271,18 @@
271271 int dev_read_addr_cells(struct udevice *dev);
272272
273273 /**
274
+ * dev_remap_addr_index() - Get the indexed reg property of a device
275
+ * as a memory-mapped I/O pointer
276
+ *
277
+ * @dev: Device to read from
278
+ * @index: the 'reg' property can hold a list of <addr, size> pairs
279
+ * and @index is used to select which one is required
280
+ *
281
+ * Return: pointer or NULL if not found
282
+ */
283
+void *dev_remap_addr_index(struct udevice *dev, int index);
284
+
285
+/**
274286 * dev_read_size_cells() - Get the number of size cells for a device's node
275287 *
276288 * This walks back up the tree to find the closest #size-cells property
....@@ -588,6 +600,11 @@
588600 return fdt_address_cells(gd->fdt_blob, dev_of_offset(dev));
589601 }
590602
603
+static inline void *dev_remap_addr_index(struct udevice *dev, int index)
604
+{
605
+ return devfdt_remap_addr_index(dev, index);
606
+}
607
+
591608 static inline int dev_read_size_cells(struct udevice *dev)
592609 {
593610 /* NOTE: this call should walk up the parent stack */