All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Suvorov <cryosay@gmail.com>
To: Ricardo Salveti <ricardo@foundries.io>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	"NXP i.MX U-Boot Team" <uboot-imx@nxp.com>,
	Peng Fan <peng.fan@nxp.com>,  Ye Li <ye.li@nxp.com>,
	Marek Vasut <marex@denx.de>, Simon Glass <sjg@chromium.org>,
	frieder.schrempf@kontron.de,
	 Oleksandr Suvorov <oleksandr.suvorov@foundries.io>,
	Igor Opaniuk <igor.opaniuk@foundries.io>
Subject: Re: [PATCH] ARM: imx8m: support env in fat and ext4
Date: Thu, 21 Oct 2021 11:38:04 +0300	[thread overview]
Message-ID: <CAGgjyvFpHfjEzwusx0mOr=ar3DQ4zWWznTWSaBV=zZuFhiTZ1Q@mail.gmail.com> (raw)
In-Reply-To: <20211020191626.3648540-1-ricardo@foundries.io>

On Wed, Oct 20, 2021 at 10:17 PM Ricardo Salveti <ricardo@foundries.io> wrote:
>
> Change boot device logic to also allow environment stored in fat and in
> ext4 when booting from SD or from eMMC.
>
> As the boot device check for SD and for eMMC was depending on
> ENV_IS_IN_MMC being defined, change the ifdef blocks at env_get_location
> to use IS_ENABLED instead for all modes, returning NOWHERE when no valid
> mode is found.
>
> Signed-off-by: Ricardo Salveti <ricardo@foundries.io>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>

> ---
>  arch/arm/mach-imx/imx8m/soc.c | 35 +++++++++++++++--------------------
>  1 file changed, 15 insertions(+), 20 deletions(-)
>
> diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
> index f2ddc834d4b..a3ce517a104 100644
> --- a/arch/arm/mach-imx/imx8m/soc.c
> +++ b/arch/arm/mach-imx/imx8m/soc.c
> @@ -1306,40 +1306,35 @@ void do_error(struct pt_regs *pt_regs, unsigned int esr)
>  enum env_location env_get_location(enum env_operation op, int prio)
>  {
>         enum boot_device dev = get_boot_device();
> -       enum env_location env_loc = ENVL_UNKNOWN;
>
>         if (prio)
> -               return env_loc;
> +               return ENVL_UNKNOWN;
>
>         switch (dev) {
> -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
>         case QSPI_BOOT:
> -               env_loc = ENVL_SPI_FLASH;
> -               break;
> -#endif
> -#ifdef CONFIG_ENV_IS_IN_NAND
> +               if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH))
> +                       return ENVL_SPI_FLASH;
> +               return ENVL_NOWHERE;
>         case NAND_BOOT:
> -               env_loc = ENVL_NAND;
> -               break;
> -#endif
> -#ifdef CONFIG_ENV_IS_IN_MMC
> +               if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND))
> +                       return ENVL_NAND;
> +               return ENVL_NOWHERE;
>         case SD1_BOOT:
>         case SD2_BOOT:
>         case SD3_BOOT:
>         case MMC1_BOOT:
>         case MMC2_BOOT:
>         case MMC3_BOOT:
> -               env_loc =  ENVL_MMC;
> -               break;
> -#endif
> +               if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC))
> +                       return ENVL_MMC;
> +               else if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4))
> +                       return ENVL_EXT4;
> +               else if (IS_ENABLED(CONFIG_ENV_IS_IN_FAT))
> +                       return ENVL_FAT;
> +               return ENVL_NOWHERE;
>         default:
> -#if defined(CONFIG_ENV_IS_NOWHERE)
> -               env_loc = ENVL_NOWHERE;
> -#endif
> -               break;
> +               return ENVL_NOWHERE;
>         }
> -
> -       return env_loc;
>  }
>
>  #ifndef ENV_IS_EMBEDDED
> --
> 2.33.0
>


-- 
Best regards
Oleksandr

Oleksandr Suvorov
cryosay@gmail.com

  reply	other threads:[~2021-10-21  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 19:16 [PATCH] ARM: imx8m: support env in fat and ext4 Ricardo Salveti
2021-10-21  8:38 ` Oleksandr Suvorov [this message]
2022-01-15 14:02 ` Fabio Estevam
2022-02-05 16:39 ` sbabic

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='CAGgjyvFpHfjEzwusx0mOr=ar3DQ4zWWznTWSaBV=zZuFhiTZ1Q@mail.gmail.com' \
    --to=cryosay@gmail.com \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=igor.opaniuk@foundries.io \
    --cc=marex@denx.de \
    --cc=oleksandr.suvorov@foundries.io \
    --cc=peng.fan@nxp.com \
    --cc=ricardo@foundries.io \
    --cc=sbabic@denx.de \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=ye.li@nxp.com \
    /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 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.