Commit 85fc970d authored by Simon Glass's avatar Simon Glass Committed by Tom Rini
Browse files

Convert CONFIG_ENV_IS_IN_FLASH to Kconfig



This converts the following to Kconfig:
   CONFIG_ENV_IS_IN_FLASH
Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
parent e73496d0
......@@ -3412,76 +3412,6 @@ following configurations:
Builds up envcrc with the target environment so that external utils
may easily extract it and embed it in final U-Boot images.
- CONFIG_ENV_IS_IN_FLASH:
Define this if the environment is in flash memory.
a) The environment occupies one whole flash sector, which is
"embedded" in the text segment with the U-Boot code. This
happens usually with "bottom boot sector" or "top boot
sector" type flash chips, which have several smaller
sectors at the start or the end. For instance, such a
layout can have sector sizes of 8, 2x4, 16, Nx32 kB. In
such a case you would place the environment in one of the
4 kB sectors - with U-Boot code before and after it. With
"top boot sector" type flash chips, you would put the
environment in one of the last sectors, leaving a gap
between U-Boot and the environment.
- CONFIG_ENV_OFFSET:
Offset of environment data (variable area) to the
beginning of flash memory; for instance, with bottom boot
type flash chips the second sector can be used: the offset
for this sector is given here.
CONFIG_ENV_OFFSET is used relative to CONFIG_SYS_FLASH_BASE.
- CONFIG_ENV_ADDR:
This is just another way to specify the start address of
the flash sector containing the environment (instead of
CONFIG_ENV_OFFSET).
- CONFIG_ENV_SECT_SIZE:
Size of the sector containing the environment.
b) Sometimes flash chips have few, equal sized, BIG sectors.
In such a case you don't want to spend a whole sector for
the environment.
- CONFIG_ENV_SIZE:
If you use this in combination with CONFIG_ENV_IS_IN_FLASH
and CONFIG_ENV_SECT_SIZE, you can specify to use only a part
of this flash sector for the environment. This saves
memory for the RAM copy of the environment.
It may also save flash memory if you decide to use this
when your environment is "embedded" within U-Boot code,
since then the remainder of the flash sector could be used
for U-Boot code. It should be pointed out that this is
STRONGLY DISCOURAGED from a robustness point of view:
updating the environment in flash makes it always
necessary to erase the WHOLE sector. If something goes
wrong before the contents has been restored from a copy in
RAM, your target system will be dead.
- CONFIG_ENV_ADDR_REDUND
CONFIG_ENV_SIZE_REDUND
These settings describe a second storage area used 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.
BE CAREFUL! Any changes to the flash layout, and some changes to the
source code will make it necessary to adapt <board>/u-boot.lds*
accordingly!
- CONFIG_ENV_IS_IN_NVRAM:
Define this if you have some non-volatile memory device
......
......@@ -11,11 +11,13 @@ config ARCH_INTEGRATOR_AP
config ARCH_INTEGRATOR_CP
bool "Support Integrator/CP platform"
select ARCH_CINTEGRATOR
imply ENV_IS_IN_FLASH
endchoice
config ARCH_CINTEGRATOR
bool
imply ENV_IS_IN_FLASH
choice
prompt "Integrator core module select"
......
......@@ -10,6 +10,7 @@ config MCF520x
config MCF52x2
bool
imply ENV_IS_IN_FLASH
config MCF523x
bool
......@@ -22,6 +23,7 @@ config MCF5301x
config MCF532x
bool
imply ENV_IS_IN_FLASH
config MCF537x
bool
......@@ -37,6 +39,7 @@ config MCF5227x
config MCF547x_8x
bool
imply ENV_IS_IN_FLASH
# processor type
config M5208
......@@ -70,6 +73,7 @@ config M5275
config M5282
bool
select MCF52x2
imply ENV_IS_IN_FLASH
config M5307
bool
......@@ -107,10 +111,12 @@ config M52277
config M547x
bool
select MCF547x_8x
imply ENV_IS_IN_FLASH
config M548x
bool
select MCF547x_8x
imply ENV_IS_IN_FLASH
choice
prompt "Target select"
......@@ -191,10 +197,12 @@ config TARGET_M54455EVB
config TARGET_M5475EVB
bool "Support M5475EVB"
select M547x
imply ENV_IS_IN_FLASH
config TARGET_M5485EVB
bool "Support M5485EVB"
select M548x
imply ENV_IS_IN_FLASH
config TARGET_AMCORE
bool "Support AMCORE"
......
......@@ -15,6 +15,7 @@ config TARGET_MICROBLAZE_GENERIC
select OF_CONTROL
select DM
select DM_SERIAL
select ENV_IS_IN_FLASH
endchoice
......
......@@ -21,6 +21,7 @@ config TARGET_QEMU_MIPS
select SUPPORTS_CPU_MIPS64_R1
select SUPPORTS_CPU_MIPS64_R2
select ROM_EXCEPTION_VECTORS
imply ENV_IS_IN_FLASH
config TARGET_MALTA
bool "Support malta"
......@@ -42,6 +43,7 @@ config TARGET_MALTA
select SWAP_IO_SPACE
select MIPS_L1_CACHE_SHIFT_6
select ROM_EXCEPTION_VECTORS
imply ENV_IS_IN_FLASH
config TARGET_VCT
bool "Support vct"
......@@ -108,6 +110,7 @@ config TARGET_BOSTON
select SUPPORTS_CPU_MIPS64_R2
select SUPPORTS_CPU_MIPS64_R6
select ROM_EXCEPTION_VECTORS
imply ENV_IS_IN_FLASH
config TARGET_XILFPGA
bool "Support Imagination Xilfpga"
......@@ -197,6 +200,7 @@ config CPU_MIPS64_R2
bool "MIPS64 Release 2"
depends on SUPPORTS_CPU_MIPS64_R2
select 64BIT
imply ENV_IS_IN_FLASH
help
Choose this option to build a kernel for release 2 through 5 of the
MIPS64 architecture.
......
......@@ -28,6 +28,7 @@ config MPC86xx
bool "MPC86xx"
select SYS_FSL_DDR
select SYS_FSL_DDR_BE
imply ENV_IS_IN_FLASH
config 8xx
bool "MPC8xx"
......
......@@ -13,6 +13,7 @@ config TARGET_MPC8308_P1M
config TARGET_SBC8349
bool "Support sbc8349"
imply ENV_IS_IN_FLASH
config TARGET_VE8313
bool "Support ve8313"
......@@ -39,6 +40,7 @@ config TARGET_MPC8323ERDB
config TARGET_MPC832XEMDS
bool "Support MPC832XEMDS"
select BOARD_EARLY_INIT_F
imply ENV_IS_IN_FLASH
config TARGET_MPC8349EMDS
bool "Support MPC8349EMDS"
......@@ -50,6 +52,7 @@ config TARGET_MPC8349EMDS
config TARGET_MPC8349ITX
bool "Support MPC8349ITX"
imply CMD_IRQ
imply ENV_IS_IN_FLASH
config TARGET_MPC837XEMDS
bool "Support MPC837XEMDS"
......@@ -74,11 +77,13 @@ config TARGET_SUVD3
bool "Support suvd3"
imply CMD_CRAMFS
imply FS_CRAMFS
imply ENV_IS_IN_FLASH
config TARGET_TUXX1
bool "Support tuxx1"
imply CMD_CRAMFS
imply FS_CRAMFS
imply ENV_IS_IN_FLASH
config TARGET_TQM834X
bool "Support TQM834x"
......@@ -90,6 +95,7 @@ config TARGET_HRCON
config TARGET_STRIDER
bool "Support strider"
select SYS_FSL_ERRATUM_ESDHC111
imply ENV_IS_IN_FLASH
endchoice
......
......@@ -19,6 +19,7 @@ choice
config TARGET_SBC8548
bool "Support sbc8548"
select ARCH_MPC8548
imply ENV_IS_IN_FLASH
config TARGET_SOCRATES
bool "Support socrates"
......@@ -104,6 +105,7 @@ config TARGET_MPC8544DS
config TARGET_MPC8548CDS
bool "Support MPC8548CDS"
select ARCH_MPC8548
imply ENV_IS_IN_FLASH
config TARGET_MPC8555CDS
bool "Support MPC8555CDS"
......@@ -549,6 +551,7 @@ config ARCH_MPC8548
select SYS_FSL_SEC_BE
select SYS_FSL_SEC_COMPAT_2
select SYS_PPC_E500_USE_DEBUG_TLB
imply ENV_IS_IN_FLASH
config ARCH_MPC8555
bool
......@@ -596,6 +599,7 @@ config ARCH_MPC8572
select SYS_FSL_SEC_COMPAT_2
select SYS_PPC_E500_USE_DEBUG_TLB
select FSL_ELBC
imply ENV_IS_IN_FLASH
config ARCH_P1010
bool
......
......@@ -40,6 +40,7 @@ config ARCH_MPC8641
select FSL_LAW
select SYS_FSL_HAS_DDR1
select SYS_FSL_HAS_DDR2
imply ENV_IS_IN_FLASH
config FSL_LAW
bool
......
......@@ -3,13 +3,16 @@ menu "SuperH architecture"
config CPU_SH2
bool
imply ENV_IS_IN_FLASH
config CPU_SH2A
bool
select CPU_SH2
imply ENV_IS_IN_FLASH
config CPU_SH3
bool
imply ENV_IS_IN_FLASH
config CPU_SH4
bool
......
......@@ -176,6 +176,78 @@ endmenu
menu "Environment"
config ENV_IS_IN_FLASH
bool "Environment in flash memory"
depends on !CHAIN_OF_TRUST
help
Define this if you have a flash device which you want to use for the
environment.
a) The environment occupies one whole flash sector, which is
"embedded" in the text segment with the U-Boot code. This
happens usually with "bottom boot sector" or "top boot
sector" type flash chips, which have several smaller
sectors at the start or the end. For instance, such a
layout can have sector sizes of 8, 2x4, 16, Nx32 kB. In
such a case you would place the environment in one of the
4 kB sectors - with U-Boot code before and after it. With
"top boot sector" type flash chips, you would put the
environment in one of the last sectors, leaving a gap
between U-Boot and the environment.
CONFIG_ENV_OFFSET:
Offset of environment data (variable area) to the
beginning of flash memory; for instance, with bottom boot
type flash chips the second sector can be used: the offset
for this sector is given here.
CONFIG_ENV_OFFSET is used relative to CONFIG_SYS_FLASH_BASE.
CONFIG_ENV_ADDR:
This is just another way to specify the start address of
the flash sector containing the environment (instead of
CONFIG_ENV_OFFSET).
CONFIG_ENV_SECT_SIZE:
Size of the sector containing the environment.
b) Sometimes flash chips have few, equal sized, BIG sectors.
In such a case you don't want to spend a whole sector for
the environment.
CONFIG_ENV_SIZE:
If you use this in combination with CONFIG_ENV_IS_IN_FLASH
and CONFIG_ENV_SECT_SIZE, you can specify to use only a part
of this flash sector for the environment. This saves
memory for the RAM copy of the environment.
It may also save flash memory if you decide to use this
when your environment is "embedded" within U-Boot code,
since then the remainder of the flash sector could be used
for U-Boot code. It should be pointed out that this is
STRONGLY DISCOURAGED from a robustness point of view:
updating the environment in flash makes it always
necessary to erase the WHOLE sector. If something goes
wrong before the contents has been restored from a copy in
RAM, your target system will be dead.
CONFIG_ENV_ADDR_REDUND
CONFIG_ENV_SIZE_REDUND
These settings describe a second storage area used 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.
BE CAREFUL! Any changes to the flash layout, and some changes to the
source code will make it necessary to adapt <board>/u-boot.lds*
accordingly!
config ENV_IS_IN_MMC
bool "Environment in an MMC device"
depends on !CHAIN_OF_TRUST
......
......@@ -2,6 +2,7 @@ CONFIG_NIOS2=y
CONFIG_SYS_CONFIG_NAME="10m50_devboard"
CONFIG_DEFAULT_DEVICE_TREE="10m50_devboard"
CONFIG_FIT=y
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_SYS_CONSOLE_INFO_QUIET=y
CONFIG_VERSION_VARIABLE=y
CONFIG_HUSH_PARSER=y
......
......@@ -2,6 +2,7 @@ CONFIG_NIOS2=y
CONFIG_SYS_CONFIG_NAME="3c120_devboard"
CONFIG_DEFAULT_DEVICE_TREE="3c120_devboard"
CONFIG_FIT=y
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_SYS_CONSOLE_INFO_QUIET=y
CONFIG_VERSION_VARIABLE=y
CONFIG_HUSH_PARSER=y
......
......@@ -5,6 +5,7 @@ CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTDELAY=10
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_HUSH_PARSER=y
......
......@@ -5,6 +5,7 @@ CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTDELAY=10
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_HUSH_PARSER=y
......
......@@ -6,6 +6,7 @@ CONFIG_FIT_VERBOSE=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_SYS_EXTRA_OPTIONS="SYS_CLK_100_DDR_100"
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTDELAY=10
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_HUSH_PARSER=y
......
......@@ -6,6 +6,7 @@ CONFIG_FIT_VERBOSE=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_SYS_EXTRA_OPTIONS="SYS_CLK_100_DDR_133"
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTDELAY=10
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_HUSH_PARSER=y
......
......@@ -5,6 +5,7 @@ CONFIG_FIT=y
CONFIG_FIT_VERBOSE=y
CONFIG_OF_BOARD_SETUP=y
CONFIG_OF_STDOUT_VIA_ALIAS=y
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTDELAY=-1
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
CONFIG_HUSH_PARSER=y
......
CONFIG_M68K=y
CONFIG_SYS_TEXT_BASE=0x00000000
CONFIG_TARGET_M5208EVBE=y
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTDELAY=1
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="-> "
......
......@@ -2,6 +2,7 @@ CONFIG_M68K=y
CONFIG_SYS_TEXT_BASE=0x00000000
CONFIG_TARGET_M52277EVB=y
CONFIG_SYS_EXTRA_OPTIONS="SYS_SPANSION_BOOT"
CONFIG_ENV_IS_IN_FLASH=y
CONFIG_BOOTDELAY=3
# CONFIG_DISPLAY_BOARDINFO is not set
CONFIG_SYS_PROMPT="-> "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment