summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2017-09-12 09:32:51 -0400
committerTom Rini <trini@konsulko.com>2017-09-12 09:32:51 -0400
commitde2ad2c40db389e4747f566e44aa7f1a1aec91fb (patch)
tree76bd1340bc1b8b25e5acffeed74bceea5913969a /include
parentd81a1de96e2636163783c342b8fda965e696e382 (diff)
parentee87a097b0f66158ce2985940a5f28ba15a3552d (diff)
downloadu-boot-de2ad2c40db389e4747f566e44aa7f1a1aec91fb.tar.gz
u-boot-de2ad2c40db389e4747f566e44aa7f1a1aec91fb.tar.xz
u-boot-de2ad2c40db389e4747f566e44aa7f1a1aec91fb.zip
Merge git://git.denx.de/u-boot-dm
Diffstat (limited to 'include')
-rw-r--r--include/blk.h8
-rw-r--r--include/dm/ofnode.h24
-rw-r--r--include/dm/root.h14
3 files changed, 42 insertions, 4 deletions
diff --git a/include/blk.h b/include/blk.h
index 27abfddb94..1965812a9d 100644
--- a/include/blk.h
+++ b/include/blk.h
@@ -315,12 +315,12 @@ int blk_next_device(struct udevice **devp);
* @devnum: Device number, specific to the interface type, or -1 to
* allocate the next available number
* @blksz: Block size of the device in bytes (typically 512)
- * @size: Total size of the device in bytes
+ * @lba: Total number of blocks of the device
* @devp: the new device (which has not been probed)
*/
int blk_create_device(struct udevice *parent, const char *drv_name,
const char *name, int if_type, int devnum, int blksz,
- lbaint_t size, struct udevice **devp);
+ lbaint_t lba, struct udevice **devp);
/**
* blk_create_devicef() - Create a new named block device
@@ -332,12 +332,12 @@ int blk_create_device(struct udevice *parent, const char *drv_name,
* @devnum: Device number, specific to the interface type, or -1 to
* allocate the next available number
* @blksz: Block size of the device in bytes (typically 512)
- * @size: Total size of the device in bytes
+ * @lba: Total number of blocks of the device
* @devp: the new device (which has not been probed)
*/
int blk_create_devicef(struct udevice *parent, const char *drv_name,
const char *name, int if_type, int devnum, int blksz,
- lbaint_t size, struct udevice **devp);
+ lbaint_t lba, struct udevice **devp);
/**
* blk_prepare_device() - Prepare a block device for use
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index de2769ed53..79374b8f91 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -628,4 +628,28 @@ int ofnode_read_resource(ofnode node, uint index, struct resource *res);
int ofnode_read_resource_byname(ofnode node, const char *name,
struct resource *res);
+/**
+ * ofnode_for_each_subnode() - iterate over all subnodes of a parent
+ *
+ * @node: child node (ofnode, lvalue)
+ * @parent: parent node (ofnode)
+ *
+ * This is a wrapper around a for loop and is used like so:
+ *
+ * ofnode node;
+ *
+ * ofnode_for_each_subnode(node, parent) {
+ * Use node
+ * ...
+ * }
+ *
+ * Note that this is implemented as a macro and @node is used as
+ * iterator in the loop. The parent variable can be a constant or even a
+ * literal.
+ */
+#define ofnode_for_each_subnode(node, parent) \
+ for (node = ofnode_first_subnode(parent); \
+ ofnode_valid(node); \
+ node = ofnode_next_subnode(node))
+
#endif
diff --git a/include/dm/root.h b/include/dm/root.h
index 50a6011644..b075eef2c1 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -56,6 +56,20 @@ int dm_scan_platdata(bool pre_reloc_only);
int dm_scan_fdt(const void *blob, bool pre_reloc_only);
/**
+ * dm_extended_scan_fdt() - Scan the device tree and bind drivers
+ *
+ * This calls dm_scna_dft() which scans the device tree and creates a driver
+ * for each node. the top-level subnodes are examined and also all sub-nodes
+ * of "clocks" node.
+ *
+ * @blob: Pointer to device tree blob
+ * @pre_reloc_only: If true, bind only drivers with the DM_FLAG_PRE_RELOC
+ * flag. If false bind all drivers.
+ * @return 0 if OK, -ve on error
+ */
+int dm_extended_scan_fdt(const void *blob, bool pre_reloc_only);
+
+/**
* dm_scan_other() - Scan for other devices
*
* Some devices may not be visible to Driver Model. This weak function can