Fixes for power domain on device removal

-----BEGIN PGP SIGNATURE-----
 
 iQFFBAABCgAvFiEEslwAIq+Gp8wWVbYnfxc6PpAIreYFAl5e7LsRHHNqZ0BjaHJv
 bWl1bS5vcmcACgkQfxc6PpAIreaRCQf8Db/T/j6DLurAjL0d4I8+phGPb8SniaiP
 HUV1GaVCgO7ZsGOLbKg/WMjX8icIEBDozveMfAJTWsO8ud+YDKXMJAbv7TdAYYr2
 cgEjsQb2cZSa2IrsVaYpcC6hKHDGS9l6INjiyS4c/TW/qoSnazy+niDC4dcpk7P6
 PdODgpnrtB+oV3d9ZW3KWgGYYFmFQhbJcqB4rwR/zaEhy0Ffg1bwdiK6gJryqcWm
 EUcuNlUxsgIULeRaAntgt+TioUID8or0Xf6eZHohktS8ZtbqOF7a1E3Yr7ECDqSG
 kuhrN9TH9ytcvJ8ryNUw8P7RyTDz1JVCRxN4xGtGV4evD1mnVEhjAA==
 =mF98
 -----END PGP SIGNATURE-----

Merge tag 'dm-pull-3mar20' of git://git.denx.de/u-boot-dm

Fixes for power domain on device removal
This commit is contained in:
Tom Rini 2020-03-03 21:48:49 -05:00
commit 1efb9796f8
3 changed files with 10 additions and 3 deletions

View File

@ -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)) {

View File

@ -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,
};

View File

@ -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