diff mbox series

[v2,02/26] cmd: nvedit: check for ENV_SUPPORT

Message ID 20230224181047.2775829-3-troykiskyboundary@gmail.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series CONFIG_IS_ENABLED vs IS_ENABLED | expand

Commit Message

Troy Kisky Feb. 24, 2023, 6:10 p.m. UTC
Avoid error messages when SPL,TPL,VPL build don't
have the environment options of the main build.
This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).

Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 cmd/nvedit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Tom Rini March 1, 2023, 3:33 p.m. UTC | #1
On Fri, Feb 24, 2023 at 10:10:23AM -0800, Troy Kisky wrote:
> Avoid error messages when SPL,TPL,VPL build don't
> have the environment options of the main build.
> This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
> to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).
> 
> Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> ---
> 
> (no changes since v1)
> 
>  cmd/nvedit.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> index 7cbc3fd573a..ef0fe55431c 100644
> --- a/cmd/nvedit.c
> +++ b/cmd/nvedit.c
> @@ -43,6 +43,7 @@
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> +#if CONFIG_IS_ENABLED(ENV_SUPPORT)
>  #if	defined(CONFIG_ENV_IS_IN_EEPROM)	|| \
>  	defined(CONFIG_ENV_IS_IN_FLASH)		|| \
>  	defined(CONFIG_ENV_IS_IN_MMC)		|| \
> @@ -60,10 +61,12 @@ DECLARE_GLOBAL_DATA_PTR;
>  #endif
>  
>  #if	!defined(ENV_IS_IN_DEVICE)		&& \
> -	!defined(CONFIG_ENV_IS_NOWHERE)
> +	!defined(CONFIG_ENV_IS_NOWHERE)		&& \
> +	!defined(CONFIG_VPL_BUILD)
>  # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
>  NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
>  #endif
> +#endif

This is one of the #error messes that we no longer need with Kconfig,
where we can ensure things happen. Maybe we can use def_bool y if ..
instead of default y if ..., in the ENV_IS_NOWHERE choice ?
Troy Kisky March 9, 2023, 7:20 p.m. UTC | #2
On Wed, Mar 1, 2023 at 7:33 AM Tom Rini <trini@konsulko.com> wrote:

> On Fri, Feb 24, 2023 at 10:10:23AM -0800, Troy Kisky wrote:
> > Avoid error messages when SPL,TPL,VPL build don't
> > have the environment options of the main build.
> > This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
> > to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).
> >
> > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> > ---
> >
> > (no changes since v1)
> >
> >  cmd/nvedit.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> > index 7cbc3fd573a..ef0fe55431c 100644
> > --- a/cmd/nvedit.c
> > +++ b/cmd/nvedit.c
> > @@ -43,6 +43,7 @@
> >
> >  DECLARE_GLOBAL_DATA_PTR;
> >
> > +#if CONFIG_IS_ENABLED(ENV_SUPPORT)
> >  #if  defined(CONFIG_ENV_IS_IN_EEPROM)        || \
> >       defined(CONFIG_ENV_IS_IN_FLASH)         || \
> >       defined(CONFIG_ENV_IS_IN_MMC)           || \
> > @@ -60,10 +61,12 @@ DECLARE_GLOBAL_DATA_PTR;
> >  #endif
> >
> >  #if  !defined(ENV_IS_IN_DEVICE)              && \
> > -     !defined(CONFIG_ENV_IS_NOWHERE)
> > +     !defined(CONFIG_ENV_IS_NOWHERE)         && \
> > +     !defined(CONFIG_VPL_BUILD)
> >  # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
> >  NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
> >  #endif
> > +#endif
>
> This is one of the #error messes that we no longer need with Kconfig,
> where we can ensure things happen. Maybe we can use def_bool y if ..
> instead of default y if ..., in the ENV_IS_NOWHERE choice ?
>
> --
> Tom
>

Hi Tom

There is some weirdness here
git grep -A1 CONFIG_ENV_IS_NOWHERE *

am62ax_evm_r5_defconfig:CONFIG_ENV_IS_NOWHERE=y
am62ax_evm_r5_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
aristainetos2c_defconfig:CONFIG_ENV_IS_NOWHERE=y
aristainetos2c_defconfig-CONFIG_ENV_IS_IN_SPI_FLASH=y
--
aristainetos2ccslb_defconfig:CONFIG_ENV_IS_NOWHERE=y
aristainetos2ccslb_defconfig-CONFIG_ENV_IS_IN_SPI_FLASH=y
--
imx6q_bosch_acc_defconfig:CONFIG_ENV_IS_NOWHERE=y
imx6q_bosch_acc_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
imx8mn_beacon_2g_defconfig:CONFIG_ENV_IS_NOWHERE=y
imx8mn_beacon_2g_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
imx8mn_beacon_defconfig:CONFIG_ENV_IS_NOWHERE=y
imx8mn_beacon_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
imx8mn_beacon_fspi_defconfig:CONFIG_ENV_IS_NOWHERE=y
imx8mn_beacon_fspi_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
imx8mp_dhcom_pdk2_defconfig:CONFIG_ENV_IS_NOWHERE=y
imx8mp_dhcom_pdk2_defconfig-CONFIG_ENV_IS_IN_SPI_FLASH=y
--
imx93_11x11_evk_defconfig:CONFIG_ENV_IS_NOWHERE=y
imx93_11x11_evk_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
imxrt1020-evk_defconfig:CONFIG_ENV_IS_NOWHERE=y
imxrt1020-evk_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
imxrt1050-evk_defconfig:CONFIG_ENV_IS_NOWHERE=y
imxrt1050-evk_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
imxrt1170-evk_defconfig:CONFIG_ENV_IS_NOWHERE=y
imxrt1170-evk_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
j721e_evm_a72_defconfig:CONFIG_ENV_IS_NOWHERE=y
j721e_evm_a72_defconfig-CONFIG_ENV_IS_IN_FAT=y
--
j721e_hs_evm_a72_defconfig:CONFIG_ENV_IS_NOWHERE=y
j721e_hs_evm_a72_defconfig-CONFIG_ENV_IS_IN_FAT=y
--
puma-rk3399_defconfig:CONFIG_ENV_IS_NOWHERE=y
puma-rk3399_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
ringneck-px30_defconfig:CONFIG_ENV_IS_NOWHERE=y
ringneck-px30_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
sandbox64_defconfig:CONFIG_ENV_IS_NOWHERE=y
sandbox64_defconfig-CONFIG_ENV_IS_IN_EXT4=y
--
sandbox_defconfig:CONFIG_ENV_IS_NOWHERE=y
sandbox_defconfig-CONFIG_ENV_IS_IN_EXT4=y
--
sandbox_flattree_defconfig:CONFIG_ENV_IS_NOWHERE=y
sandbox_flattree_defconfig-CONFIG_ENV_IS_IN_EXT4=y
--
sandbox_noinst_defconfig:CONFIG_ENV_IS_NOWHERE=y
sandbox_noinst_defconfig-CONFIG_ENV_IS_IN_EXT4=y
--
sandbox_spl_defconfig:CONFIG_ENV_IS_NOWHERE=y
sandbox_spl_defconfig-CONFIG_ENV_IS_IN_EXT4=y
--
sandbox_vpl_defconfig:CONFIG_ENV_IS_NOWHERE=y
sandbox_vpl_defconfig-CONFIG_ENV_IS_IN_EXT4=y
--
socrates_defconfig:CONFIG_ENV_IS_NOWHERE=y
socrates_defconfig-CONFIG_ENV_IS_IN_FLASH=y
--
stm32mp13_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp13_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
stm32mp15-icore-stm32mp1-ctouch2_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp15-icore-stm32mp1-ctouch2_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
stm32mp15-icore-stm32mp1-edimm2.2_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp15-icore-stm32mp1-edimm2.2_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp15-microgea-stm32mp1-microdev2-of7_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
stm32mp15-microgea-stm32mp1-microdev2_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp15-microgea-stm32mp1-microdev2_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
stm32mp15_basic_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp15_basic_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
stm32mp15_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp15_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
stm32mp15_trusted_defconfig:CONFIG_ENV_IS_NOWHERE=y
stm32mp15_trusted_defconfig-CONFIG_ENV_IS_IN_MMC=y
--
xilinx_versal_virt_defconfig:CONFIG_ENV_IS_NOWHERE=y
xilinx_versal_virt_defconfig-CONFIG_ENV_IS_IN_FAT=y
--
xilinx_zynq_virt_defconfig:CONFIG_ENV_IS_NOWHERE=y
xilinx_zynq_virt_defconfig-CONFIG_ENV_IS_IN_FAT=y
--
xilinx_zynqmp_virt_defconfig:CONFIG_ENV_IS_NOWHERE=y
xilinx_zynqmp_virt_defconfig-CONFIG_ENV_IS_IN_FAT=y
Tom Rini March 9, 2023, 7:36 p.m. UTC | #3
On Thu, Mar 09, 2023 at 11:20:33AM -0800, Troy Kisky wrote:
> On Wed, Mar 1, 2023 at 7:33 AM Tom Rini <trini@konsulko.com> wrote:
> 
> > On Fri, Feb 24, 2023 at 10:10:23AM -0800, Troy Kisky wrote:
> > > Avoid error messages when SPL,TPL,VPL build don't
> > > have the environment options of the main build.
> > > This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
> > > to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).
> > >
> > > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > ---
> > >
> > > (no changes since v1)
> > >
> > >  cmd/nvedit.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> > > index 7cbc3fd573a..ef0fe55431c 100644
> > > --- a/cmd/nvedit.c
> > > +++ b/cmd/nvedit.c
> > > @@ -43,6 +43,7 @@
> > >
> > >  DECLARE_GLOBAL_DATA_PTR;
> > >
> > > +#if CONFIG_IS_ENABLED(ENV_SUPPORT)
> > >  #if  defined(CONFIG_ENV_IS_IN_EEPROM)        || \
> > >       defined(CONFIG_ENV_IS_IN_FLASH)         || \
> > >       defined(CONFIG_ENV_IS_IN_MMC)           || \
> > > @@ -60,10 +61,12 @@ DECLARE_GLOBAL_DATA_PTR;
> > >  #endif
> > >
> > >  #if  !defined(ENV_IS_IN_DEVICE)              && \
> > > -     !defined(CONFIG_ENV_IS_NOWHERE)
> > > +     !defined(CONFIG_ENV_IS_NOWHERE)         && \
> > > +     !defined(CONFIG_VPL_BUILD)
> > >  # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
> > >  NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
> > >  #endif
> > > +#endif
> >
> > This is one of the #error messes that we no longer need with Kconfig,
> > where we can ensure things happen. Maybe we can use def_bool y if ..
> > instead of default y if ..., in the ENV_IS_NOWHERE choice ?
> >
> > --
> > Tom
> >
> 
> Hi Tom
> 
> There is some weirdness here
> git grep -A1 CONFIG_ENV_IS_NOWHERE *
[snip]
> Should I force  CONFIG_ENV_IS_NOWHERE=n in these cases?

No, we support more than one env location being enabled at a time, with
nowhere being the location of last resort (at run time).
Troy Kisky March 9, 2023, 8:45 p.m. UTC | #4
On Thu, Mar 9, 2023 at 11:36 AM Tom Rini <trini@konsulko.com> wrote:

> On Thu, Mar 09, 2023 at 11:20:33AM -0800, Troy Kisky wrote:
> > On Wed, Mar 1, 2023 at 7:33 AM Tom Rini <trini@konsulko.com> wrote:
> >
> > > On Fri, Feb 24, 2023 at 10:10:23AM -0800, Troy Kisky wrote:
> > > > Avoid error messages when SPL,TPL,VPL build don't
> > > > have the environment options of the main build.
> > > > This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
> > > > to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).
> > > >
> > > > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > > ---
> > > >
> > > > (no changes since v1)
> > > >
> > > >  cmd/nvedit.c | 5 ++++-
> > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> > > > index 7cbc3fd573a..ef0fe55431c 100644
> > > > --- a/cmd/nvedit.c
> > > > +++ b/cmd/nvedit.c
> > > > @@ -43,6 +43,7 @@
> > > >
> > > >  DECLARE_GLOBAL_DATA_PTR;
> > > >
> > > > +#if CONFIG_IS_ENABLED(ENV_SUPPORT)
> > > >  #if  defined(CONFIG_ENV_IS_IN_EEPROM)        || \
> > > >       defined(CONFIG_ENV_IS_IN_FLASH)         || \
> > > >       defined(CONFIG_ENV_IS_IN_MMC)           || \
> > > > @@ -60,10 +61,12 @@ DECLARE_GLOBAL_DATA_PTR;
> > > >  #endif
> > > >
> > > >  #if  !defined(ENV_IS_IN_DEVICE)              && \
> > > > -     !defined(CONFIG_ENV_IS_NOWHERE)
> > > > +     !defined(CONFIG_ENV_IS_NOWHERE)         && \
> > > > +     !defined(CONFIG_VPL_BUILD)
> > > >  # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
> > > >  NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or
> CONFIG_ENV_IS_NOWHERE
> > > >  #endif
> > > > +#endif
> > >
> > > This is one of the #error messes that we no longer need with Kconfig,
> > > where we can ensure things happen. Maybe we can use def_bool y if ..
> > > instead of default y if ..., in the ENV_IS_NOWHERE choice ?
> > >
> > > --
> > > Tom
> > >
> >
> > Hi Tom
> >
> > There is some weirdness here
> > git grep -A1 CONFIG_ENV_IS_NOWHERE *
> [snip]
> > Should I force  CONFIG_ENV_IS_NOWHERE=n in these cases?
>
> No, we support more than one env location being enabled at a time, with
> nowhere being the location of last resort (at run time).
>
>
>
Okay, this help text is misleading then.

config ENV_IS_NOWHERE
bool "Environment is not stored"
default y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \
    !ENV_IS_IN_FAT && !ENV_IS_IN_FLASH && \
    !ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
    !ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
    !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
    !ENV_IS_IN_UBI
help
 Define this if you don't want to or can't have an environment stored
 on a storage medium. In this case the environment will still exist
 while U-Boot is running, but once U-Boot exits it will not be
 stored. U-Boot will therefore always start up with a default
 environment.
Tom Rini March 10, 2023, 11:29 p.m. UTC | #5
On Thu, Mar 09, 2023 at 12:45:14PM -0800, Troy Kisky wrote:
> On Thu, Mar 9, 2023 at 11:36 AM Tom Rini <trini@konsulko.com> wrote:
> 
> > On Thu, Mar 09, 2023 at 11:20:33AM -0800, Troy Kisky wrote:
> > > On Wed, Mar 1, 2023 at 7:33 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > > On Fri, Feb 24, 2023 at 10:10:23AM -0800, Troy Kisky wrote:
> > > > > Avoid error messages when SPL,TPL,VPL build don't
> > > > > have the environment options of the main build.
> > > > > This is needed when defined(CONFIG_ENV_IS_IN_xxx) is changed
> > > > > to CONFIG_IS_ENABLED(ENV_IS_IN_xxx).
> > > > >
> > > > > Signed-off-by: Troy Kisky <troykiskyboundary@gmail.com>
> > > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > > > ---
> > > > >
> > > > > (no changes since v1)
> > > > >
> > > > >  cmd/nvedit.c | 5 ++++-
> > > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/cmd/nvedit.c b/cmd/nvedit.c
> > > > > index 7cbc3fd573a..ef0fe55431c 100644
> > > > > --- a/cmd/nvedit.c
> > > > > +++ b/cmd/nvedit.c
> > > > > @@ -43,6 +43,7 @@
> > > > >
> > > > >  DECLARE_GLOBAL_DATA_PTR;
> > > > >
> > > > > +#if CONFIG_IS_ENABLED(ENV_SUPPORT)
> > > > >  #if  defined(CONFIG_ENV_IS_IN_EEPROM)        || \
> > > > >       defined(CONFIG_ENV_IS_IN_FLASH)         || \
> > > > >       defined(CONFIG_ENV_IS_IN_MMC)           || \
> > > > > @@ -60,10 +61,12 @@ DECLARE_GLOBAL_DATA_PTR;
> > > > >  #endif
> > > > >
> > > > >  #if  !defined(ENV_IS_IN_DEVICE)              && \
> > > > > -     !defined(CONFIG_ENV_IS_NOWHERE)
> > > > > +     !defined(CONFIG_ENV_IS_NOWHERE)         && \
> > > > > +     !defined(CONFIG_VPL_BUILD)
> > > > >  # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
> > > > >  NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or
> > CONFIG_ENV_IS_NOWHERE
> > > > >  #endif
> > > > > +#endif
> > > >
> > > > This is one of the #error messes that we no longer need with Kconfig,
> > > > where we can ensure things happen. Maybe we can use def_bool y if ..
> > > > instead of default y if ..., in the ENV_IS_NOWHERE choice ?
> > > >
> > > > --
> > > > Tom
> > > >
> > >
> > > Hi Tom
> > >
> > > There is some weirdness here
> > > git grep -A1 CONFIG_ENV_IS_NOWHERE *
> > [snip]
> > > Should I force  CONFIG_ENV_IS_NOWHERE=n in these cases?
> >
> > No, we support more than one env location being enabled at a time, with
> > nowhere being the location of last resort (at run time).
> >
> >
> >
> Okay, this help text is misleading then.
> 
> config ENV_IS_NOWHERE
> bool "Environment is not stored"
> default y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \
>     !ENV_IS_IN_FAT && !ENV_IS_IN_FLASH && \
>     !ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
>     !ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
>     !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
>     !ENV_IS_IN_UBI
> help
>  Define this if you don't want to or can't have an environment stored
>  on a storage medium. In this case the environment will still exist
>  while U-Boot is running, but once U-Boot exits it will not be
>  stored. U-Boot will therefore always start up with a default
>  environment.

Yes, rewording this was missed when updating the support.

> ______________
> 
> Perhaps this is better ?
> 
> config ENV_IS_NOT_IN_DEVICE
> def_bool y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \
>     !ENV_IS_IN_FAT && !ENV_IS_IN_FLASH && \
>     !ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
>     !ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
>     !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
>     !ENV_IS_IN_UBI
> select ENV_IS_NOWHERE
> 
> config ENV_IS_NOWHERE
> bool "Environment is not stored"
> help
>  Define this if you don't care whether or not an environment is stored
>  on a storage medium. In this case the environment will still exist
>  while U-Boot is running, but once U-Boot exits it may not be
>  stored. If no other ENV_IS_IN_ is defined, U-Boot will always start up
>  with a default  environment.
> 

Seems reasonable, thanks.
diff mbox series

Patch

diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 7cbc3fd573a..ef0fe55431c 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -43,6 +43,7 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
 #if	defined(CONFIG_ENV_IS_IN_EEPROM)	|| \
 	defined(CONFIG_ENV_IS_IN_FLASH)		|| \
 	defined(CONFIG_ENV_IS_IN_MMC)		|| \
@@ -60,10 +61,12 @@  DECLARE_GLOBAL_DATA_PTR;
 #endif
 
 #if	!defined(ENV_IS_IN_DEVICE)		&& \
-	!defined(CONFIG_ENV_IS_NOWHERE)
+	!defined(CONFIG_ENV_IS_NOWHERE)		&& \
+	!defined(CONFIG_VPL_BUILD)
 # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
 NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
 #endif
+#endif
 
 /*
  * Maximum expected input data size for import command