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