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