dm: core: Add a flag for power domain control on device removal
Subsystems (2)
PATCH 1/2 dm: core: Add a flag for power domain control on device removal
In various cases a power domain must stay enabled after device removal when booting OS (i.e. serial debug console or display). Add a flag to selectively skip switching off a power domain.
--- drivers/core/device-remove.c | 5 +++-- include/dm/device.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/core/device-remove.c +3 -2
@@ -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)) {
include/dm/device.h +6 -0
@@ -67,6 +67,12 @@ struct driver_info;/* Driver platdata has been read. Cleared when the device is removed */ #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
Signature · 1 line
2.17.1
PATCH 2/2 video: meson: keep power domain up after booting
Add driver flag to skip power domain disabling on device removal.
--- drivers/video/meson/meson_vpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/meson/meson_vpu.c +1 -1
@@ -210,5 +210,5 @@ U_BOOT_DRIVER(meson_vpu) = { .probe = meson_vpu_probe, .bind = meson_vpu_bind, .priv_auto_alloc_size = sizeof(struct meson_vpu_priv), - .flags = DM_FLAG_PRE_RELOC, + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_REMOVE_WITH_PD_ON, };
Signature · 1 line
2.17.1
PATCH 2/2 video: meson: keep power domain up after booting
Quoted 14 lines · Anatolij Gustschin
Add driver flag to skip power domain disabling on device removal.
Fixes 52edfed65de9 ("dm: core: device: switch off power domain after device removal")Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/video/meson/meson_vpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/video/meson/meson_vpu.c +0
-0
drivers/video/meson/meson_vpu.c U_BOOT_DRIVER(meson_vpu) = { · line 214
Quoted 6 lines
drivers/video/meson/meson_vpu.c +1
-1@@ -210,5 +210,5 @@ U_BOOT_DRIVER(meson_vpu) = { .probe = meson_vpu_probe, .bind = meson_vpu_bind, .priv_auto_alloc_size = sizeof(struct meson_vpu_priv), - .flags = DM_FLAG_PRE_RELOC, + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_REMOVE_WITH_PD_ON, };
and
Thanks,
Neil
PATCH 2/2 video: meson: keep power domain up after booting
Quoted 8 lines · Anatolij Gustschin
Add driver flag to skip power domain disabling on device removal.
Fixes 52edfed65de9 ("dm: core: device: switch off power domain after device removal")Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/video/meson/meson_vpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
PATCH 1/2 dm: core: Add a flag for power domain control on device removal
In reply to Anatolij GustschinQuoted 35 lines · Anatolij Gustschin
In various cases a power domain must stay enabled after device removal when booting OS (i.e. serial debug console or display). Add a flag to selectively skip switching off a power domain.
Fixes 52edfed65de9 ("dm: core: device: switch off power domain after device removal")Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/core/device-remove.c | 5 +++-- include/dm/device.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-)drivers/core/device-remove.c +3
-2@@ -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)) {include/dm/device.h +0
-0@@ -67,6 +67,12 @@ struct driver_info;/* Driver platdata has been read. Cleared when the device is removed */ #define DM_FLAG_PLATDATA_VALID (1 << 12)
include/dm/device.h struct driver_info; · line 78
Quoted 10 lines
include/dm/device.h +6
-0+/* +* 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
and
Thanks,
Neil
PATCH 1/2 dm: core: Add a flag for power domain control on device removal
In reply to Anatolij GustschinHi Anatolij,
Quoted 11 lines · Anatolij Gustschin
In various cases a power domain must stay enabled after device removal when booting OS (i.e. serial debug console or display). Add a flag to selectively skip switching off a power domain.
Fixes 52edfed65de9 ("dm: core: device: switch off power domain after device removal")Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/core/device-remove.c | 5 +++-- include/dm/device.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-)
This seems OK. Should we add a device tree property for this? Or is the driver-level side enough.
Regards,
Simon
PATCH 1/2 dm: core: Add a flag for power domain control on device removal
Hi Simon,
Quoted 15 lines · On Tue, 18 Feb 2020 11:31:26 -0700 Simon Glass sjg at chromium.org wrote:
Hi Anatolij,
Quoted 11 lines · Anatolij Gustschin
In various cases a power domain must stay enabled after device removal when booting OS (i.e. serial debug console or display). Add a flag to selectively skip switching off a power domain.
Fixes 52edfed65de9 ("dm: core: device: switch off power domain after device removal")Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/core/device-remove.c | 5 +++-- include/dm/device.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-)
Quoted 2 lines
This seems OK. Should we add a device tree property for this? Or is the driver-level side enough.
For all potential users I'm currently aware of the driver-level side is enough. Should this ever be required per device, then we can add a property later.
--
Anatolij
PATCH 1/2 dm: core: Add a flag for power domain control on device removal
Hi Anatolij,
Quoted 21 lines · Anatolij Gustschin
Hi Simon,
Quoted 15 lines · On Tue, 18 Feb 2020 11:31:26 -0700 Simon Glass sjg at chromium.org wrote:
Hi Anatolij,
Quoted 11 lines · Anatolij Gustschin
In various cases a power domain must stay enabled after device removal when booting OS (i.e. serial debug console or display). Add a flag to selectively skip switching off a power domain.
Fixes 52edfed65de9 ("dm: core: device: switch off power domain after device removal")Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/core/device-remove.c | 5 +++-- include/dm/device.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 2 lines
This seems OK. Should we add a device tree property for this? Or is the driver-level side enough.
For all potential users I'm currently aware of the driver-level side is enough. Should this ever be required per device, then we can add a property later.
Thanks,
Simon
PATCH 1/2 dm: core: Add a flag for power domain control on device removal
Hi Anatolij,
Quoted 21 lines · Anatolij Gustschin
Hi Simon,
Quoted 15 lines · On Tue, 18 Feb 2020 11:31:26 -0700 Simon Glass sjg at chromium.org wrote:
Hi Anatolij,
Quoted 11 lines · Anatolij Gustschin
In various cases a power domain must stay enabled after device removal when booting OS (i.e. serial debug console or display). Add a flag to selectively skip switching off a power domain.
Fixes 52edfed65de9 ("dm: core: device: switch off power domain after device removal")Signed-off-by Anatolij Gustschin <[email protected]>--- drivers/core/device-remove.c | 5 +++-- include/dm/device.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 2 lines
This seems OK. Should we add a device tree property for this? Or is the driver-level side enough.
For all potential users I'm currently aware of the driver-level side is enough. Should this ever be required per device, then we can add a property later.
Thanks,
Simon
Applied to u-boot-dm, thanks!