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