u-boot/env
Ashok Reddy Soma 4dc5e26242 env: Fix default environment saving issue
When CONFIG_SYS_REDUNDAND_ENVIRONMENT is enabled, by default env is
getting saved to redundant environment irrespective of primary env is
present or not.

It means even if primary and redundant environment are not present, by
default, env is getting stored to redundant environment. Even if primary
env is present, it is choosing to store in redudndant env.

Ideally it should look for primary env and choose to store in primary env
if it is present. If both primary and redundant env are not present then
it should save in to primary env area.

Fix the issue by making env_valid = ENV_INVALID when both the
environments are not present.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-07-17 16:20:08 -04:00
..
attr.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
callback.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
common.c env: Fix default environment saving issue 2023-07-17 16:20:08 -04:00
eeprom.c env: eeprom: Remove CONFIG_I2C_ENV_EEPROM_BUS support 2022-12-22 10:31:48 -05:00
embedded.c env: Rework ENV_IS_EMBEDDED and related logic slightly 2022-12-22 10:31:47 -05:00
env.c env: Remove misuse of env is nowhere leftover 2023-05-16 16:12:21 -04:00
ext4.c Add SCSI scan for ENV in EXT4 or FAT 2022-07-08 09:05:47 -04:00
fat.c Add SCSI scan for ENV in EXT4 or FAT 2022-07-08 09:05:47 -04:00
flags.c env: Couple networking-related variable flags to CONFIG_NET 2023-02-10 11:24:08 -05:00
flash.c Audit <flash.h> inclusion 2022-08-04 16:18:47 -04:00
Kconfig env: mmc: statically set the environment partition name 2023-07-14 15:21:07 -04:00
Makefile env: Drop ENV_IS_IN_SATA 2023-02-07 14:33:48 -05:00
mmc.c env: mmc: statically set the environment partition name 2023-07-14 15:21:07 -04:00
nand.c Convert CONFIG_ENV_RANGE to Kconfig 2022-06-28 17:11:48 -04:00
nowhere.c env: nowhere: Cosmetic fix 2021-10-31 12:26:44 -06:00
nvram.c env: nvram: Drop CONFIG_SYS_NVRAM_ACCESS_ROUTINE 2022-12-22 10:31:48 -05:00
onenand.c mtd: Remove mtd_erase_callback() entirely 2021-10-23 15:47:33 +05:30
remote.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sf.c Audit <flash.h> inclusion 2022-08-04 16:18:47 -04:00
ubi.c env: ubi: add support of command env erase 2023-01-11 15:02:24 -05:00