summaryrefslogtreecommitdiff
path: root/include/dm/device.h
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2017-04-24 09:48:02 +0200
committerBin Meng <bmeng.cn@gmail.com>2017-05-17 17:13:06 +0800
commit426f99fa98c3725fe0ca1eb8438d1215a2c6bd6b (patch)
tree6efd5bcaf65a045220083f6c6ff96fb79f10adaa /include/dm/device.h
parente98856fcff5adc64689c3d5597b0a36d867eec8f (diff)
dm: core: Add DM_FLAG_OS_PREPARE flag
This new flag can be added to DM device drivers, which need to do some final configuration before U-Boot exits and the OS (e.g. Linux) is started. The remove functions of those drivers will get called at this stage to do these last-stage configuration steps. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/dm/device.h')
-rw-r--r--include/dm/device.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index 079ec57003..df02e41df3 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -55,6 +55,12 @@ struct driver_info;
#define DM_FLAG_ACTIVE_DMA (1 << 9)
/*
+ * Call driver remove function to do some final configuration, before
+ * U-Boot exits and the OS is started
+ */
+#define DM_FLAG_OS_PREPARE (1 << 10)
+
+/*
* One or multiple of these flags are passed to device_remove() so that
* a selective device removal as specified by the remove-stage and the
* driver flags can be done.
@@ -66,10 +72,13 @@ enum {
/* Remove devices with active DMA */
DM_REMOVE_ACTIVE_DMA = DM_FLAG_ACTIVE_DMA,
+ /* Remove devices which need some final OS preparation steps */
+ DM_REMOVE_OS_PREPARE = DM_FLAG_OS_PREPARE,
+
/* Add more use cases here */
/* Remove devices with any active flag */
- DM_REMOVE_ACTIVE_ALL = DM_REMOVE_ACTIVE_DMA,
+ DM_REMOVE_ACTIVE_ALL = DM_REMOVE_ACTIVE_DMA | DM_REMOVE_OS_PREPARE,
};
/**