xref: /openbmc/u-boot/env/Kconfig (revision c68c03f5)
1menu "Environment"
2
3choice
4	prompt "Select the location of the environment"
5	default ENV_IS_IN_MMC if ARCH_SUNXI
6	default ENV_IS_IN_MMC if ARCH_EXYNOS4
7	default ENV_IS_IN_MMC if MX6SX || MX7D
8	default ENV_IS_IN_MMC if TEGRA30 || TEGRA124
9	default ENV_IS_IN_MMC if TEGRA_ARMV8_COMMON
10	default ENV_IS_IN_FLASH if ARCH_CINTEGRATOR
11	default ENV_IS_IN_FLASH if ARCH_INTEGRATOR_CP
12	default ENV_IS_IN_FLASH if M548x || M547x || M5282 || MCF547x_8x
13	default ENV_IS_IN_FLASH if MCF532x || MCF52x2
14	default ENV_IS_IN_FLASH if MPC86xx || MPC83xx
15	default ENV_IS_IN_FLASH if ARCH_MPC8572 || ARCH_MPC8548 || ARCH_MPC8641
16	default ENV_IS_IN_FLASH if SH && !CPU_SH4
17	default ENV_IS_IN_SPI_FLASH if ARMADA_XP
18	default ENV_IS_IN_SPI_FLASH if INTEL_BAYTRAIL
19	default ENV_IS_IN_SPI_FLASH if INTEL_BROADWELL
20	default ENV_IS_IN_SPI_FLASH if NORTHBRIDGE_INTEL_IVYBRIDGE
21	default ENV_IS_IN_SPI_FLASH if INTEL_QUARK
22	default ENV_IS_IN_SPI_FLASH if INTEL_QUEENSBAY
23	default ENV_IS_IN_FAT if ARCH_BCM283X
24	default ENV_IS_IN_FAT if MMC_OMAP_HS && TI_COMMON_CMD_OPTIONS
25	default ENV_IS_NOWHERE
26	help
27	  At present the environment can be stored in only one place. Use this
28	  option to select the location. This is either a device (where the
29	  environemnt information is simply written to a fixed location or
30	  partition on the device) or a filesystem (where the environment
31	  information is written to a file).
32
33config ENV_IS_NOWHERE
34	bool "Environment is not stored"
35	help
36	  Define this if you don't want to or can't have an environment stored
37	  on a storage medium. In this case the environemnt will still exist
38	  while U-Boot is running, but once U-Boot exits it will not be
39	  stored. U-Boot will therefore always start up with a default
40	  environment.
41
42config ENV_IS_IN_EEPROM
43	bool "Environment in EEPROM"
44	depends on !CHAIN_OF_TRUST
45	help
46	  Use this if you have an EEPROM or similar serial access
47	  device and a driver for it.
48
49	  - CONFIG_ENV_OFFSET:
50	  - CONFIG_ENV_SIZE:
51
52	  These two #defines specify the offset and size of the
53	  environment area within the total memory of your EEPROM.
54
55	  Note that we consider the length of the address field to
56	  still be one byte because the extra address bits are hidden
57	  in the chip address.
58
59	  - CONFIG_ENV_EEPROM_IS_ON_I2C
60	  define this, if you have I2C and SPI activated, and your
61	  EEPROM, which holds the environment, is on the I2C bus.
62
63	  - CONFIG_I2C_ENV_EEPROM_BUS
64	  if you have an Environment on an EEPROM reached over
65	  I2C muxes, you can define here, how to reach this
66	  EEPROM. For example:
67
68	  #define CONFIG_I2C_ENV_EEPROM_BUS	  1
69
70	  EEPROM which holds the environment, is reached over
71	  a pca9547 i2c mux with address 0x70, channel 3.
72
73config ENV_IS_IN_FAT
74	bool "Environment is in a FAT filesystem"
75	depends on !CHAIN_OF_TRUST
76	select FAT_WRITE
77	help
78	  Define this if you want to use the FAT file system for the environment.
79
80	  - CONFIG_FAT_WRITE:
81	  This must be enabled. Otherwise it cannot save the environment file.
82
83config ENV_IS_IN_FLASH
84	bool "Environment in flash memory"
85	depends on !CHAIN_OF_TRUST
86	help
87	  Define this if you have a flash device which you want to use for the
88	  environment.
89
90	  a) The environment occupies one whole flash sector, which is
91	   "embedded" in the text segment with the U-Boot code. This
92	   happens usually with "bottom boot sector" or "top boot
93	   sector" type flash chips, which have several smaller
94	   sectors at the start or the end. For instance, such a
95	   layout can have sector sizes of 8, 2x4, 16, Nx32 kB. In
96	   such a case you would place the environment in one of the
97	   4 kB sectors - with U-Boot code before and after it. With
98	   "top boot sector" type flash chips, you would put the
99	   environment in one of the last sectors, leaving a gap
100	   between U-Boot and the environment.
101
102	  CONFIG_ENV_OFFSET:
103
104	   Offset of environment data (variable area) to the
105	   beginning of flash memory; for instance, with bottom boot
106	   type flash chips the second sector can be used: the offset
107	   for this sector is given here.
108
109	   CONFIG_ENV_OFFSET is used relative to CONFIG_SYS_FLASH_BASE.
110
111	  CONFIG_ENV_ADDR:
112
113	   This is just another way to specify the start address of
114	   the flash sector containing the environment (instead of
115	   CONFIG_ENV_OFFSET).
116
117	  CONFIG_ENV_SECT_SIZE:
118
119	   Size of the sector containing the environment.
120
121
122	  b) Sometimes flash chips have few, equal sized, BIG sectors.
123	   In such a case you don't want to spend a whole sector for
124	   the environment.
125
126	  CONFIG_ENV_SIZE:
127
128	   If you use this in combination with CONFIG_ENV_IS_IN_FLASH
129	   and CONFIG_ENV_SECT_SIZE, you can specify to use only a part
130	   of this flash sector for the environment. This saves
131	   memory for the RAM copy of the environment.
132
133	   It may also save flash memory if you decide to use this
134	   when your environment is "embedded" within U-Boot code,
135	   since then the remainder of the flash sector could be used
136	   for U-Boot code. It should be pointed out that this is
137	   STRONGLY DISCOURAGED from a robustness point of view:
138	   updating the environment in flash makes it always
139	   necessary to erase the WHOLE sector. If something goes
140	   wrong before the contents has been restored from a copy in
141	   RAM, your target system will be dead.
142
143	  CONFIG_ENV_ADDR_REDUND
144	  CONFIG_ENV_SIZE_REDUND
145
146	   These settings describe a second storage area used to hold
147	   a redundant copy of the environment data, so that there is
148	   a valid backup copy in case there is a power failure during
149	   a "saveenv" operation.
150
151	  BE CAREFUL! Any changes to the flash layout, and some changes to the
152	  source code will make it necessary to adapt <board>/u-boot.lds*
153	  accordingly!
154
155config ENV_IS_IN_MMC
156	bool "Environment in an MMC device"
157	depends on !CHAIN_OF_TRUST
158	help
159	  Define this if you have an MMC device which you want to use for the
160	  environment.
161
162	  CONFIG_SYS_MMC_ENV_DEV:
163
164	  Specifies which MMC device the environment is stored in.
165
166	  CONFIG_SYS_MMC_ENV_PART (optional):
167
168	  Specifies which MMC partition the environment is stored in. If not
169	  set, defaults to partition 0, the user area. Common values might be
170	  1 (first MMC boot partition), 2 (second MMC boot partition).
171
172	  CONFIG_ENV_OFFSET:
173	  CONFIG_ENV_SIZE:
174
175	  These two #defines specify the offset and size of the environment
176	  area within the specified MMC device.
177
178	  If offset is positive (the usual case), it is treated as relative to
179	  the start of the MMC partition. If offset is negative, it is treated
180	  as relative to the end of the MMC partition. This can be useful if
181	  your board may be fitted with different MMC devices, which have
182	  different sizes for the MMC partitions, and you always want the
183	  environment placed at the very end of the partition, to leave the
184	  maximum possible space before it, to store other data.
185
186	  These two values are in units of bytes, but must be aligned to an
187	  MMC sector boundary.
188
189	  CONFIG_ENV_OFFSET_REDUND (optional):
190
191	  Specifies a second storage area, of CONFIG_ENV_SIZE size, used to
192	  hold a redundant copy of the environment data. This provides a
193	  valid backup copy in case the other copy is corrupted, e.g. due
194	  to a power failure during a "saveenv" operation.
195
196	  This value may also be positive or negative; this is handled in the
197	  same way as CONFIG_ENV_OFFSET.
198
199	  This value is also in units of bytes, but must also be aligned to
200	  an MMC sector boundary.
201
202	  CONFIG_ENV_SIZE_REDUND (optional):
203
204	  This value need not be set, even when CONFIG_ENV_OFFSET_REDUND is
205	  set. If this value is set, it must be set to the same value as
206	  CONFIG_ENV_SIZE.
207
208config ENV_IS_IN_NAND
209	bool "Environment in a NAND device"
210	depends on !CHAIN_OF_TRUST
211	help
212	  Define this if you have a NAND device which you want to use for the
213	  environment.
214
215	  - CONFIG_ENV_OFFSET:
216	  - CONFIG_ENV_SIZE:
217
218	  These two #defines specify the offset and size of the environment
219	  area within the first NAND device.  CONFIG_ENV_OFFSET must be
220	  aligned to an erase block boundary.
221
222	  - CONFIG_ENV_OFFSET_REDUND (optional):
223
224	  This setting describes a second storage area of CONFIG_ENV_SIZE
225	  size used to hold a redundant copy of the environment data, so
226	  that there is a valid backup copy in case there is a power failure
227	  during a "saveenv" operation.	 CONFIG_ENV_OFFSET_REDUND must be
228	  aligned to an erase block boundary.
229
230	  - CONFIG_ENV_RANGE (optional):
231
232	  Specifies the length of the region in which the environment
233	  can be written.  This should be a multiple of the NAND device's
234	  block size.  Specifying a range with more erase blocks than
235	  are needed to hold CONFIG_ENV_SIZE allows bad blocks within
236	  the range to be avoided.
237
238	  - CONFIG_ENV_OFFSET_OOB (optional):
239
240	  Enables support for dynamically retrieving the offset of the
241	  environment from block zero's out-of-band data.  The
242	  "nand env.oob" command can be used to record this offset.
243	  Currently, CONFIG_ENV_OFFSET_REDUND is not supported when
244	  using CONFIG_ENV_OFFSET_OOB.
245
246config ENV_IS_IN_NVRAM
247	bool "Environment in a non-volatile RAM"
248	depends on !CHAIN_OF_TRUST
249	help
250	  Define this if you have some non-volatile memory device
251	  (NVRAM, battery buffered SRAM) which you want to use for the
252	  environment.
253
254	  - CONFIG_ENV_ADDR:
255	  - CONFIG_ENV_SIZE:
256
257	  These two #defines are used to determine the memory area you
258	  want to use for environment. It is assumed that this memory
259	  can just be read and written to, without any special
260	  provision.
261
262config ENV_IS_IN_ONENAND
263	bool "Environment is in OneNAND"
264	depends on !CHAIN_OF_TRUST
265	help
266	  Define this if you want to put your local device's environment in
267	  OneNAND.
268
269	  - CONFIG_ENV_ADDR:
270	  - CONFIG_ENV_SIZE:
271
272	  These two #defines are used to determine the device range you
273	  want to use for environment. It is assumed that this memory
274	  can just be read and written to, without any special
275	  provision.
276
277config ENV_IS_IN_REMOTE
278	bool "Environment is in remove memory space"
279	depends on !CHAIN_OF_TRUST
280	help
281	  Define this if you have a remote memory space which you
282	  want to use for the local device's environment.
283
284	  - CONFIG_ENV_ADDR:
285	  - CONFIG_ENV_SIZE:
286
287	  These two #defines specify the address and size of the
288	  environment area within the remote memory space. The
289	  local device can get the environment from remote memory
290	  space by SRIO or PCIE links.
291
292config ENV_IS_IN_SPI_FLASH
293	bool "Environment is in SPI flash"
294	depends on !CHAIN_OF_TRUST
295	help
296	  Define this if you have a SPI Flash memory device which you
297	  want to use for the environment.
298
299	  - CONFIG_ENV_OFFSET:
300	  - CONFIG_ENV_SIZE:
301
302	  These two #defines specify the offset and size of the
303	  environment area within the SPI Flash. CONFIG_ENV_OFFSET must be
304	  aligned to an erase sector boundary.
305
306	  - CONFIG_ENV_SECT_SIZE:
307
308	  Define the SPI flash's sector size.
309
310	  - CONFIG_ENV_OFFSET_REDUND (optional):
311
312	  This setting describes a second storage area of CONFIG_ENV_SIZE
313	  size used to hold a redundant copy of the environment data, so
314	  that there is a valid backup copy in case there is a power failure
315	  during a "saveenv" operation. CONFIG_ENV_OFFSET_REDUND must be
316	  aligned to an erase sector boundary.
317
318	  - CONFIG_ENV_SPI_BUS (optional):
319	  - CONFIG_ENV_SPI_CS (optional):
320
321	  Define the SPI bus and chip select. If not defined they will be 0.
322
323	  - CONFIG_ENV_SPI_MAX_HZ (optional):
324
325	  Define the SPI max work clock. If not defined then use 1MHz.
326
327	  - CONFIG_ENV_SPI_MODE (optional):
328
329	  Define the SPI work mode. If not defined then use SPI_MODE_3.
330
331config ENV_IS_IN_UBI
332	bool "Environment in a UBI volume"
333	depends on !CHAIN_OF_TRUST
334	help
335	  Define this if you have an UBI volume that you want to use for the
336	  environment.  This has the benefit of wear-leveling the environment
337	  accesses, which is important on NAND.
338
339	  - CONFIG_ENV_UBI_PART:
340
341	  Define this to a string that is the mtd partition containing the UBI.
342
343	  - CONFIG_ENV_UBI_VOLUME:
344
345	  Define this to the name of the volume that you want to store the
346	  environment in.
347
348	  - CONFIG_ENV_UBI_VOLUME_REDUND:
349
350	  Define this to the name of another volume to store a second copy of
351	  the environment in.  This will enable redundant environments in UBI.
352	  It is assumed that both volumes are in the same MTD partition.
353
354	  - CONFIG_UBI_SILENCE_MSG
355	  - CONFIG_UBIFS_SILENCE_MSG
356
357	  You will probably want to define these to avoid a really noisy system
358	  when storing the env in UBI.
359
360endchoice
361
362config ENV_AES
363	bool "AES-128 encryption for stored environment (DEPRECATED)"
364	help
365	  Enable this to have the on-device stored environment be encrypted
366	  with AES-128.  The implementation here however has security
367	  complications and is not recommended for use.  Please see
368	  CVE-2017-3225 and CVE-2017-3226 for more details.
369
370config ENV_FAT_INTERFACE
371	string "Name of the block device for the environment"
372	depends on ENV_IS_IN_FAT
373	default "mmc" if TI_COMMON_CMD_OPTIONS || ARCH_ZYNQMP || ARCH_AT91
374	help
375	  Define this to a string that is the name of the block device.
376
377config ENV_FAT_DEVICE_AND_PART
378	string "Device and partition for where to store the environemt in FAT"
379	depends on ENV_IS_IN_FAT
380	default "0:1" if TI_COMMON_CMD_OPTIONS
381	default "0:auto" if ARCH_ZYNQMP
382	default "0" if ARCH_AT91
383	help
384	  Define this to a string to specify the partition of the device. It can
385	  be as following:
386
387	    "D:P", "D:0", "D", "D:" or "D:auto" (D, P are integers. And P >= 1)
388	       - "D:P": device D partition P. Error occurs if device D has no
389	                partition table.
390	       - "D:0": device D.
391	       - "D" or "D:": device D partition 1 if device D has partition
392	                      table, or the whole device D if has no partition
393	                      table.
394	       - "D:auto": first partition in device D with bootable flag set.
395	                   If none, first valid partition in device D. If no
396	                   partition table then means device D.
397
398config ENV_FAT_FILE
399	string "Name of the FAT file to use for the environemnt"
400	depends on ENV_IS_IN_FAT
401	default "uboot.env"
402	help
403	  It's a string of the FAT file name. This file use to store the
404	  environment.
405
406if ARCH_SUNXI
407
408config ENV_OFFSET
409	hex "Environment Offset"
410	depends on !ENV_IS_IN_UBI
411	depends on !ENV_IS_NOWHERE
412	default 0x88000 if ARCH_SUNXI
413	help
414	  Offset from the start of the device (or partition)
415
416config ENV_SIZE
417	hex "Environment Size"
418	depends on !ENV_IS_NOWHERE
419	default 0x20000 if ARCH_SUNXI
420	help
421	  Size of the environment storage area
422
423config ENV_UBI_PART
424	string "UBI partition name"
425	depends on ENV_IS_IN_UBI
426	help
427	  MTD partition containing the UBI device
428
429config ENV_UBI_VOLUME
430	string "UBI volume name"
431	depends on ENV_IS_IN_UBI
432	help
433	  Name of the volume that you want to store the environment in.
434
435endif
436
437endmenu
438