Merge tag 'v2022.04-rc4' into next
[platform/kernel/u-boot.git] / env / Kconfig
index c6ba088..443f2f7 100644 (file)
@@ -3,6 +3,24 @@ menu "Environment"
 config ENV_SUPPORT
        def_bool y
 
+config ENV_SOURCE_FILE
+       string "Environment file to use"
+       default ""
+       help
+         This sets the basename to use to generate the default environment.
+         This a text file as described in doc/usage/environment.rst
+
+         The file must be in the board directory and have a .env extension, so
+         the resulting filename is typically
+         board/<vendor>/<board>/<CONFIG_ENV_SOURCE_FILE>.env
+
+         If the file is not present, an error is produced.
+
+         If this CONFIG is empty, U-Boot uses CONFIG SYS_BOARD as a default, if
+         the file board/<vendor>/<board>/<SYS_BOARD>.env exists. Otherwise the
+         environment is assumed to come from the ad-hoc
+         CONFIG_EXTRA_ENV_SETTINGS #define
+
 config SAVEENV
        def_bool y if CMD_SAVEENV
 
@@ -44,10 +62,6 @@ config ENV_IS_IN_EEPROM
          still be one byte because the extra address bits are hidden
          in the chip address.
 
-         - CONFIG_ENV_EEPROM_IS_ON_I2C
-         define this, if you have I2C and SPI activated, and your
-         EEPROM, which holds the environment, is on the I2C bus.
-
          - CONFIG_I2C_ENV_EEPROM_BUS
          if you have an Environment on an EEPROM reached over
          I2C muxes, you can define here, how to reach this
@@ -82,10 +96,10 @@ config ENV_IS_IN_FLASH
        depends on !CHAIN_OF_TRUST
        default y if ARCH_CINTEGRATOR
        default y if ARCH_INTEGRATOR_CP
-       default y if M548x || M547x || M5282 || MCF547x_8x
+       default y if M548x || M547x || M5282
        default y if MCF532x || MCF52x2
        default y if MPC86xx || MPC83xx
-       default y if ARCH_MPC8572 || ARCH_MPC8548 || ARCH_MPC8641
+       default y if ARCH_MPC8548
        default y if SH && !CPU_SH4
        help
          Define this if you have a flash device which you want to use for the
@@ -204,6 +218,11 @@ 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
+         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.
+
          This value is also in units of bytes, but must also be aligned to
          an MMC sector boundary.
 
@@ -301,6 +320,7 @@ config ENV_IS_IN_SPI_FLASH
        default y if NORTHBRIDGE_INTEL_IVYBRIDGE
        default y if INTEL_QUARK
        default y if INTEL_QUEENSBAY
+       default y if ARCH_SUNXI
        help
          Define this if you have a SPI Flash memory device which you
          want to use for the environment.
@@ -324,58 +344,57 @@ config ENV_IS_IN_SPI_FLASH
          during a "saveenv" operation. CONFIG_ENV_OFFSET_REDUND must be
          aligned to an erase sector boundary.
 
-config USE_ENV_SPI_BUS
-       bool "SPI flash bus for environment"
+config ENV_SECT_SIZE_AUTO
+       bool "Use automatically detected sector size"
        depends on ENV_IS_IN_SPI_FLASH
        help
-         Force the SPI bus for environment.
-         If not defined, use CONFIG_SF_DEFAULT_BUS.
+         Some boards exist in multiple variants, with different
+         flashes having different sector sizes. In such cases, you
+         can select this option to make U-Boot use the actual sector
+         size when figuring out how much to erase, which can thus be
+         more efficient on the flashes with smaller erase size. Since
+         the environment must always be aligned on a sector boundary,
+         CONFIG_ENV_OFFSET must be aligned to the largest of the
+         different sector sizes, and CONFIG_ENV_SECT_SIZE should be
+         set to that value.
 
 config ENV_SPI_BUS
        int "Value of SPI flash bus for environment"
-       depends on USE_ENV_SPI_BUS
-       help
-         Value the SPI bus and chip select for environment.
-
-config USE_ENV_SPI_CS
-       bool "SPI flash chip select for environment"
        depends on ENV_IS_IN_SPI_FLASH
+       default SF_DEFAULT_BUS
        help
-         Force the SPI chip select for environment.
-         If not defined, use CONFIG_SF_DEFAULT_CS.
+         Value the SPI bus and chip select for environment.
 
 config ENV_SPI_CS
        int "Value of SPI flash chip select for environment"
-       depends on USE_ENV_SPI_CS
-       help
-         Value of the SPI chip select for environment.
-
-config USE_ENV_SPI_MAX_HZ
-       bool "SPI flash max frequency for environment"
        depends on ENV_IS_IN_SPI_FLASH
+       default SF_DEFAULT_CS
        help
-         Force the SPI max work clock for environment.
-         If not defined, use CONFIG_SF_DEFAULT_SPEED.
+         Value of the SPI chip select for environment.
 
 config ENV_SPI_MAX_HZ
        int "Value of SPI flash max frequency for environment"
-       depends on USE_ENV_SPI_MAX_HZ
-       help
-         Value of the SPI max work clock for environment.
-
-config USE_ENV_SPI_MODE
-       bool "SPI flash mode for environment"
        depends on ENV_IS_IN_SPI_FLASH
+       default SF_DEFAULT_SPEED
        help
-         Force the SPI work mode for environment.
+         Value of the SPI max work clock for environment.
 
 config ENV_SPI_MODE
        hex "Value of SPI flash work mode for environment"
-       depends on USE_ENV_SPI_MODE
+       depends on ENV_IS_IN_SPI_FLASH
+       default SF_DEFAULT_MODE
        help
          Value of the SPI work mode for environment.
          See include/spi.h for value.
 
+config ENV_SPI_EARLY
+       bool "Access Environment in SPI flashes before relocation"
+       depends on ENV_IS_IN_SPI_FLASH
+       help
+         Enable this if you want to use Environment in SPI flash
+         before relocation. Call env_init() and than you can use
+         env_get_f() for accessing Environment variables.
+
 config ENV_IS_IN_UBI
        bool "Environment in a UBI volume"
        depends on !CHAIN_OF_TRUST
@@ -403,13 +422,14 @@ config ENV_IS_IN_UBI
 
 config SYS_REDUNDAND_ENVIRONMENT
        bool "Enable redundant environment support"
-       depends on ENV_IS_IN_EEPROM || ENV_IS_IN_FLASH || ENV_IS_IN_MMC || \
-               ENV_IS_IN_NAND || ENV_IS_IN_SPI_FLASH || ENV_IS_IN_UBI
        help
          Normally, the environemt is stored in a single location.  By
          selecting this option, you can then define where to hold a redundant
          copy of the environment data, so that there is a valid backup copy in
          case there is a power failure during a "saveenv" operation.
+         Also this config changes the binary environment structure handling
+         which is used by env import/export commands which are independent of
+         storing variables to redundant location on a non volatile device.
 
 config ENV_FAT_INTERFACE
        string "Name of the block device for the environment"
@@ -422,9 +442,8 @@ config ENV_FAT_DEVICE_AND_PART
        string "Device and partition for where to store the environemt in FAT"
        depends on ENV_IS_IN_FAT
        default "0:1" if TI_COMMON_CMD_OPTIONS
-       default "0:auto" if ARCH_ZYNQ || ARCH_ZYNQMP
-       default "0:auto" if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
-       default "1:auto" if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
+       default "0:auto" if ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL
+       default ":auto" if ARCH_SUNXI
        default "0" if ARCH_AT91
        help
          Define this to a string to specify the partition of the device. It can
@@ -453,6 +472,14 @@ config ENV_FAT_FILE
          It's a string of the FAT file name. This file use to store the
          environment.
 
+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
+       default "uboot-redund.env"
+       help
+         It's a string of the FAT file name. This file use to store the
+         redundant environment.
+
 config ENV_EXT4_INTERFACE
        string "Name of the block device for the environment"
        depends on ENV_IS_IN_EXT4
@@ -477,6 +504,10 @@ config ENV_EXT4_DEVICE_AND_PART
                           If none, first valid partition in device D. If no
                           partition table then means device D.
 
+         If ENV_EXT4_INTERFACE is set to "mmc" then device 'D' can be omitted,
+         leaving the string starting with a colon, and the boot device will
+         be used.
+
 config ENV_EXT4_FILE
        string "Name of the EXT4 file to use for the environment"
        depends on ENV_IS_IN_EXT4
@@ -506,7 +537,7 @@ config ENV_OFFSET
                    ENV_IS_IN_SPI_FLASH
        default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
        default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
-       default 0x88000 if ARCH_SUNXI
+       default 0xF0000 if ARCH_SUNXI
        default 0xE0000 if ARCH_ZYNQ
        default 0x1E00000 if ARCH_ZYNQMP
        default 0x7F40000 if ARCH_VERSAL
@@ -521,6 +552,7 @@ 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
+       default 0
        help
          Offset from the start of the device (or partition) of the redundant
          environment location.
@@ -528,7 +560,8 @@ config ENV_OFFSET_REDUND
 config ENV_SIZE
        hex "Environment Size"
        default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
-       default 0x20000 if ARCH_SUNXI || ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
+       default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
+       default 0x10000 if ARCH_SUNXI
        default 0x8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
        default 0x2000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
        default 0x8000 if ARCH_ZYNQMP || ARCH_VERSAL
@@ -544,6 +577,7 @@ config ENV_SECT_SIZE
        default 0x40000 if ARCH_ZYNQMP || ARCH_VERSAL
        default 0x20000 if ARCH_ZYNQ || ARCH_OMAP2PLUS || ARCH_AT91
        default 0x20000 if MICROBLAZE && ENV_IS_IN_SPI_FLASH
+       default 0x10000 if ARCH_SUNXI && ENV_IS_IN_SPI_FLASH
        help
          Size of the sector containing the environment.
 
@@ -581,7 +615,7 @@ config SYS_RELOC_GD_ENV_ADDR
 config SYS_MMC_ENV_DEV
        int "mmc device number"
        depends on ENV_IS_IN_MMC || ENV_IS_IN_FAT || SYS_LS_PPA_FW_IN_MMC || \
-               CMD_MVEBU_BUBT || FMAN_ENET || QE
+               CMD_MVEBU_BUBT || FMAN_ENET || QE || PHY_CORTINA
        default 0
        help
          MMC device number on the platform where the environment is stored.
@@ -634,9 +668,26 @@ config DELAY_ENVIRONMENT
          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
+       help
+         If selected, after the environment has been loaded from its
+         persistent location, the "env_fdt_path" variable is looked
+         up and used as a path to a node in the control DTB. The
+         property/value pairs in that node is then used to update the
+         run-time environment. This can be useful to use the same
+         U-Boot binary with different board variants.
+
+config ENV_FDT_PATH
+       string "Default value for env_fdt_path variable"
+       depends on ENV_IMPORT_FDT
+       default "/config/environment"
+       help
+         The initial value of the env_fdt_path variable.
+
 config ENV_APPEND
        bool "Always append the environment with new data"
-       default n
        help
          If defined, the environment hash table is only ever appended with new
          data, but the existing hash table can never be dropped and reloaded
@@ -645,7 +696,6 @@ config ENV_APPEND
 
 config ENV_WRITEABLE_LIST
        bool "Permit write access only to listed variables"
-       default n
        help
          If defined, only environment variables which explicitly set the 'w'
          writeable flag can be written and modified at runtime. No variables
@@ -653,7 +703,6 @@ config ENV_WRITEABLE_LIST
 
 config ENV_ACCESS_IGNORE_FORCE
        bool "Block forced environment operations"
-       default n
        help
          If defined, don't allow the -f switch to env set override variable
          access flags.
@@ -773,6 +822,19 @@ config TPL_ENV_IS_IN_FLASH
 
 endif
 
+config USE_BOOTFILE
+       bool "Add a 'bootfile' environment variable"
+       help
+         The "bootfile" variable is used in some cases to allow for
+         controlling what file U-Boot will attempt to load and boot.  To set
+         this, enable this option and set the value in the next question.
+
+config BOOTFILE
+       string "'bootfile' environment variable value"
+       depends on USE_BOOTFILE
+       help
+         The value to set the "bootfile" variable to.
+
 config VERSION_VARIABLE
        bool "Add a 'ver' environment variable with the U-Boot version"
        help