diff options
-rw-r--r-- | drivers/core/device-remove.c | 5 | ||||
-rw-r--r-- | include/dm/device.h | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c index 444e34b4921..ff5b28cb6a7 100644 --- a/drivers/core/device-remove.c +++ b/drivers/core/device-remove.c @@ -194,8 +194,9 @@ int device_remove(struct udevice *dev, uint flags) } } - if (!(drv->flags & DM_FLAG_DEFAULT_PD_CTRL_OFF) && - (dev != gd->cur_serial_dev)) + if (!(drv->flags & + (DM_FLAG_DEFAULT_PD_CTRL_OFF | DM_FLAG_REMOVE_WITH_PD_ON)) && + dev != gd->cur_serial_dev) dev_power_domain_off(dev); if (flags_remove(flags, drv->flags)) { diff --git a/include/dm/device.h b/include/dm/device.h index ab806d0b7e9..a56164b19bb 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -68,6 +68,12 @@ struct driver_info; #define DM_FLAG_PLATDATA_VALID (1 << 12) /* + * Device is removed without switching off its power domain. This might + * be required, i. e. for serial console (debug) output when booting OS. + */ +#define DM_FLAG_REMOVE_WITH_PD_ON (1 << 13) + +/* * 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. |