diff options
Diffstat (limited to 'env')
| -rw-r--r-- | env/Kconfig | 69 | ||||
| -rw-r--r-- | env/common.c | 6 | ||||
| -rw-r--r-- | env/fat.c | 8 | ||||
| -rw-r--r-- | env/mmc.c | 28 | ||||
| -rw-r--r-- | env/sf.c | 6 | ||||
| -rw-r--r-- | env/ubi.c | 16 |
6 files changed, 63 insertions, 70 deletions
diff --git a/env/Kconfig b/env/Kconfig index 8203ef73fce..58a0666cd49 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -43,7 +43,7 @@ config ENV_OVERWRITE Use this to permit overriding of certain environmental variables like Ethernet and Serial -config OVERWRITE_ETHADDR_ONCE +config ENV_OVERWRITE_ETHADDR_ONCE bool "Enable overwriting ethaddr environment variables once" depends on !ENV_OVERWRITE help @@ -215,11 +215,11 @@ config ENV_IS_IN_MMC Define this if you have an MMC device which you want to use for the environment. - CONFIG_SYS_MMC_ENV_DEV: + CONFIG_ENV_MMC_DEVICE_INDEX: Specifies which MMC device the environment is stored in. - CONFIG_SYS_MMC_ENV_PART (optional): + CONFIG_ENV_MMC_EMMC_HW_PARTITION (optional): Specifies which MMC partition the environment is stored in. If not set, defaults to partition 0, the user area. Common values might be @@ -252,7 +252,7 @@ config ENV_IS_IN_MMC This value may also be positive or negative; this is handled in the same way as CONFIG_ENV_OFFSET. - In case CONFIG_SYS_MMC_ENV_PART is 1 (i.e. environment in eMMC boot + In case CONFIG_ENV_MMC_EMMC_HW_PARTITION is 1 (i.e. environment in eMMC boot partition) then setting CONFIG_ENV_OFFSET_REDUND to the same value as CONFIG_ENV_OFFSET makes use of the second eMMC boot partition for the redundant environment copy. @@ -489,7 +489,7 @@ config ENV_IS_IN_UBI the environment in. This will enable redundant environments in UBI. It is assumed that both volumes are in the same MTD partition. -config SYS_REDUNDAND_ENVIRONMENT +config ENV_REDUNDANT bool "Enable redundant environment support" help Normally, the environemt is stored in a single location. By @@ -543,7 +543,7 @@ config ENV_FAT_FILE config ENV_FAT_FILE_REDUND string "Name of the FAT file to use for the environment" - depends on ENV_IS_IN_FAT && SYS_REDUNDAND_ENVIRONMENT + depends on ENV_IS_IN_FAT && ENV_REDUNDANT default "uboot-redund.env" help It's a string of the FAT file name. This file use to store the @@ -595,7 +595,7 @@ config ENV_ADDR config ENV_ADDR_REDUND hex "Redundant environment address" - depends on ENV_IS_IN_FLASH && SYS_REDUNDAND_ENVIRONMENT + depends on ENV_IS_IN_FLASH && ENV_REDUNDANT help Offset from the start of the device (or partition) of the redundant environment location. @@ -625,7 +625,7 @@ config ENV_OFFSET config ENV_OFFSET_REDUND hex "Redundant environment offset" depends on (ENV_IS_IN_EEPROM || ENV_IS_IN_MMC || ENV_IS_IN_NAND || \ - ENV_IS_IN_SPI_FLASH) && SYS_REDUNDAND_ENVIRONMENT + ENV_IS_IN_SPI_FLASH) && ENV_REDUNDANT default 0x10C0000 if MICROBLAZE default 0x0 help @@ -675,7 +675,7 @@ config ENV_UBI_VOLUME config ENV_UBI_VOLUME_REDUND string "UBI redundant volume name" - depends on ENV_IS_IN_UBI && SYS_REDUNDAND_ENVIRONMENT + depends on ENV_IS_IN_UBI && ENV_REDUNDANT help Name of the redundant volume that you want to store the environment in. @@ -686,7 +686,7 @@ config ENV_UBI_VID_OFFSET help UBI VID offset for environment. If 0, no custom VID offset is used. -config SYS_RELOC_GD_ENV_ADDR +config ENV_RELOC_GD_ENV_ADDR bool "Relocate gd->env_addr" help Relocate the early env_addr pointer so we know it is not inside @@ -698,16 +698,18 @@ config ENV_MTD_DEV help MTD device name on the platform where the environment is stored. -config SYS_MMC_ENV_DEV - int "mmc device number" +config ENV_MMC_DEVICE_INDEX + int "SD/MMC device index" depends on ENV_IS_IN_MMC || ENV_IS_IN_FAT || ENV_IS_IN_EXT4 || \ CMD_MVEBU_BUBT || FMAN_ENET || QE || PHY_CORTINA default 0 help - MMC device number on the platform where the environment is stored. + SD/MMC device index on the platform where the environment is stored. + The index is often derived from DT aliases mmcN node ordering, and + matches the 'mmc list' command output. -config SYS_MMC_ENV_PART - int "mmc partition number" +config ENV_MMC_EMMC_HW_PARTITION + int "eMMC hardware partition number" depends on ENV_IS_IN_MMC || ENV_IS_IN_FAT default 0 help @@ -717,17 +719,20 @@ config SYS_MMC_ENV_PART partition 0 or the first boot partition, which is 1 or some other defined partition. -config USE_ENV_MMC_PARTITION - bool "use the mmc environment partition name" +config ENV_MMC_USE_SW_PARTITION + bool "Use SD/MMC environment software partition name" depends on ENV_IS_IN_MMC -config ENV_MMC_PARTITION - string "mmc environment partition name" - depends on USE_ENV_MMC_PARTITION +config ENV_MMC_SW_PARTITION + bool "SD/MMC environment software partition name" + depends on ENV_MMC_USE_SW_PARTITION help - MMC partition name used to save environment variables. - If this variable is unset, u-boot will try to get the env partition name - from the device-tree's /config node. + SD/MMC software partition name used to save environment variables. + This is a software partition name, i.e. one in partition table, not + an eMMC HW partition (see ENV_MMC_EMMC_HW_PARTITION for eMMC HW + partition configuration). If this variable is unset, u-boot will + try to get the env partition name from the device-tree's /config + node. config ENV_MMC_USE_DT bool "Read partition name and offset in DT" @@ -744,7 +749,7 @@ config SCSI_ENV_PART_UUID help UUID of the SCSI partition that you want to store the environment in. -config USE_DEFAULT_ENV_FILE +config ENV_USE_DEFAULT_ENV_TEXT_FILE bool "Create default environment from file" help Normally, the default environment is automatically generated @@ -753,9 +758,9 @@ config USE_DEFAULT_ENV_FILE you can instead define the entire default environment in an external file. -config DEFAULT_ENV_FILE +config ENV_DEFAULT_ENV_TEXT_FILE string "Path to default environment file" - depends on USE_DEFAULT_ENV_FILE + depends on ENV_USE_DEFAULT_ENV_TEXT_FILE help The path containing the default environment. The format is the same as accepted by the mkenvimage tool: lines @@ -769,18 +774,6 @@ config ENV_VARS_UBOOT_RUNTIME_CONFIG run-time determined information about the hardware to the environment. These will be named board_name, board_rev. -config DELAY_ENVIRONMENT - bool "Delay environment loading" - depends on !OF_CONTROL - help - Enable this to inhibit loading the environment during board - initialization. This can address the security risk of untrusted data - being used during boot. Normally the environment is loaded when the - board is initialised so that it is available to U-Boot. This inhibits - that so that the environment is not available until explicitly loaded - later by U-Boot code. With CONFIG_OF_CONTROL this is instead - controlled by the value of /config/load-environment. - config ENV_IMPORT_FDT bool "Amend environment by FDT properties" depends on OF_CONTROL diff --git a/env/common.c b/env/common.c index 86122582bc1..1e23c5de436 100644 --- a/env/common.c +++ b/env/common.c @@ -466,7 +466,7 @@ int env_import(const char *buf, int check, int flags) return -EIO; } -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT static unsigned char env_flags; int env_check_redund(const char *buf1, int buf1_read_fail, @@ -543,7 +543,7 @@ int env_import_redund(const char *buf1, int buf1_read_fail, return env_import((char *)ep, 0, flags); } -#endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */ +#endif /* CONFIG_ENV_REDUNDANT */ /* Export the environment and generate CRC for it. */ int env_export(env_t *env_out) @@ -560,7 +560,7 @@ int env_export(env_t *env_out) env_out->crc = crc32(0, env_out->data, ENV_SIZE); -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT env_out->flags = ++env_flags; /* increase the serial */ #endif diff --git a/env/fat.c b/env/fat.c index 1ad301eaaff..65ee1c8e086 100644 --- a/env/fat.c +++ b/env/fat.c @@ -86,7 +86,7 @@ static int env_fat_save(void) return 1; } -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT if (gd->env_valid == ENV_VALID) file = CONFIG_ENV_FAT_FILE_REDUND; #endif @@ -101,7 +101,7 @@ static int env_fat_save(void) return 1; } -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT gd->env_valid = (gd->env_valid == ENV_REDUND) ? ENV_VALID : ENV_REDUND; #endif @@ -112,7 +112,7 @@ static int env_fat_save(void) static int env_fat_load(void) { ALLOC_CACHE_ALIGN_BUFFER(char, buf1, CONFIG_ENV_SIZE); -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT ALLOC_CACHE_ALIGN_BUFFER(char, buf2, CONFIG_ENV_SIZE); int err2; #endif @@ -153,7 +153,7 @@ static int env_fat_load(void) } err1 = file_fat_read(CONFIG_ENV_FAT_FILE, buf1, CONFIG_ENV_SIZE); -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT err2 = file_fat_read(CONFIG_ENV_FAT_FILE_REDUND, buf2, CONFIG_ENV_SIZE); err1 = (err1 >= 0) ? 0 : -1; diff --git a/env/mmc.c b/env/mmc.c index 8848371eb4f..11375bd4464 100644 --- a/env/mmc.c +++ b/env/mmc.c @@ -157,14 +157,14 @@ static inline s64 mmc_offset(struct mmc *mmc, int copy) int hwpart = 0; int err; -#if defined(CONFIG_SYS_MMC_ENV_PART) +#if defined(CONFIG_ENV_MMC_EMMC_HW_PARTITION) hwpart = mmc_get_env_part(mmc); #endif -#if defined(CONFIG_ENV_MMC_PARTITION) - str = CONFIG_ENV_MMC_PARTITION; +#if defined(CONFIG_ENV_MMC_SW_PARTITION) + str = CONFIG_ENV_MMC_SW_PARTITION; #else - /* look for the partition in mmc CONFIG_SYS_MMC_ENV_DEV */ + /* look for the partition in mmc CONFIG_ENV_MMC_DEVICE_INDEX */ str = ofnode_conf_read_str(dt_prop.partition); #endif @@ -186,7 +186,7 @@ static inline s64 mmc_offset(struct mmc *mmc, int copy) defvalue = ENV_MMC_OFFSET; propname = dt_prop.offset; - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT) && copy) { + if (IS_ENABLED(CONFIG_ENV_REDUNDANT) && copy) { defvalue = ENV_MMC_OFFSET_REDUND; propname = dt_prop.offset_redund; } @@ -198,7 +198,7 @@ static inline s64 mmc_offset(struct mmc *mmc, int copy) { s64 offset = ENV_MMC_OFFSET; - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT) && copy) + if (IS_ENABLED(CONFIG_ENV_REDUNDANT) && copy) offset = ENV_MMC_OFFSET_REDUND; return offset; @@ -213,10 +213,10 @@ static bool mmc_env_is_redundant_in_both_boot_hwparts(struct mmc *mmc) * identical, store the environment and redundant environment in both * eMMC boot partitions, one copy in each. */ - if (!IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) + if (!IS_ENABLED(CONFIG_ENV_REDUNDANT)) return false; - if (CONFIG_SYS_MMC_ENV_PART != 1) + if (CONFIG_ENV_MMC_EMMC_HW_PARTITION != 1) return false; return mmc_offset(mmc, 0) == mmc_offset(mmc, 1); @@ -239,10 +239,10 @@ __weak int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr) return 0; } -#ifdef CONFIG_SYS_MMC_ENV_PART +#ifdef CONFIG_ENV_MMC_EMMC_HW_PARTITION __weak uint mmc_get_env_part(struct mmc *mmc) { - return CONFIG_SYS_MMC_ENV_PART; + return CONFIG_ENV_MMC_EMMC_HW_PARTITION; } static unsigned char env_mmc_orig_hwpart; @@ -337,7 +337,7 @@ static int env_mmc_save(void) if (ret) goto fini; - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) { + if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) { if (gd->env_valid == ENV_VALID) copy = 1; @@ -362,7 +362,7 @@ static int env_mmc_save(void) ret = 0; - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) + if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) gd->env_valid = gd->env_valid == ENV_REDUND ? ENV_VALID : ENV_REDUND; fini: @@ -411,7 +411,7 @@ static int env_mmc_erase(void) printf("\n"); ret = erase_env(mmc, CONFIG_ENV_SIZE, offset); - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) { + if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) { copy = 1; if (mmc_env_is_redundant_in_both_boot_hwparts(mmc)) { @@ -555,7 +555,7 @@ static int env_mmc_load(void) { if (IS_ENABLED(ENV_IS_EMBEDDED)) return 0; - else if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) + else if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) return env_mmc_load_redundant(); else return env_mmc_load_singular(); @@ -380,7 +380,7 @@ static int env_sf_init_early(void) tmp_env1 = (env_t *)memalign(ARCH_DMA_MINALIGN, CONFIG_ENV_SIZE); - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) + if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) tmp_env2 = (env_t *)memalign(ARCH_DMA_MINALIGN, CONFIG_ENV_SIZE); @@ -394,7 +394,7 @@ static int env_sf_init_early(void) read1_fail = spi_flash_read(env_flash, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, tmp_env1); - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) { + if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) { read2_fail = spi_flash_read(env_flash, CONFIG_ENV_OFFSET_REDUND, CONFIG_ENV_SIZE, tmp_env2); @@ -429,7 +429,7 @@ err_read: spi_flash_free(env_flash); free(tmp_env1); - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) + if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) free(tmp_env2); out: /* env is not valid. always return 0 */ diff --git a/env/ubi.c b/env/ubi.c index 2f4ca571edb..f424b1a16e8 100644 --- a/env/ubi.c +++ b/env/ubi.c @@ -27,14 +27,14 @@ DECLARE_GLOBAL_DATA_PTR; -#if CONFIG_SYS_REDUNDAND_ENVIRONMENT +#if CONFIG_ENV_REDUNDANT #define ENV_UBI_VOLUME_REDUND CONFIG_ENV_UBI_VOLUME_REDUND #else #define ENV_UBI_VOLUME_REDUND "invalid" #endif #ifdef CONFIG_CMD_SAVEENV -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT static int env_ubi_save(void) { ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1); @@ -76,7 +76,7 @@ static int env_ubi_save(void) return 0; } -#else /* ! CONFIG_SYS_REDUNDAND_ENVIRONMENT */ +#else /* ! CONFIG_ENV_REDUNDANT */ static int env_ubi_save(void) { ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1); @@ -102,10 +102,10 @@ static int env_ubi_save(void) puts("done\n"); return 0; } -#endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */ +#endif /* CONFIG_ENV_REDUNDANT */ #endif /* CONFIG_CMD_SAVEENV */ -#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT +#ifdef CONFIG_ENV_REDUNDANT static int env_ubi_load(void) { ALLOC_CACHE_ALIGN_BUFFER(char, env1_buf, CONFIG_ENV_SIZE); @@ -149,7 +149,7 @@ static int env_ubi_load(void) return env_import_redund((char *)tmp_env1, read1_fail, (char *)tmp_env2, read2_fail, H_EXTERNAL); } -#else /* ! CONFIG_SYS_REDUNDAND_ENVIRONMENT */ +#else /* ! CONFIG_ENV_REDUNDANT */ static int env_ubi_load(void) { ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE); @@ -180,7 +180,7 @@ static int env_ubi_load(void) return env_import(buf, 1, H_EXTERNAL); } -#endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */ +#endif /* CONFIG_ENV_REDUNDANT */ static int env_ubi_erase(void) { @@ -202,7 +202,7 @@ static int env_ubi_erase(void) CONFIG_ENV_UBI_VOLUME); ret = 1; } - if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT)) { + if (IS_ENABLED(CONFIG_ENV_REDUNDANT)) { if (ubi_volume_write(ENV_UBI_VOLUME_REDUND, (void *)env_buf, 0, CONFIG_ENV_SIZE)) { printf("\n** Unable to erase env to %s:%s **\n", |
