Hi Peng, On 24 July 2018 at 20:57, Peng Fan <peng....@nxp.com> wrote: > Hi Simon, > >> -----Original Message----- >> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass >> Sent: 2018年7月25日 10:46 >> To: Peng Fan <peng....@nxp.com> >> Cc: U-Boot Mailing List <u-boot@lists.denx.de>; dl-linux-imx >> <linux-...@nxp.com>; Sébastien Szymanski >> <sebastien.szyman...@armadeus.com>; Stefano Babic <sba...@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....@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....@nxp.com> >> > Cc: "Sébastien Szymanski" <sebastien.szyman...@armadeus.com> >> > Cc: Stefano Babic <sba...@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 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot