dm: core: Allow for not controlling the power-domain by DM framework
authorLokesh Vutla <lokeshvutla@ti.com>
Fri, 27 Sep 2019 08:18:12 +0000 (13:48 +0530)
committerSimon Glass <sjg@chromium.org>
Tue, 15 Oct 2019 14:40:03 +0000 (08:40 -0600)
In some remoteproc cases, enabling the power domain of the core will
start running the core. In such cases image should be loaded before
enabling the power domain. But the current DM framework enables the
power-domain by default during probe. This is causing the remotecore
to start and crash as there is no valid image loaded.

In order to avoid this introduce a DM flag that doesn't allow for
enabling/disabling the power-domain by DM framework.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/core/device.c
include/dm/device.h

index 28363ff00bab2c950b6a6cc8b0598211054a02c3..95f26efdd3bad7b54d3ab8fef2e554b9d05ded02 100644 (file)
@@ -393,7 +393,8 @@ int device_probe(struct udevice *dev)
                pinctrl_select_state(dev, "default");
 
        if (CONFIG_IS_ENABLED(POWER_DOMAIN) && dev->parent &&
-           device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) {
+           (device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) &&
+           !(drv->flags & DM_FLAG_DEFAULT_PD_CTRL_OFF)) {
                ret = dev_power_domain_on(dev);
                if (ret)
                        goto fail;
index 44cc3d2bd0115a946df5a4da19719d0864bc8f98..d7ad9d6728b0d26fff0ee1c85c9a26b86ee6e05a 100644 (file)
@@ -61,6 +61,9 @@ struct driver_info;
  */
 #define DM_FLAG_OS_PREPARE             (1 << 10)
 
+/* DM does not enable/disable the power domains corresponding to this device */
+#define DM_FLAG_DEFAULT_PD_CTRL_OFF    (1 << 11)
+
 /*
  * 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