U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Troy Kisky <troykiskyboundary@gmail.com>
Cc: sjg@chromium.org, u-boot@lists.denx.de,
	gary.bisson@lairdconnect.com, "Marek Behún" <marek.behun@nic.cz>,
	"Samuel Dionne-Riel" <samuel@dionne-riel.com>
Subject: Re: [PATCH v2 02/26] cmd: nvedit: check for ENV_SUPPORT
Date: Fri, 10 Mar 2023 18:29:28 -0500	[thread overview]
Message-ID: <20230310232928.GL3041508@bill-the-cat> (raw)
In-Reply-To: <CAO46J5WjkH-W3MV-Wxq7qVgEvFpXrxZ7bWxtH_gQJHX_Edv3wg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4091 bytes --]

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.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2023-03-10 23:29 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24 18:10 [PATCH v2 00/26] CONFIG_IS_ENABLED vs IS_ENABLED Troy Kisky
2023-02-24 18:10 ` [PATCH v2 01/26] kconfig: add IS_ENABLED_NOCHECK to bypass usage_of_is_enabled_check Troy Kisky
2023-02-26 14:56   ` Simon Glass
2023-02-24 18:10 ` [PATCH v2 02/26] cmd: nvedit: check for ENV_SUPPORT Troy Kisky
2023-03-01 15:33   ` Tom Rini
2023-03-09 19:20     ` Troy Kisky
2023-03-09 19:36       ` Tom Rini
2023-03-09 20:45         ` Troy Kisky
2023-03-10 23:29           ` Tom Rini [this message]
2023-02-24 18:10 ` [PATCH v2 03/26] lib: crc32: prepare for CONFIG_IS_ENABLED changes Troy Kisky
2023-03-01 15:33   ` Tom Rini
2023-02-24 18:10 ` [PATCH v2 04/26] lib: md5: " Troy Kisky
2023-02-24 18:10 ` [PATCH v2 05/26] lib: sha1: " Troy Kisky
2023-02-24 18:10 ` [PATCH v2 06/26] lib: sha256: " Troy Kisky
2023-02-24 18:10 ` [PATCH v2 07/26] lib: sha512: " Troy Kisky
2023-02-24 18:10 ` [PATCH v2 08/26] tools: prevent CONFIG_IS_ENABLED errors by including linux/kconfig.h Troy Kisky
2023-03-01 15:33   ` Tom Rini
2023-02-24 18:10 ` [PATCH v2 09/26] tools: Makefile: prepare for CONFIG_IS_ENABLED changes by adding CONFIG_TOOLS_xxx Troy Kisky
2023-03-01 15:33   ` Tom Rini
2023-03-02 18:21     ` Troy Kisky
2023-03-02 19:19       ` Tom Rini
2023-02-24 18:10 ` [PATCH v2 10/26] x86: cpu: qemu: qemu: remove SPL use with CONFIG_IS_ENABLED Troy Kisky
2023-02-24 18:10 ` [PATCH v2 11/26] config_distro_bootcmd: remove booting environment variables from SPL environment Troy Kisky
2023-02-24 18:10 ` [PATCH v2 12/26] ofnode: fdt_support definitions needed if OF_CONTROL is enabled Troy Kisky
2023-02-24 18:10 ` [PATCH v2 13/26] ringneck-px30: use IS_ENABLED_NOCHECK to avoid CI test failure for ENV_IS_NOWHERE Troy Kisky
2023-02-26 14:56   ` Simon Glass
2023-02-24 18:10 ` [PATCH v2 14/26] puma-rk3399: " Troy Kisky
2023-02-26 14:56   ` Simon Glass
2023-03-01 15:33   ` Tom Rini
2023-02-24 18:10 ` [PATCH v2 15/26] fdt_support: always define fdt_fixup_mtdparts Troy Kisky
2023-02-24 18:10 ` [PATCH v2 16/26] m53menlo: define ft_board_setup only if CONFIG_IS_ENABLED(OF_LIBFDT) Troy Kisky
2023-02-24 18:10 ` [PATCH v2 17/26] freescale: common: pfuze: define pfuze_mode_init only if defined(CONFIG_DM_PMIC) Troy Kisky
2023-02-24 18:10 ` [PATCH v2 18/26] ns16550: match when to define bdf with uart code Troy Kisky
2023-02-24 18:10 ` [PATCH v2 19/26] solidrun: mx6cuboxi: use CONFIG_IS_ENABLED(SATA) instead of CONFIG_CMD_SATA Troy Kisky
2023-02-26 14:56   ` Simon Glass
2023-02-24 18:10 ` [PATCH v2 20/26] wandboard: use CONFIG_IS_ENABLED(SATA) instead of ifdef CONFIG_SATA Troy Kisky
2023-02-26 14:56   ` Simon Glass
2023-02-24 18:10 ` [PATCH v2 21/26] arm: mach-imx: use CONFIG_$(SPL_)SATA instead of CONFIG_SATA Troy Kisky
2023-02-24 18:10 ` [PATCH v2 22/26] x86: cpu: i386: cpu: only set pci_ram_top if CONFIG_IS_ENABLED(PCI) Troy Kisky
2023-02-26 14:56   ` Simon Glass
2023-02-24 18:10 ` [PATCH v2 23/26] gateworks: venice: Always define setup_fec and setup_eqos Troy Kisky
2023-02-26 14:56   ` Simon Glass
2023-02-24 18:10 ` [PATCH v2 24/26] power: pmic: add dm style definitions if not CONFIG_IS_ENABLED(POWER_LEGACY) Troy Kisky
2023-02-24 18:10 ` [PATCH v2 25/26] arm: cpu: armv7: ls102xa: fdt: remove eth_device support Troy Kisky
2023-02-24 18:10 ` [PATCH v2 26/26] CI: add test/usage_of_is_enabled_check.sh Troy Kisky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230310232928.GL3041508@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=gary.bisson@lairdconnect.com \
    --cc=marek.behun@nic.cz \
    --cc=samuel@dionne-riel.com \
    --cc=sjg@chromium.org \
    --cc=troykiskyboundary@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox