All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD
@ 2018-07-24  7:45 Peng Fan
  2018-07-24  7:45 ` [U-Boot] [PATCH 2/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined Peng Fan
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Peng Fan @ 2018-07-24  7:45 UTC (permalink / raw)
  To: u-boot

Because CONFIG_POWER_DOMAIN is enabled in defconfig,
however driver/power/domain is not built for SPL, there is build
failure when power_domain_on added to device_probe.
Because power domain is not needed in SPL, let's undef it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com>
Cc: Stefano Babic <sbabic@denx.de>
---

Need to find a way to avoid SPL build failure in future patch,
but in this patchset let's undef CONFIG_POWER_DOMAIN first,
because it is not needed.

 include/configs/opos6uldev.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/opos6uldev.h b/include/configs/opos6uldev.h
index b634d9eb03..75fefec0ac 100644
--- a/include/configs/opos6uldev.h
+++ b/include/configs/opos6uldev.h
@@ -15,6 +15,7 @@
 
 #ifdef CONFIG_SPL_BUILD
 #undef CONFIG_DM_REGULATOR
+#undef CONFIG_POWER_DOMAIN
 #endif
 #endif
 
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 2/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined
  2018-07-24  7:45 [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Peng Fan
@ 2018-07-24  7:45 ` Peng Fan
  2018-07-25  2:45   ` Simon Glass
  2018-07-24  7:45 ` [U-Boot] [PATCH 3/4] dm: core: device: enable power domain in probe Peng Fan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Peng Fan @ 2018-07-24  7:45 UTC (permalink / raw)
  To: u-boot

Add dummy functions when CONFIG_POWER_DOMAIN not defined.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
 include/power-domain.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/include/power-domain.h b/include/power-domain.h
index aba8c0f65c..fe2a1c5119 100644
--- a/include/power-domain.h
+++ b/include/power-domain.h
@@ -87,7 +87,14 @@ struct power_domain {
  * @power_domain	A pointer to a power domain struct to initialize.
  * @return 0 if OK, or a negative error code.
  */
+#ifdef CONFIG_POWER_DOMAIN
 int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
+#else
+int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 /**
  * power_domain_free - Free a previously requested power domain.
@@ -96,7 +103,14 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
  *		requested by power_domain_get().
  * @return 0 if OK, or a negative error code.
  */
+#ifdef CONFIG_POWER_DOMAIN
 int power_domain_free(struct power_domain *power_domain);
+#else
+int power_domain_free(struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 /**
  * power_domain_on - Enable power to a power domain.
@@ -105,7 +119,14 @@ int power_domain_free(struct power_domain *power_domain);
  *		requested by power_domain_get().
  * @return 0 if OK, or a negative error code.
  */
+#ifdef CONFIG_POWER_DOMAIN
 int power_domain_on(struct power_domain *power_domain);
+#else
+int power_domain_on(struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 /**
  * power_domain_off - Disable power ot a power domain.
@@ -114,6 +135,13 @@ int power_domain_on(struct power_domain *power_domain);
  *		requested by power_domain_get().
  * @return 0 if OK, or a negative error code.
  */
+#ifdef CONFIG_POWER_DOMAIN
 int power_domain_off(struct power_domain *power_domain);
+#else
+int power_domain_off(struct power_domain *power_domain)
+{
+	return -EINVAL;
+}
+#endif
 
 #endif
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 3/4] dm: core: device: enable power domain in probe
  2018-07-24  7:45 [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Peng Fan
  2018-07-24  7:45 ` [U-Boot] [PATCH 2/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined Peng Fan
@ 2018-07-24  7:45 ` Peng Fan
  2018-07-25  2:45   ` Simon Glass
  2018-07-24  7:45 ` [U-Boot] [PATCH 4/4] dm: power-domain: query power domain after get device Peng Fan
  2018-07-25  2:45 ` [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Simon Glass
  3 siblings, 1 reply; 11+ messages in thread
From: Peng Fan @ 2018-07-24  7:45 UTC (permalink / raw)
  To: u-boot

Enable power domain associated with the device when probe.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
---
 drivers/core/device.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/core/device.c b/drivers/core/device.c
index d5f5fc31b0..207d566b71 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -26,6 +26,7 @@
 #include <dm/util.h>
 #include <linux/err.h>
 #include <linux/list.h>
+#include <power-domain.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -304,6 +305,7 @@ static void *alloc_priv(int size, uint flags)
 
 int device_probe(struct udevice *dev)
 {
+	struct power_domain pd;
 	const struct driver *drv;
 	int size = 0;
 	int ret;
@@ -383,6 +385,11 @@ int device_probe(struct udevice *dev)
 	if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL)
 		pinctrl_select_state(dev, "default");
 
+	if (dev->parent && device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) {
+		if (!power_domain_get(dev, &pd))
+			power_domain_on(&pd);
+	}
+
 	ret = uclass_pre_probe_device(dev);
 	if (ret)
 		goto fail;
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 4/4] dm: power-domain: query power domain after get device
  2018-07-24  7:45 [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Peng Fan
  2018-07-24  7:45 ` [U-Boot] [PATCH 2/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined Peng Fan
  2018-07-24  7:45 ` [U-Boot] [PATCH 3/4] dm: core: device: enable power domain in probe Peng Fan
@ 2018-07-24  7:45 ` Peng Fan
  2018-07-25  2:45   ` Simon Glass
  2018-07-25  2:45 ` [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Simon Glass
  3 siblings, 1 reply; 11+ messages in thread
From: Peng Fan @ 2018-07-24  7:45 UTC (permalink / raw)
  To: u-boot

This is to test power_domain_on in device_probe.
If the device has a power-domain property, enable it
when probe the device. So add the test to check
whether it is powered on or not.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
---
 test/dm/power-domain.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/dm/power-domain.c b/test/dm/power-domain.c
index a1e1df2bb2..48318218a9 100644
--- a/test/dm/power-domain.c
+++ b/test/dm/power-domain.c
@@ -26,6 +26,8 @@ static int dm_test_power_domain(struct unit_test_state *uts)
 
 	ut_assertok(uclass_get_device_by_name(UCLASS_MISC, "power-domain-test",
 					      &dev_test));
+	ut_asserteq(1, sandbox_power_domain_query(dev_power_domain,
+						  TEST_POWER_DOMAIN));
 	ut_assertok(sandbox_power_domain_test_get(dev_test));
 
 	ut_assertok(sandbox_power_domain_test_on(dev_test));
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD
  2018-07-24  7:45 [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Peng Fan
                   ` (2 preceding siblings ...)
  2018-07-24  7:45 ` [U-Boot] [PATCH 4/4] dm: power-domain: query power domain after get device Peng Fan
@ 2018-07-25  2:45 ` Simon Glass
  2018-07-25  2:57   ` Peng Fan
  3 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2018-07-25  2:45 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On 24 July 2018 at 01:45, Peng Fan <peng.fan@nxp.com> wrote:
> Because CONFIG_POWER_DOMAIN is enabled in defconfig,
> however driver/power/domain is not built for SPL, there is build
> failure when power_domain_on added to device_probe.
> Because power domain is not needed in SPL, let's undef it.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>
> Need to find a way to avoid SPL build failure in future patch,
> but in this patchset let's undef CONFIG_POWER_DOMAIN first,
> because it is not needed.
>
>  include/configs/opos6uldev.h | 1 +
>  1 file changed, 1 insertion(+)

This should be handled by adding an SPL_POWER_DOMAIN option and
converting existing uses to CONFIG_IS_ENABLED(POWER_DOMAIN)

Regards,
Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 2/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined
  2018-07-24  7:45 ` [U-Boot] [PATCH 2/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined Peng Fan
@ 2018-07-25  2:45   ` Simon Glass
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Glass @ 2018-07-25  2:45 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On 24 July 2018 at 01:45, Peng Fan <peng.fan@nxp.com> wrote:
> Add dummy functions when CONFIG_POWER_DOMAIN not defined.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
>  include/power-domain.h | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/include/power-domain.h b/include/power-domain.h
> index aba8c0f65c..fe2a1c5119 100644
> --- a/include/power-domain.h
> +++ b/include/power-domain.h
> @@ -87,7 +87,14 @@ struct power_domain {
>   * @power_domain       A pointer to a power domain struct to initialize.
>   * @return 0 if OK, or a negative error code.
>   */
> +#ifdef CONFIG_POWER_DOMAIN
>  int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
> +#else
> +int power_domain_get(struct udevice *dev, struct power_domain *power_domain)
> +{
> +       return -EINVAL;

Actually shouldn't this be -ENOSYS?

> +}
> +#endif
>
>  /**
>   * power_domain_free - Free a previously requested power domain.
> @@ -96,7 +103,14 @@ int power_domain_get(struct udevice *dev, struct power_domain *power_domain);
>   *             requested by power_domain_get().
>   * @return 0 if OK, or a negative error code.
>   */
> +#ifdef CONFIG_POWER_DOMAIN
>  int power_domain_free(struct power_domain *power_domain);
> +#else
> +int power_domain_free(struct power_domain *power_domain)
> +{
> +       return -EINVAL;
> +}
> +#endif
>
>  /**
>   * power_domain_on - Enable power to a power domain.
> @@ -105,7 +119,14 @@ int power_domain_free(struct power_domain *power_domain);
>   *             requested by power_domain_get().
>   * @return 0 if OK, or a negative error code.
>   */
> +#ifdef CONFIG_POWER_DOMAIN
>  int power_domain_on(struct power_domain *power_domain);
> +#else
> +int power_domain_on(struct power_domain *power_domain)
> +{
> +       return -EINVAL;
> +}
> +#endif
>
>  /**
>   * power_domain_off - Disable power ot a power domain.
> @@ -114,6 +135,13 @@ int power_domain_on(struct power_domain *power_domain);
>   *             requested by power_domain_get().
>   * @return 0 if OK, or a negative error code.
>   */
> +#ifdef CONFIG_POWER_DOMAIN
>  int power_domain_off(struct power_domain *power_domain);
> +#else
> +int power_domain_off(struct power_domain *power_domain)
> +{
> +       return -EINVAL;
> +}
> +#endif
>
>  #endif
> --
> 2.14.1
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 3/4] dm: core: device: enable power domain in probe
  2018-07-24  7:45 ` [U-Boot] [PATCH 3/4] dm: core: device: enable power domain in probe Peng Fan
@ 2018-07-25  2:45   ` Simon Glass
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Glass @ 2018-07-25  2:45 UTC (permalink / raw)
  To: u-boot

On 24 July 2018 at 01:45, Peng Fan <peng.fan@nxp.com> wrote:
> Enable power domain associated with the device when probe.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  drivers/core/device.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 4/4] dm: power-domain: query power domain after get device
  2018-07-24  7:45 ` [U-Boot] [PATCH 4/4] dm: power-domain: query power domain after get device Peng Fan
@ 2018-07-25  2:45   ` Simon Glass
  0 siblings, 0 replies; 11+ messages in thread
From: Simon Glass @ 2018-07-25  2:45 UTC (permalink / raw)
  To: u-boot

On 24 July 2018 at 01:45, Peng Fan <peng.fan@nxp.com> wrote:
> This is to test power_domain_on in device_probe.
> If the device has a power-domain property, enable it
> when probe the device. So add the test to check
> whether it is powered on or not.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>  test/dm/power-domain.c | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD
  2018-07-25  2:45 ` [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Simon Glass
@ 2018-07-25  2:57   ` Peng Fan
  2018-07-27  0:35     ` Simon Glass
  0 siblings, 1 reply; 11+ messages in thread
From: Peng Fan @ 2018-07-25  2:57 UTC (permalink / raw)
  To: u-boot

Hi Simon,

> -----Original Message-----
> From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
> Sent: 2018年7月25日 10:46
> To: Peng Fan <peng.fan@nxp.com>
> Cc: U-Boot Mailing List <u-boot@lists.denx.de>; dl-linux-imx
> <linux-imx@nxp.com>; Sébastien Szymanski
> <sebastien.szymanski@armadeus.com>; Stefano Babic <sbabic@denx.de>
> Subject: Re: [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN
> when SPL_BUILD
> 
> Hi Peng,
> 
> On 24 July 2018 at 01:45, Peng Fan <peng.fan@nxp.com> wrote:
> > Because CONFIG_POWER_DOMAIN is enabled in defconfig, however
> > driver/power/domain is not built for SPL, there is build failure when
> > power_domain_on added to device_probe.
> > Because power domain is not needed in SPL, let's undef it.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
> > Cc: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > ---
> >
> > Need to find a way to avoid SPL build failure in future patch, but in
> > this patchset let's undef CONFIG_POWER_DOMAIN first, because it is not
> > needed.
> >
> >  include/configs/opos6uldev.h | 1 +
> >  1 file changed, 1 insertion(+)
> 
> This should be handled by adding an SPL_POWER_DOMAIN option and
> converting existing uses to CONFIG_IS_ENABLED(POWER_DOMAIN)

The opos6uldev_defconfig has "CONFIG_POWER_DOMAIN=y", so when building
SPL, this macro is still effective.
Opos6uldev compiles driver/core/device.c which includes power-domain.h in my later patch.
Because driver/power/domain is not built for SPL, so build failure for SPL.

The simple method for now is to undef CONFIG_POWER_DOMAIN for SPL build.
If use CONFIG_IS_ENABLED, the undef CONFIG_POWER_DOMAIN will not be detected in Kconfig.

Simply introduce SPL_POWER_DOMAIN could not fix this issue. Need to let SPL choose CONFIG_SPL_POWER_DOMAIN,
but not CONFIG_POWER_DOMAIN, I do not have a clear idea on how.

Thanks,
Peng.

> 
> Regards,
> Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD
  2018-07-25  2:57   ` Peng Fan
@ 2018-07-27  0:35     ` Simon Glass
  2018-07-27  2:18       ` Peng Fan
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2018-07-27  0:35 UTC (permalink / raw)
  To: u-boot

Hi Peng,

On 24 July 2018 at 20:57, Peng Fan <peng.fan@nxp.com> wrote:
> Hi Simon,
>
>> -----Original Message-----
>> From: sjg at google.com [mailto:sjg at google.com] On Behalf Of Simon Glass
>> Sent: 2018年7月25日 10:46
>> To: Peng Fan <peng.fan@nxp.com>
>> Cc: U-Boot Mailing List <u-boot@lists.denx.de>; dl-linux-imx
>> <linux-imx@nxp.com>; Sébastien Szymanski
>> <sebastien.szymanski@armadeus.com>; Stefano Babic <sbabic@denx.de>
>> Subject: Re: [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN
>> when SPL_BUILD
>>
>> Hi Peng,
>>
>> On 24 July 2018 at 01:45, Peng Fan <peng.fan@nxp.com> wrote:
>> > Because CONFIG_POWER_DOMAIN is enabled in defconfig, however
>> > driver/power/domain is not built for SPL, there is build failure when
>> > power_domain_on added to device_probe.
>> > Because power domain is not needed in SPL, let's undef it.
>> >
>> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> > Cc: "Sébastien Szymanski" <sebastien.szymanski@armadeus.com>
>> > Cc: Stefano Babic <sbabic@denx.de>
>> > ---
>> >
>> > Need to find a way to avoid SPL build failure in future patch, but in
>> > this patchset let's undef CONFIG_POWER_DOMAIN first, because it is not
>> > needed.
>> >
>> >  include/configs/opos6uldev.h | 1 +
>> >  1 file changed, 1 insertion(+)
>>
>> This should be handled by adding an SPL_POWER_DOMAIN option and
>> converting existing uses to CONFIG_IS_ENABLED(POWER_DOMAIN)
>
> The opos6uldev_defconfig has "CONFIG_POWER_DOMAIN=y", so when building
> SPL, this macro is still effective.
> Opos6uldev compiles driver/core/device.c which includes power-domain.h in my later patch.
> Because driver/power/domain is not built for SPL, so build failure for SPL.
>
> The simple method for now is to undef CONFIG_POWER_DOMAIN for SPL build.
> If use CONFIG_IS_ENABLED, the undef CONFIG_POWER_DOMAIN will not be detected in Kconfig.
>
> Simply introduce SPL_POWER_DOMAIN could not fix this issue. Need to let SPL choose CONFIG_SPL_POWER_DOMAIN,
> but not CONFIG_POWER_DOMAIN, I do not have a clear idea on how.

Here's how it works:

1. Have two separate Kconfig options: CONFIG_POWER_DOMAIN and
CONFIG_SPL_POWER_DOMAIN
2. Enable CONFIG_POWER_DOMAIN in the board config, but not
CONFIG_SPL_POWER_DOMAIN
3. Use CONFIG_IS_ENABLED(POWER_DOMAIN) everywhere (with if() or #if)
4. Now, U-Boot proper will support POWER_DOMAIN, but SPL will not

The #undef mechanism is the old way of doing it, before we had CONFIG_IS_ENABLED

Regards,
Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD
  2018-07-27  0:35     ` Simon Glass
@ 2018-07-27  2:18       ` Peng Fan
  0 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2018-07-27  2:18 UTC (permalink / raw)
  To: u-boot

Hi Simon,

> >> > Need to find a way to avoid SPL build failure in future patch, but
> >> > in this patchset let's undef CONFIG_POWER_DOMAIN first, because it
> >> > is not needed.
> >> >
> >> >  include/configs/opos6uldev.h | 1 +
> >> >  1 file changed, 1 insertion(+)
> >>
> >> This should be handled by adding an SPL_POWER_DOMAIN option and
> >> converting existing uses to CONFIG_IS_ENABLED(POWER_DOMAIN)
> >
> > The opos6uldev_defconfig has "CONFIG_POWER_DOMAIN=y", so when
> building
> > SPL, this macro is still effective.
> > Opos6uldev compiles driver/core/device.c which includes power-domain.h in
> my later patch.
> > Because driver/power/domain is not built for SPL, so build failure for SPL.
> >
> > The simple method for now is to undef CONFIG_POWER_DOMAIN for SPL
> build.
> > If use CONFIG_IS_ENABLED, the undef CONFIG_POWER_DOMAIN will not be
> detected in Kconfig.
> >
> > Simply introduce SPL_POWER_DOMAIN could not fix this issue. Need to
> > let SPL choose CONFIG_SPL_POWER_DOMAIN, but not
> CONFIG_POWER_DOMAIN, I do not have a clear idea on how.
> 
> Here's how it works:
> 
> 1. Have two separate Kconfig options: CONFIG_POWER_DOMAIN and
> CONFIG_SPL_POWER_DOMAIN 2. Enable CONFIG_POWER_DOMAIN in the
> board config, but not CONFIG_SPL_POWER_DOMAIN 3. Use
> CONFIG_IS_ENABLED(POWER_DOMAIN) everywhere (with if() or #if) 4. Now,
> U-Boot proper will support POWER_DOMAIN, but SPL will not
> 
> The #undef mechanism is the old way of doing it, before we had
> CONFIG_IS_ENABLED
> 

Just posted out V2 following your suggestion.

Thanks,
Peng.

> Regards,
> Simon

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-07-27  2:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24  7:45 [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Peng Fan
2018-07-24  7:45 ` [U-Boot] [PATCH 2/4] power-domain: add dummy functions when CONFIG_POWER_DOMAIN not defined Peng Fan
2018-07-25  2:45   ` Simon Glass
2018-07-24  7:45 ` [U-Boot] [PATCH 3/4] dm: core: device: enable power domain in probe Peng Fan
2018-07-25  2:45   ` Simon Glass
2018-07-24  7:45 ` [U-Boot] [PATCH 4/4] dm: power-domain: query power domain after get device Peng Fan
2018-07-25  2:45   ` Simon Glass
2018-07-25  2:45 ` [U-Boot] [PATCH 1/4] configs: opos6uldev: undef CONFIG_POWER_DOMAIN when SPL_BUILD Simon Glass
2018-07-25  2:57   ` Peng Fan
2018-07-27  0:35     ` Simon Glass
2018-07-27  2:18       ` Peng Fan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.