mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 05:08:24 +00:00
amd: versal2: Add support for saving env based on bootmode
Enable saving variables to MMC(FAT) and SPI based on primary bootmode. If bootmode is JTAG, dont save env anywhere(NOWHERE). Enable ENV_FAT_DEVICE_AND_PART="0:auto" for Versal Gen 2 platform. Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com> Link: https://lore.kernel.org/r/20250411154612.107136-1-venkatesh.abbarapu@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:
parent
b09a611016
commit
142a7c6cdf
3 changed files with 36 additions and 1 deletions
|
@ -365,3 +365,35 @@ int dram_init(void)
|
||||||
void reset_cpu(void)
|
void reset_cpu(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_ENV_IS_NOWHERE)
|
||||||
|
enum env_location env_get_location(enum env_operation op, int prio)
|
||||||
|
{
|
||||||
|
u32 bootmode = versal2_get_bootmode();
|
||||||
|
|
||||||
|
if (prio)
|
||||||
|
return ENVL_UNKNOWN;
|
||||||
|
|
||||||
|
switch (bootmode) {
|
||||||
|
case EMMC_MODE:
|
||||||
|
case SD_MODE:
|
||||||
|
case SD1_LSHFT_MODE:
|
||||||
|
case SD_MODE1:
|
||||||
|
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 OSPI_MODE:
|
||||||
|
case QSPI_MODE_24BIT:
|
||||||
|
case QSPI_MODE_32BIT:
|
||||||
|
if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH))
|
||||||
|
return ENVL_SPI_FLASH;
|
||||||
|
return ENVL_NOWHERE;
|
||||||
|
case JTAG_MODE:
|
||||||
|
case SELECTMAP_MODE:
|
||||||
|
default:
|
||||||
|
return ENVL_NOWHERE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -65,6 +65,9 @@ CONFIG_PARTITION_TYPE_GUID=y
|
||||||
CONFIG_OF_BOARD=y
|
CONFIG_OF_BOARD=y
|
||||||
CONFIG_DTB_RESELECT=y
|
CONFIG_DTB_RESELECT=y
|
||||||
CONFIG_MULTI_DTB_FIT=y
|
CONFIG_MULTI_DTB_FIT=y
|
||||||
|
CONFIG_ENV_IS_NOWHERE=y
|
||||||
|
CONFIG_ENV_IS_IN_FAT=y
|
||||||
|
CONFIG_ENV_IS_IN_SPI_FLASH=y
|
||||||
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
CONFIG_SYS_REDUNDAND_ENVIRONMENT=y
|
||||||
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||||
CONFIG_NET_LWIP=y
|
CONFIG_NET_LWIP=y
|
||||||
|
|
2
env/Kconfig
vendored
2
env/Kconfig
vendored
|
@ -485,7 +485,7 @@ config ENV_FAT_DEVICE_AND_PART
|
||||||
string "Device and partition for where to store the environemt in FAT"
|
string "Device and partition for where to store the environemt in FAT"
|
||||||
depends on ENV_IS_IN_FAT
|
depends on ENV_IS_IN_FAT
|
||||||
default "0:1" if TI_COMMON_CMD_OPTIONS
|
default "0:1" if TI_COMMON_CMD_OPTIONS
|
||||||
default "0:auto" if ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET
|
default "0:auto" if ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARCH_VERSAL_NET || ARCH_VERSAL2
|
||||||
default ":auto" if ARCH_SUNXI
|
default ":auto" if ARCH_SUNXI
|
||||||
default "0" if ARCH_AT91
|
default "0" if ARCH_AT91
|
||||||
help
|
help
|
||||||
|
|
Loading…
Add table
Reference in a new issue