summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/dm/device-internal.h6
-rw-r--r--include/dm/device.h5
-rw-r--r--include/dm/lists.h2
-rw-r--r--include/dm/root.h8
4 files changed, 16 insertions, 5 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h
index 26e5cf5..7005d03 100644
--- a/include/dm/device-internal.h
+++ b/include/dm/device-internal.h
@@ -45,12 +45,14 @@ int device_bind(struct udevice *parent, struct driver *drv,
* tree.
*
* @parent: Pointer to device's parent
+ * @pre_reloc_only: If true, bind the driver only if its DM_INIT_F flag is set.
+ * If false bind the driver always.
* @info: Name and platdata for this device
* @devp: Returns a pointer to the bound device
* @return 0 if OK, -ve on error
*/
-int device_bind_by_name(struct udevice *parent, const struct driver_info *info,
- struct udevice **devp);
+int device_bind_by_name(struct udevice *parent, bool pre_reloc_only,
+ const struct driver_info *info, struct udevice **devp);
/**
* device_probe() - Probe a device, activating it
diff --git a/include/dm/device.h b/include/dm/device.h
index ae75a3f..4679979 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -23,6 +23,9 @@ struct driver_info;
/* DM is responsible for allocating and freeing platdata */
#define DM_FLAG_ALLOC_PDATA (1 << 1)
+/* DM should init this device prior to relocation */
+#define DM_FLAG_PRE_RELOC (1 << 2)
+
/**
* struct udevice - An instance of a driver
*
@@ -117,6 +120,7 @@ struct udevice_id {
* ops: Driver-specific operations. This is typically a list of function
* pointers defined by the driver, to implement driver functions required by
* the uclass.
+ * @flags: driver flags - see DM_FLAGS_...
*/
struct driver {
char *name;
@@ -130,6 +134,7 @@ struct driver {
int priv_auto_alloc_size;
int platdata_auto_alloc_size;
const void *ops; /* driver-specific operations */
+ uint32_t flags;
};
/* Declare a new U-Boot driver */
diff --git a/include/dm/lists.h b/include/dm/lists.h
index 49d87e6..87a3af5 100644
--- a/include/dm/lists.h
+++ b/include/dm/lists.h
@@ -42,7 +42,7 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id);
* @early_only: If true, bind only drivers with the DM_INIT_F flag. If false
* bind all drivers.
*/
-int lists_bind_drivers(struct udevice *parent);
+int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only);
/**
* lists_bind_fdt() - bind a device tree node
diff --git a/include/dm/root.h b/include/dm/root.h
index 35818b1..d37b452 100644
--- a/include/dm/root.h
+++ b/include/dm/root.h
@@ -26,9 +26,11 @@ struct udevice *dm_root(void);
*
* This scans all available platdata and creates drivers for each
*
+ * @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_scan_platdata(void);
+int dm_scan_platdata(bool pre_reloc_only);
/**
* dm_scan_fdt() - Scan the device tree and bind drivers
@@ -36,9 +38,11 @@ int dm_scan_platdata(void);
* This scans the device tree and creates a driver for each 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_scan_fdt(const void *blob);
+int dm_scan_fdt(const void *blob, bool pre_reloc_only);
/**
* dm_init() - Initialise Driver Model structures