xref: /openbmc/u-boot/env/Kconfig (revision 0cd9465c)
1menu "Environment"
2
3config ENV_IS_NOWHERE
4	bool "Environment is not stored"
5	depends on !ENV_IS_IN_EEPROM
6	depends on !ENV_IS_IN_EXT4
7	depends on !ENV_IS_IN_FAT
8	depends on !ENV_IS_IN_FLASH
9	depends on !ENV_IS_IN_MMC
10	depends on !ENV_IS_IN_NAND
11	depends on !ENV_IS_IN_NVRAM
12	depends on !ENV_IS_IN_ONENAND
13	depends on !ENV_IS_IN_REMOTE
14	depends on !ENV_IS_IN_SPI_FLASH
15	depends on !ENV_IS_IN_UBI
16	default y
17	help
18	  Define this if you don't want to or can't have an environment stored
19	  on a storage medium. In this case the environment will still exist
20	  while U-Boot is running, but once U-Boot exits it will not be
21	  stored. U-Boot will therefore always start up with a default
22	  environment.
23
24config ENV_IS_IN_EEPROM
25	bool "Environment in EEPROM"
26	depends on !CHAIN_OF_TRUST
27	help
28	  Use this if you have an EEPROM or similar serial access
29	  device and a driver for it.
30
31	  - CONFIG_ENV_OFFSET:
32	  - CONFIG_ENV_SIZE:
33
34	  These two #defines specify the offset and size of the
35	  environment area within the total memory of your EEPROM.
36
37	  Note that we consider the length of the address field to
38	  still be one byte because the extra address bits are hidden
39	  in the chip address.
40
41	  - CONFIG_ENV_EEPROM_IS_ON_I2C
42	  define this, if you have I2C and SPI activated, and your
43	  EEPROM, which holds the environment, is on the I2C bus.
44
45	  - CONFIG_I2C_ENV_EEPROM_BUS
46	  if you have an Environment on an EEPROM reached over
47	  I2C muxes, you can define here, how to reach this
48	  EEPROM. For example:
49
50	  #define CONFIG_I2C_ENV_EEPROM_BUS	  1
51
52	  EEPROM which holds the environment, is reached over
53	  a pca9547 i2c mux with address 0x70, channel 3.
54
55config ENV_IS_IN_FAT
56	bool "Environment is in a FAT filesystem"
57	depends on !CHAIN_OF_TRUST
58	default y if ARCH_BCM283X
59	default y if ARCH_SUNXI && MMC
60	default y if MMC_OMAP_HS && TI_COMMON_CMD_OPTIONS
61	select FS_FAT
62	select FAT_WRITE
63	help
64	  Define this if you want to use the FAT file system for the environment.
65
66config ENV_IS_IN_EXT4
67	bool "Environment is in a EXT4 filesystem"
68	depends on !CHAIN_OF_TRUST
69	select EXT4_WRITE
70	help
71	  Define this if you want to use the EXT4 file system for the environment.
72
73config ENV_IS_IN_FLASH
74	bool "Environment in flash memory"
75	depends on !CHAIN_OF_TRUST
76	default y if ARCH_CINTEGRATOR
77	default y if ARCH_INTEGRATOR_CP
78	default y if M548x || M547x || M5282 || MCF547x_8x
79	default y if MCF532x || MCF52x2
80	default y if MPC86xx || MPC83xx
81	default y if ARCH_MPC8572 || ARCH_MPC8548 || ARCH_MPC8641
82	default y if SH && !CPU_SH4
83	help
84	  Define this if you have a flash device which you want to use for the
85	  environment.
86
87	  a) The environment occupies one whole flash sector, which is
88	   "embedded" in the text segment with the U-Boot code. This
89	   happens usually with "bottom boot sector" or "top boot
90	   sector" type flash chips, which have several smaller
91	   sectors at the start or the end. For instance, such a
92	   layout can have sector sizes of 8, 2x4, 16, Nx32 kB. In
93	   such a case you would place the environment in one of the
94	   4 kB sectors - with U-Boot code before and after it. With
95	   "top boot sector" type flash chips, you would put the
96	   environment in one of the last sectors, leaving a gap
97	   between U-Boot and the environment.
98
99	  CONFIG_ENV_OFFSET:
100
101	   Offset of environment data (variable area) to the
102	   beginning of flash memory; for instance, with bottom boot
103	   type flash chips the second sector can be used: the offset
104	   for this sector is given here.
105
106	   CONFIG_ENV_OFFSET is used relative to CONFIG_SYS_FLASH_BASE.
107
108	  CONFIG_ENV_ADDR:
109
110	   This is just another way to specify the start address of
111	   the flash sector containing the environment (instead of
112	   CONFIG_ENV_OFFSET).
113
114	  CONFIG_ENV_SECT_SIZE:
115
116	   Size of the sector containing the environment.
117
118
119	  b) Sometimes flash chips have few, equal sized, BIG sectors.
120	   In such a case you don't want to spend a whole sector for
121	   the environment.
122
123	  CONFIG_ENV_SIZE:
124
125	   If you use this in combination with CONFIG_ENV_IS_IN_FLASH
126	   and CONFIG_ENV_SECT_SIZE, you can specify to use only a part
127	   of this flash sector for the environment. This saves
128	   memory for the RAM copy of the environment.
129
130	   It may also save flash memory if you decide to use this
131	   when your environment is "embedded" within U-Boot code,
132	   since then the remainder of the flash sector could be used
133	   for U-Boot code. It should be pointed out that this is
134	   STRONGLY DISCOURAGED from a robustness point of view:
135	   updating the environment in flash makes it always
136	   necessary to erase the WHOLE sector. If something goes
137	   wrong before the contents has been restored from a copy in
138	   RAM, your target system will be dead.
139
140	  CONFIG_ENV_ADDR_REDUND
141	  CONFIG_ENV_SIZE_REDUND
142
143	   These settings describe a second storage area used to hold
144	   a redundant copy of the environment data, so that there is
145	   a valid backup copy in case there is a power failure during
146	   a "saveenv" operation.
147
148	  BE CAREFUL! Any changes to the flash layout, and some changes to the
149	  source code will make it necessary to adapt <board>/u-boot.lds*
150	  accordingly!
151
152config ENV_IS_IN_MMC
153	bool "Environment in an MMC device"
154	depends on !CHAIN_OF_TRUST
155	depends on MMC
156	default y if ARCH_EXYNOS4
157	default y if MX6SX || MX7D
158	default y if TEGRA30 || TEGRA124
159	default y if TEGRA_ARMV8_COMMON
160	help
161	  Define this if you have an MMC device which you want to use for the
162	  environment.
163
164	  CONFIG_SYS_MMC_ENV_DEV:
165
166	  Specifies which MMC device the environment is stored in.
167
168	  CONFIG_SYS_MMC_ENV_PART (optional):
169
170	  Specifies which MMC partition the environment is stored in. If not
171	  set, defaults to partition 0, the user area. Common values might be
172	  1 (first MMC boot partition), 2 (second MMC boot partition).
173
174	  CONFIG_ENV_OFFSET:
175	  CONFIG_ENV_SIZE:
176
177	  These two #defines specify the offset and size of the environment
178	  area within the specified MMC device.
179
180	  If offset is positive (the usual case), it is treated as relative to
181	  the start of the MMC partition. If offset is negative, it is treated
182	  as relative to the end of the MMC partition. This can be useful if
183	  your board may be fitted with different MMC devices, which have
184	  different sizes for the MMC partitions, and you always want the
185	  environment placed at the very end of the partition, to leave the
186	  maximum possible space before it, to store other data.
187
188	  These two values are in units of bytes, but must be aligned to an
189	  MMC sector boundary.
190
191	  CONFIG_ENV_OFFSET_REDUND (optional):
192
193	  Specifies a second storage area, of CONFIG_ENV_SIZE size, used to
194	  hold a redundant copy of the environment data. This provides a
195	  valid backup copy in case the other copy is corrupted, e.g. due
196	  to a power failure during a "saveenv" operation.
197
198	  This value may also be positive or negative; this is handled in the
199	  same way as CONFIG_ENV_OFFSET.
200
201	  This value is also in units of bytes, but must also be aligned to
202	  an MMC sector boundary.
203
204	  CONFIG_ENV_SIZE_REDUND (optional):
205
206	  This value need not be set, even when CONFIG_ENV_OFFSET_REDUND is
207	  set. If this value is set, it must be set to the same value as
208	  CONFIG_ENV_SIZE.
209
210config ENV_IS_IN_NAND
211	bool "Environment in a NAND device"
212	depends on !CHAIN_OF_TRUST
213	help
214	  Define this if you have a NAND device which you want to use for the
215	  environment.
216
217	  - CONFIG_ENV_OFFSET:
218	  - CONFIG_ENV_SIZE:
219
220	  These two #defines specify the offset and size of the environment
221	  area within the first NAND device.  CONFIG_ENV_OFFSET must be
222	  aligned to an erase block boundary.
223
224	  - CONFIG_ENV_OFFSET_REDUND (optional):
225
226	  This setting describes a second storage area of CONFIG_ENV_SIZE
227	  size used to hold a redundant copy of the environment data, so
228	  that there is a valid backup copy in case there is a power failure
229	  during a "saveenv" operation.	 CONFIG_ENV_OFFSET_REDUND must be
230	  aligned to an erase block boundary.
231
232	  - CONFIG_ENV_RANGE (optional):
233
234	  Specifies the length of the region in which the environment
235	  can be written.  This should be a multiple of the NAND device's
236	  block size.  Specifying a range with more erase blocks than
237	  are needed to hold CONFIG_ENV_SIZE allows bad blocks within
238	  the range to be avoided.
239
240	  - CONFIG_ENV_OFFSET_OOB (optional):
241
242	  Enables support for dynamically retrieving the offset of the
243	  environment from block zero's out-of-band data.  The
244	  "nand env.oob" command can be used to record this offset.
245	  Currently, CONFIG_ENV_OFFSET_REDUND is not supported when
246	  using CONFIG_ENV_OFFSET_OOB.
247
248config ENV_IS_IN_NVRAM
249	bool "Environment in a non-volatile RAM"
250	depends on !CHAIN_OF_TRUST
251	help
252	  Define this if you have some non-volatile memory device
253	  (NVRAM, battery buffered SRAM) which you want to use for the
254	  environment.
255
256	  - CONFIG_ENV_ADDR:
257	  - CONFIG_ENV_SIZE:
258
259	  These two #defines are used to determine the memory area you
260	  want to use for environment. It is assumed that this memory
261	  can just be read and written to, without any special
262	  provision.
263
264config ENV_IS_IN_ONENAND
265	bool "Environment is in OneNAND"
266	depends on !CHAIN_OF_TRUST
267	help
268	  Define this if you want to put your local device's environment in
269	  OneNAND.
270
271	  - CONFIG_ENV_ADDR:
272	  - CONFIG_ENV_SIZE:
273
274	  These two #defines are used to determine the device range you
275	  want to use for environment. It is assumed that this memory
276	  can just be read and written to, without any special
277	  provision.
278
279config ENV_IS_IN_REMOTE
280	bool "Environment is in remote memory space"
281	depends on !CHAIN_OF_TRUST
282	help
283	  Define this if you have a remote memory space which you
284	  want to use for the local device's environment.
285
286	  - CONFIG_ENV_ADDR:
287	  - CONFIG_ENV_SIZE:
288
289	  These two #defines specify the address and size of the
290	  environment area within the remote memory space. The
291	  local device can get the environment from remote memory
292	  space by SRIO or PCIE links.
293
294config ENV_IS_IN_SPI_FLASH
295	bool "Environment is in SPI flash"
296	depends on !CHAIN_OF_TRUST
297	default y if ARMADA_XP
298	default y if INTEL_BAYTRAIL
299	default y if INTEL_BRASWELL
300	default y if INTEL_BROADWELL
301	default y if NORTHBRIDGE_INTEL_IVYBRIDGE
302	default y if INTEL_QUARK
303	default y if INTEL_QUEENSBAY
304	help
305	  Define this if you have a SPI Flash memory device which you
306	  want to use for the environment.
307
308	  - CONFIG_ENV_OFFSET:
309	  - CONFIG_ENV_SIZE:
310
311	  These two #defines specify the offset and size of the
312	  environment area within the SPI Flash. CONFIG_ENV_OFFSET must be
313	  aligned to an erase sector boundary.
314
315	  - CONFIG_ENV_SECT_SIZE:
316
317	  Define the SPI flash's sector size.
318
319	  - CONFIG_ENV_OFFSET_REDUND (optional):
320
321	  This setting describes a second storage area of CONFIG_ENV_SIZE
322	  size used to hold a redundant copy of the environment data, so
323	  that there is a valid backup copy in case there is a power failure
324	  during a "saveenv" operation. CONFIG_ENV_OFFSET_REDUND must be
325	  aligned to an erase sector boundary.
326
327	  - CONFIG_ENV_SPI_BUS (optional):
328	  - CONFIG_ENV_SPI_CS (optional):
329
330	  Define the SPI bus and chip select. If not defined they will be 0.
331
332	  - CONFIG_ENV_SPI_MAX_HZ (optional):
333
334	  Define the SPI max work clock. If not defined then use 1MHz.
335
336	  - CONFIG_ENV_SPI_MODE (optional):
337
338	  Define the SPI work mode. If not defined then use SPI_MODE_3.
339
340config ENV_IS_IN_UBI
341	bool "Environment in a UBI volume"
342	depends on !CHAIN_OF_TRUST
343	help
344	  Define this if you have an UBI volume that you want to use for the
345	  environment.  This has the benefit of wear-leveling the environment
346	  accesses, which is important on NAND.
347
348	  - CONFIG_ENV_UBI_PART:
349
350	  Define this to a string that is the mtd partition containing the UBI.
351
352	  - CONFIG_ENV_UBI_VOLUME:
353
354	  Define this to the name of the volume that you want to store the
355	  environment in.
356
357	  - CONFIG_ENV_UBI_VOLUME_REDUND:
358
359	  Define this to the name of another volume to store a second copy of
360	  the environment in.  This will enable redundant environments in UBI.
361	  It is assumed that both volumes are in the same MTD partition.
362
363config ENV_FAT_INTERFACE
364	string "Name of the block device for the environment"
365	depends on ENV_IS_IN_FAT
366	default "mmc" if ARCH_SUNXI
367	default "mmc" if TI_COMMON_CMD_OPTIONS || ARCH_ZYNQMP || ARCH_AT91
368	help
369	  Define this to a string that is the name of the block device.
370
371config ENV_FAT_DEVICE_AND_PART
372	string "Device and partition for where to store the environemt in FAT"
373	depends on ENV_IS_IN_FAT
374	default "0:1" if TI_COMMON_CMD_OPTIONS
375	default "0:auto" if ARCH_ZYNQMP
376	default "0:auto" if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA = -1
377	default "1:auto" if ARCH_SUNXI && MMC_SUNXI_SLOT_EXTRA != -1
378	default "0" if ARCH_AT91
379	help
380	  Define this to a string to specify the partition of the device. It can
381	  be as following:
382
383	    "D:P", "D:0", "D", "D:" or "D:auto" (D, P are integers. And P >= 1)
384	       - "D:P": device D partition P. Error occurs if device D has no
385	                partition table.
386	       - "D:0": device D.
387	       - "D" or "D:": device D partition 1 if device D has partition
388	                      table, or the whole device D if has no partition
389	                      table.
390	       - "D:auto": first partition in device D with bootable flag set.
391	                   If none, first valid partition in device D. If no
392	                   partition table then means device D.
393
394config ENV_FAT_FILE
395	string "Name of the FAT file to use for the environment"
396	depends on ENV_IS_IN_FAT
397	default "uboot.env"
398	help
399	  It's a string of the FAT file name. This file use to store the
400	  environment.
401
402config ENV_EXT4_INTERFACE
403	string "Name of the block device for the environment"
404	depends on ENV_IS_IN_EXT4
405	help
406	  Define this to a string that is the name of the block device.
407
408config ENV_EXT4_DEVICE_AND_PART
409	string "Device and partition for where to store the environemt in EXT4"
410	depends on ENV_IS_IN_EXT4
411	help
412	  Define this to a string to specify the partition of the device. It can
413	  be as following:
414
415	    "D:P", "D:0", "D", "D:" or "D:auto" (D, P are integers. And P >= 1)
416	       - "D:P": device D partition P. Error occurs if device D has no
417	                partition table.
418	       - "D:0": device D.
419	       - "D" or "D:": device D partition 1 if device D has partition
420	                      table, or the whole device D if has no partition
421	                      table.
422	       - "D:auto": first partition in device D with bootable flag set.
423	                   If none, first valid partition in device D. If no
424	                   partition table then means device D.
425
426config ENV_EXT4_FILE
427	string "Name of the EXT4 file to use for the environment"
428	depends on ENV_IS_IN_EXT4
429	default "uboot.env"
430	help
431	  It's a string of the EXT4 file name. This file use to store the
432	  environment (explicit path to the file)
433
434if ARCH_ROCKCHIP || ARCH_SUNXI || ARCH_ZYNQ || ARCH_ZYNQMP || ARCH_VERSAL || ARC
435
436config ENV_OFFSET
437	hex "Environment Offset"
438	depends on !ENV_IS_IN_UBI
439	depends on !ENV_IS_NOWHERE
440	default 0x3f8000 if ARCH_ROCKCHIP
441	default 0x88000 if ARCH_SUNXI
442	default 0xE0000 if ARCH_ZYNQ
443	default 0x1E00000 if ARCH_ZYNQMP
444	default 0 if ARC
445	help
446	  Offset from the start of the device (or partition)
447
448config ENV_SIZE
449	hex "Environment Size"
450	default 0x40000 if ENV_IS_IN_SPI_FLASH && ARCH_ZYNQMP
451	default 0x20000 if ARCH_SUNXI || ARCH_ZYNQ
452	default 0x8000 if ARCH_ROCKCHIP || ARCH_ZYNQMP || ARCH_VERSAL
453	default 0x4000 if ARC
454	help
455	  Size of the environment storage area
456
457config ENV_SECT_SIZE
458	hex "Environment Sector-Size"
459	depends on !ENV_IS_NOWHERE && (ARCH_ZYNQ || ARCH_ZYNQMP)
460	default 0x40000 if ARCH_ZYNQMP
461	default 0x20000 if ARCH_ZYNQ
462	help
463	  Size of the sector containing the environment.
464
465config ENV_UBI_PART
466	string "UBI partition name"
467	depends on ENV_IS_IN_UBI
468	help
469	  MTD partition containing the UBI device
470
471config ENV_UBI_VOLUME
472	string "UBI volume name"
473	depends on ENV_IS_IN_UBI
474	help
475	  Name of the volume that you want to store the environment in.
476
477endif
478
479config USE_DEFAULT_ENV_FILE
480	bool "Create default environment from file"
481	help
482	  Normally, the default environment is automatically generated
483	  based on the settings of various CONFIG_* options, as well
484	  as the CONFIG_EXTRA_ENV_SETTINGS. By selecting this option,
485	  you can instead define the entire default environment in an
486	  external file.
487
488config DEFAULT_ENV_FILE
489	string "Path to default environment file"
490	depends on USE_DEFAULT_ENV_FILE
491	help
492	  The path containing the default environment. The format is
493	  the same as accepted by the mkenvimage tool: lines
494	  containing key=value pairs, blank lines and lines beginning
495	  with # are ignored.
496
497config ENV_VARS_UBOOT_RUNTIME_CONFIG
498	bool "Add run-time information to the environment"
499	help
500	  Enable this in order to add variables describing certain
501	  run-time determined information about the hardware to the
502	  environment.  These will be named board_name, board_rev.
503
504if SPL_ENV_SUPPORT
505config SPL_ENV_IS_NOWHERE
506	bool "SPL Environment is not stored"
507	default y if ENV_IS_NOWHERE
508	help
509	  Similar to ENV_IS_NOWHERE, used for SPL environment.
510
511config SPL_ENV_IS_IN_MMC
512	bool "SPL Environment in an MMC device"
513	depends on !SPL_ENV_IS_NOWHERE
514	depends on ENV_IS_IN_MMC
515	default y
516	help
517	  Similar to ENV_IS_IN_MMC, used for SPL environment.
518
519config SPL_ENV_IS_IN_FAT
520	bool "SPL Environment is in a FAT filesystem"
521	depends on !SPL_ENV_IS_NOWHERE
522	depends on ENV_IS_IN_FAT
523	default y
524	help
525	  Similar to ENV_IS_IN_FAT, used for SPL environment.
526
527config SPL_ENV_IS_IN_EXT4
528	bool "SPL Environment is in a EXT4 filesystem"
529	depends on !SPL_ENV_IS_NOWHERE
530	depends on ENV_IS_IN_EXT4
531	default y
532	help
533	  Similar to ENV_IS_IN_EXT4, used for SPL environment.
534
535config SPL_ENV_IS_IN_NAND
536	bool "SPL Environment in a NAND device"
537	depends on !SPL_ENV_IS_NOWHERE
538	depends on ENV_IS_IN_NAND
539	default y
540	help
541	  Similar to ENV_IS_IN_NAND, used for SPL environment.
542
543config SPL_ENV_IS_IN_SPI_FLASH
544	bool "SPL Environment is in SPI flash"
545	depends on !SPL_ENV_IS_NOWHERE
546	depends on ENV_IS_IN_SPI_FLASH
547	default y
548	help
549	  Similar to ENV_IS_IN_SPI_FLASH, used for SPL environment.
550
551config SPL_ENV_IS_IN_FLASH
552	bool "SPL Environment in flash memory"
553	depends on !SPL_ENV_IS_NOWHERE
554	depends on ENV_IS_IN_FLASH
555	default y
556	help
557	  Similar to ENV_IS_IN_FLASH, used for SPL environment.
558
559endif
560
561if TPL_ENV_SUPPORT
562
563config TPL_ENV_IS_NOWHERE
564	bool "TPL Environment is not stored"
565	default y if ENV_IS_NOWHERE
566	help
567	  Similar to ENV_IS_NOWHERE, used for TPL environment.
568
569config TPL_ENV_IS_IN_MMC
570	bool "TPL Environment in an MMC device"
571	depends on !TPL_ENV_IS_NOWHERE
572	depends on ENV_IS_IN_MMC
573	default y
574	help
575	  Similar to ENV_IS_IN_MMC, used for TPL environment.
576
577config TPL_ENV_IS_IN_FAT
578	bool "TPL Environment is in a FAT filesystem"
579	depends on !TPL_ENV_IS_NOWHERE
580	depends on ENV_IS_IN_FAT
581	default y
582	help
583	  Similar to ENV_IS_IN_FAT, used for TPL environment.
584
585config TPL_ENV_IS_IN_EXT4
586	bool "TPL Environment is in a EXT4 filesystem"
587	depends on !TPL_ENV_IS_NOWHERE
588	depends on ENV_IS_IN_EXT4
589	default y
590	help
591	  Similar to ENV_IS_IN_EXT4, used for TPL environment.
592
593config TPL_ENV_IS_IN_NAND
594	bool "TPL Environment in a NAND device"
595	depends on !TPL_ENV_IS_NOWHERE
596	depends on ENV_IS_IN_NAND
597	default y
598	help
599	  Similar to ENV_IS_IN_NAND, used for TPL environment.
600
601config TPL_ENV_IS_IN_SPI_FLASH
602	bool "TPL Environment is in SPI flash"
603	depends on !TPL_ENV_IS_NOWHERE
604	depends on ENV_IS_IN_SPI_FLASH
605	default y
606	help
607	  Similar to ENV_IS_IN_SPI_FLASH, used for TPL environment.
608
609config TPL_ENV_IS_IN_FLASH
610	bool "TPL Environment in flash memory"
611	depends on !TPL_ENV_IS_NOWHERE
612	depends on ENV_IS_IN_FLASH
613	default y
614	help
615	  Similar to ENV_IS_IN_FLASH, used for TPL environment.
616
617endif
618
619endmenu
620