public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* Unable to select a different ENV location due env_get_location on zynqmp
@ 2022-02-14 20:10 Ricardo Salveti
  2022-02-15  7:41 ` Michal Simek
  0 siblings, 1 reply; 9+ messages in thread
From: Ricardo Salveti @ 2022-02-14 20:10 UTC (permalink / raw)
  To: Michal Simek, u-boot, Jorge Ramirez, Igor Opaniuk,
	Oleksandr Suvorov

Hi Michal,

This is a bit similar to the issue raised on iMX8-based targets a few
days ago, which is forcing the environment location based on the boot
mode and not allowing the user to use a different option via other
CONFIG options.

Should we really force the env location based on boot mode? Currently
there is no way to boot out of QSPI and save the environment on
emmc/fat/ext4, and removing CONFIG_ENV_IS_IN_SPI_FLASH causes the env
location to be set as ENVL_NOWHERE, which is not ideal, especially
when other env target locations are available at build time.

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index f0be9c022a7..08afb49570a 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -969,6 +969,10 @@ enum env_location env_get_location(enum
env_operation op, int prio)
        case QSPI_MODE_32BIT:
                if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH))
                        return ENVL_SPI_FLASH;
+               if (IS_ENABLED(CONFIG_ENV_IS_IN_FAT))
+                       return ENVL_FAT;
+               if (IS_ENABLED(CONFIG_ENV_IS_IN_EXT4))
+                       return ENVL_EXT4;
                return ENVL_NOWHERE;
        case JTAG_MODE:
        default:

A change like this one would allow other locations to be set, and just
use the boot mode to assign the priority instead.

Since I couldn't really find out what is the expected behavior on
functions defined at soc/board level (env.c sets based on priority,
depending on what is enabled at build time), I was wondering if we
shouldn't just drop this function entirely.

While I agree the board should have a set of defaults, not allowing
the user to change something like env location via CONFIGs seems wrong
to me.

Let me know what you think.

Thanks,
-- 
Ricardo Salveti

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

end of thread, other threads:[~2022-02-17  7:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-14 20:10 Unable to select a different ENV location due env_get_location on zynqmp Ricardo Salveti
2022-02-15  7:41 ` Michal Simek
2022-02-15  7:51   ` Rafał Miłecki
2022-02-15 13:27   ` Jorge Ramirez-Ortiz, Foundries
2022-02-15 13:54     ` Michal Simek
2022-02-15 15:02       ` Sean Anderson
2022-02-15 15:39         ` Michal Simek
2022-02-17  0:43           ` Ricardo Salveti
2022-02-17  7:51             ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox