xref: /openbmc/u-boot/common/Kconfig (revision 73e4ba98)
1menu "Boot timing"
2
3config BOOTSTAGE
4	bool "Boot timing and reporting"
5	help
6	  Enable recording of boot time while booting. To use it, insert
7	  calls to bootstage_mark() with a suitable BOOTSTAGE_ID from
8	  bootstage.h. Only a single entry is recorded for each ID. You can
9	  give the entry a name with bootstage_mark_name(). You can also
10	  record elapsed time in a particular stage using bootstage_start()
11	  before starting and bootstage_accum() when finished. Bootstage will
12	  add up all the accumulated time and report it.
13
14	  Normally, IDs are defined in bootstage.h but a small number of
15	  additional 'user' IDs can be used by passing BOOTSTAGE_ID_ALLOC
16	  as the ID.
17
18	  Calls to show_boot_progress() will also result in log entries but
19	  these will not have names.
20
21config SPL_BOOTSTAGE
22	bool "Boot timing and reported in SPL"
23	depends on BOOTSTAGE
24	help
25	  Enable recording of boot time in SPL. To make this visible to U-Boot
26	  proper, enable BOOTSTAGE_STASH as well. This will stash the timing
27	  information when SPL finishes and load it when U-Boot proper starts
28	  up.
29
30config BOOTSTAGE_REPORT
31	bool "Display a detailed boot timing report before booting the OS"
32	depends on BOOTSTAGE
33	help
34	  Enable output of a boot time report just before the OS is booted.
35	  This shows how long it took U-Boot to go through each stage of the
36	  boot process. The report looks something like this:
37
38		Timer summary in microseconds:
39		       Mark    Elapsed  Stage
40			  0          0  reset
41		  3,575,678  3,575,678  board_init_f start
42		  3,575,695         17  arch_cpu_init A9
43		  3,575,777         82  arch_cpu_init done
44		  3,659,598     83,821  board_init_r start
45		  3,910,375    250,777  main_loop
46		 29,916,167 26,005,792  bootm_start
47		 30,361,327    445,160  start_kernel
48
49config BOOTSTAGE_RECORD_COUNT
50	int "Number of boot stage records to store"
51	default 30
52	help
53	  This is the size of the bootstage record list and is the maximum
54	  number of bootstage records that can be recorded.
55
56config SPL_BOOTSTAGE_RECORD_COUNT
57	int "Number of boot stage records to store for SPL"
58	default 5
59	help
60	  This is the size of the bootstage record list and is the maximum
61	  number of bootstage records that can be recorded.
62
63config BOOTSTAGE_FDT
64	bool "Store boot timing information in the OS device tree"
65	depends on BOOTSTAGE
66	help
67	  Stash the bootstage information in the FDT. A root 'bootstage'
68	  node is created with each bootstage id as a child. Each child
69	  has a 'name' property and either 'mark' containing the
70	  mark time in microseconds, or 'accum' containing the
71	  accumulated time for that bootstage id in microseconds.
72	  For example:
73
74		bootstage {
75			154 {
76				name = "board_init_f";
77				mark = <3575678>;
78			};
79			170 {
80				name = "lcd";
81				accum = <33482>;
82			};
83		};
84
85	  Code in the Linux kernel can find this in /proc/devicetree.
86
87config BOOTSTAGE_STASH
88	bool "Stash the boot timing information in memory before booting OS"
89	depends on BOOTSTAGE
90	help
91	  Some OSes do not support device tree. Bootstage can instead write
92	  the boot timing information in a binary format at a given address.
93	  This happens through a call to bootstage_stash(), typically in
94	  the CPU's cleanup_before_linux() function. You can use the
95	  'bootstage stash' and 'bootstage unstash' commands to do this on
96	  the command line.
97
98config BOOTSTAGE_STASH_ADDR
99	hex "Address to stash boot timing information"
100	default 0
101	help
102	  Provide an address which will not be overwritten by the OS when it
103	  starts, so that it can read this information when ready.
104
105config BOOTSTAGE_STASH_SIZE
106	hex "Size of boot timing stash region"
107	default 0x1000
108	help
109	  This should be large enough to hold the bootstage stash. A value of
110	  4096 (4KiB) is normally plenty.
111
112endmenu
113
114menu "Boot media"
115
116config NOR_BOOT
117	bool "Support for booting from NOR flash"
118	depends on NOR
119	help
120	  Enabling this will make a U-Boot binary that is capable of being
121	  booted via NOR.  In this case we will enable certain pinmux early
122	  as the ROM only partially sets up pinmux.  We also default to using
123	  NOR for environment.
124
125config NAND_BOOT
126	bool "Support for booting from NAND flash"
127	default n
128	imply NAND
129	help
130	  Enabling this will make a U-Boot binary that is capable of being
131	  booted via NAND flash. This is not a must, some SoCs need this,
132	  some not.
133
134config ONENAND_BOOT
135	bool "Support for booting from ONENAND"
136	default n
137	imply NAND
138	help
139	  Enabling this will make a U-Boot binary that is capable of being
140	  booted via ONENAND. This is not a must, some SoCs need this,
141	  some not.
142
143config QSPI_BOOT
144	bool "Support for booting from QSPI flash"
145	default n
146	help
147	  Enabling this will make a U-Boot binary that is capable of being
148	  booted via QSPI flash. This is not a must, some SoCs need this,
149	  some not.
150
151config SATA_BOOT
152	bool "Support for booting from SATA"
153	default n
154	help
155	  Enabling this will make a U-Boot binary that is capable of being
156	  booted via SATA. This is not a must, some SoCs need this,
157	  some not.
158
159config SD_BOOT
160	bool "Support for booting from SD/EMMC"
161	default n
162	help
163	  Enabling this will make a U-Boot binary that is capable of being
164	  booted via SD/EMMC. This is not a must, some SoCs need this,
165	  some not.
166
167config SPI_BOOT
168	bool "Support for booting from SPI flash"
169	default n
170	help
171	  Enabling this will make a U-Boot binary that is capable of being
172	  booted via SPI flash. This is not a must, some SoCs need this,
173	  some not.
174
175endmenu
176
177config BOOTDELAY
178	int "delay in seconds before automatically booting"
179	default 2
180	depends on AUTOBOOT
181	help
182	  Delay before automatically running bootcmd;
183	  set to 0 to autoboot with no delay, but you can stop it by key input.
184	  set to -1 to disable autoboot.
185	  set to -2 to autoboot with no delay and not check for abort
186
187	  If this value is >= 0 then it is also used for the default delay
188	  before starting the default entry in bootmenu. If it is < 0 then
189	  a default value of 10s is used.
190
191	  See doc/README.autoboot for details.
192
193config USE_BOOTARGS
194	bool "Enable boot arguments"
195	help
196	  Provide boot arguments to bootm command. Boot arguments are specified
197	  in CONFIG_BOOTARGS option. Enable this option to be able to specify
198	  CONFIG_BOOTARGS string. If this option is disabled, CONFIG_BOOTARGS
199	  will be undefined and won't take any space in U-Boot image.
200
201config BOOTARGS
202	string "Boot arguments"
203	depends on USE_BOOTARGS
204	help
205	  This can be used to pass arguments to the bootm command. The value of
206	  CONFIG_BOOTARGS goes into the environment value "bootargs". Note that
207	  this value will also override the "chosen" node in FDT blob.
208
209config USE_BOOTCOMMAND
210	bool "Enable a default value for bootcmd"
211	help
212	  Provide a default value for the bootcmd entry in the environment.  If
213	  autoboot is enabled this is what will be run automatically.  Enable
214	  this option to be able to specify CONFIG_BOOTCOMMAND as a string.  If
215	  this option is disabled, CONFIG_BOOTCOMMAND will be undefined and
216	  won't take any space in U-Boot image.
217
218config BOOTCOMMAND
219	string "bootcmd value"
220	depends on USE_BOOTCOMMAND
221	default "run distro_bootcmd" if DISTRO_DEFAULTS
222	help
223	  This is the string of commands that will be used as bootcmd and if
224	  AUTOBOOT is set, automatically run.
225
226menu "Console"
227
228config MENU
229	bool
230	help
231	  This is the library functionality to provide a text-based menu of
232	  choices for the user to make choices with.
233
234config CONSOLE_RECORD
235	bool "Console recording"
236	help
237	  This provides a way to record console output (and provide console
238	  input) through circular buffers. This is mostly useful for testing.
239	  Console output is recorded even when the console is silent.
240	  To enable console recording, call console_record_reset_enable()
241	  from your code.
242
243config CONSOLE_RECORD_OUT_SIZE
244	hex "Output buffer size"
245	depends on CONSOLE_RECORD
246	default 0x400 if CONSOLE_RECORD
247	help
248	  Set the size of the console output buffer. When this fills up, no
249	  more data will be recorded until some is removed. The buffer is
250	  allocated immediately after the malloc() region is ready.
251
252config CONSOLE_RECORD_IN_SIZE
253	hex "Input buffer size"
254	depends on CONSOLE_RECORD
255	default 0x100 if CONSOLE_RECORD
256	help
257	  Set the size of the console input buffer. When this contains data,
258	  tstc() and getc() will use this in preference to real device input.
259	  The buffer is allocated immediately after the malloc() region is
260	  ready.
261
262config IDENT_STRING
263	string "Board specific string to be added to uboot version string"
264	help
265	  This options adds the board specific name to u-boot version.
266
267config LOGLEVEL
268	int "loglevel"
269	default 4
270	range 0 8
271	help
272	  All Messages with a loglevel smaller than the console loglevel will
273	  be compiled in. The loglevels are defined as follows:
274
275	  0 (KERN_EMERG)          system is unusable
276	  1 (KERN_ALERT)          action must be taken immediately
277	  2 (KERN_CRIT)           critical conditions
278	  3 (KERN_ERR)            error conditions
279	  4 (KERN_WARNING)        warning conditions
280	  5 (KERN_NOTICE)         normal but significant condition
281	  6 (KERN_INFO)           informational
282	  7 (KERN_DEBUG)          debug-level messages
283
284config SPL_LOGLEVEL
285	int
286	default LOGLEVEL
287
288config SILENT_CONSOLE
289	bool "Support a silent console"
290	help
291	  This option allows the console to be silenced, meaning that no
292	  output will appear on the console devices. This is controlled by
293	  setting the environment vaariable 'silent' to a non-empty value.
294	  Note this also silences the console when booting Linux.
295
296	  When the console is set up, the variable is checked, and the
297	  GD_FLG_SILENT flag is set. Changing the environment variable later
298	  will update the flag.
299
300config SILENT_U_BOOT_ONLY
301	bool "Only silence the U-Boot console"
302	depends on SILENT_CONSOLE
303	help
304	  Normally when the U-Boot console is silenced, Linux's console is
305	  also silenced (assuming the board boots into Linux). This option
306	  allows the linux console to operate normally, even if U-Boot's
307	  is silenced.
308
309config SILENT_CONSOLE_UPDATE_ON_SET
310	bool "Changes to the 'silent' environment variable update immediately"
311	depends on SILENT_CONSOLE
312	default y if SILENT_CONSOLE
313	help
314	  When the 'silent' environment variable is changed, update the
315	  console silence flag immediately. This allows 'setenv' to be used
316	  to silence or un-silence the console.
317
318	  The effect is that any change to the variable will affect the
319	  GD_FLG_SILENT flag.
320
321config SILENT_CONSOLE_UPDATE_ON_RELOC
322	bool "Allow flags to take effect on relocation"
323	depends on SILENT_CONSOLE
324	help
325	  In some cases the environment is not available until relocation
326	  (e.g. NAND). This option makes the value of the 'silent'
327	  environment variable take effect at relocation.
328
329config PRE_CONSOLE_BUFFER
330	bool "Buffer characters before the console is available"
331	help
332	  Prior to the console being initialised (i.e. serial UART
333	  initialised etc) all console output is silently discarded.
334	  Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
335	  buffer any console messages prior to the console being
336	  initialised to a buffer. The buffer is a circular buffer, so
337	  if it overflows, earlier output is discarded.
338
339	  Note that this is not currently supported in SPL. It would be
340	  useful to be able to share the pre-console buffer with SPL.
341
342config PRE_CON_BUF_SZ
343	int "Sets the size of the pre-console buffer"
344	depends on PRE_CONSOLE_BUFFER
345	default 4096
346	help
347	  The size of the pre-console buffer affects how much console output
348	  can be held before it overflows and starts discarding earlier
349	  output. Normally there is very little output at this early stage,
350	  unless debugging is enabled, so allow enough for ~10 lines of
351	  text.
352
353	  This is a useful feature if you are using a video console and
354	  want to see the full boot output on the console. Without this
355	  option only the post-relocation output will be displayed.
356
357config PRE_CON_BUF_ADDR
358	hex "Address of the pre-console buffer"
359	depends on PRE_CONSOLE_BUFFER
360	default 0x2f000000 if ARCH_SUNXI && MACH_SUN9I
361	default 0x4f000000 if ARCH_SUNXI && !MACH_SUN9I
362	help
363	  This sets the start address of the pre-console buffer. This must
364	  be in available memory and is accessed before relocation and
365	  possibly before DRAM is set up. Therefore choose an address
366	  carefully.
367
368	  We should consider removing this option and allocating the memory
369	  in board_init_f_init_reserve() instead.
370
371config CONSOLE_MUX
372	bool "Enable console multiplexing"
373	default y if DM_VIDEO || VIDEO || LCD
374	help
375	  This allows multiple devices to be used for each console 'file'.
376	  For example, stdout can be set to go to serial and video.
377	  Similarly, stdin can be set to come from serial and keyboard.
378	  Input can be provided from either source. Console multiplexing
379	  adds a small amount of size to U-Boot.  Changes to the environment
380	  variables stdout, stdin and stderr will take effect immediately.
381
382config SYS_CONSOLE_IS_IN_ENV
383	bool "Select console devices from the environment"
384	default y if CONSOLE_MUX
385	help
386	  This allows multiple input/output devices to be set at boot time.
387	  For example, if stdout is set to "serial,video" then output will
388	  be sent to both the serial and video devices on boot. The
389	  environment variables can be updated after boot to change the
390	  input/output devices.
391
392config SYS_CONSOLE_OVERWRITE_ROUTINE
393	bool "Allow board control over console overwriting"
394	help
395	  If this is enabled, and the board-specific function
396	  overwrite_console() returns 1, the stdin, stderr and stdout are
397	  switched to the serial port, else the settings in the environment
398	  are used. If this is not enabled, the console will not be switched
399	  to serial.
400
401config SYS_CONSOLE_ENV_OVERWRITE
402	bool "Update environment variables during console init"
403	help
404	  The console environment variables (stdout, stdin, stderr) can be
405	  used to determine the correct console devices on start-up. This
406	  option writes the console devices to these variables on console
407	  start-up (after relocation). This causes the environment to be
408	  updated to match the console devices actually chosen.
409
410config SYS_CONSOLE_INFO_QUIET
411	bool "Don't display the console devices on boot"
412	help
413	  Normally U-Boot displays the current settings for stdout, stdin
414	  and stderr on boot when the post-relocation console is set up.
415	  Enable this option to supress this output. It can be obtained by
416	  calling stdio_print_current_devices() from board code.
417
418config SYS_STDIO_DEREGISTER
419	bool "Allow deregistering stdio devices"
420	default y if USB_KEYBOARD
421	help
422	  Generally there is no need to deregister stdio devices since they
423	  are never deactivated. But if a stdio device is used which can be
424	  removed (for example a USB keyboard) then this option can be
425	  enabled to ensure this is handled correctly.
426
427endmenu
428
429menu "Logging"
430
431config LOG
432	bool "Enable logging support"
433	depends on DM
434	help
435	  This enables support for logging of status and debug messages. These
436	  can be displayed on the console, recorded in a memory buffer, or
437	  discarded if not needed. Logging supports various categories and
438	  levels of severity.
439
440config SPL_LOG
441	bool "Enable logging support in SPL"
442	help
443	  This enables support for logging of status and debug messages. These
444	  can be displayed on the console, recorded in a memory buffer, or
445	  discarded if not needed. Logging supports various categories and
446	  levels of severity.
447
448config LOG_MAX_LEVEL
449	int "Maximum log level to record"
450	depends on LOG
451	default 5
452	help
453	  This selects the maximum log level that will be recorded. Any value
454	  higher than this will be ignored. If possible log statements below
455	  this level will be discarded at build time. Levels:
456
457	    0 - panic
458	    1 - critical
459	    2 - error
460	    3 - warning
461	    4 - note
462	    5 - info
463	    6 - detail
464	    7 - debug
465
466config SPL_LOG_MAX_LEVEL
467	int "Maximum log level to record in SPL"
468	depends on SPL_LOG
469	default 3
470	help
471	  This selects the maximum log level that will be recorded. Any value
472	  higher than this will be ignored. If possible log statements below
473	  this level will be discarded at build time. Levels:
474
475	    0 - panic
476	    1 - critical
477	    2 - error
478	    3 - warning
479	    4 - note
480	    5 - info
481	    6 - detail
482	    7 - debug
483
484config LOG_CONSOLE
485	bool "Allow log output to the console"
486	depends on LOG
487	default y
488	help
489	  Enables a log driver which writes log records to the console.
490	  Generally the console is the serial port or LCD display. Only the
491	  log message is shown - other details like level, category, file and
492	  line number are omitted.
493
494config LOG_SPL_CONSOLE
495	bool "Allow log output to the console in SPL"
496	depends on LOG_SPL
497	default y
498	help
499	  Enables a log driver which writes log records to the console.
500	  Generally the console is the serial port or LCD display. Only the
501	  log message is shown - other details like level, category, file and
502	  line number are omitted.
503
504config LOG_TEST
505	bool "Provide a test for logging"
506	depends on LOG
507	default y if SANDBOX
508	help
509	  This enables a 'log test' command to test logging. It is normally
510	  executed from a pytest and simply outputs logging information
511	  in various different ways to test that the logging system works
512	  correctly with varoius settings.
513
514config LOG_ERROR_RETURN
515	bool "Log all functions which return an error"
516	depends on LOG
517	help
518	  When an error is returned in U-Boot it is sometimes difficult to
519	  figure out the root cause. For eaxmple, reading from SPI flash may
520	  fail due to a problem in the SPI controller or due to the flash part
521	  not returning the expected information. This option changes
522	  log_ret() to log any errors it sees. With this option disabled,
523	  log_ret() is a nop.
524
525	  You can add log_ret() to all functions which return an error code.
526
527endmenu
528
529config SUPPORT_RAW_INITRD
530	bool "Enable raw initrd images"
531	help
532	  Note, defining the SUPPORT_RAW_INITRD allows user to supply
533	  kernel with raw initrd images. The syntax is slightly different, the
534	  address of the initrd must be augmented by it's size, in the following
535	  format: "<initrd address>:<initrd size>".
536
537config DEFAULT_FDT_FILE
538	string "Default fdt file"
539	help
540	  This option is used to set the default fdt file to boot OS.
541
542config MISC_INIT_R
543	bool "Execute Misc Init"
544	default y if ARCH_KEYSTONE || ARCH_SUNXI || MPC85xx
545	default y if ARCH_OMAP2PLUS && !AM33XX
546	help
547	  Enabling this option calls 'misc_init_r' function
548
549config VERSION_VARIABLE
550	bool "add U-Boot environment variable vers"
551	default n
552	help
553	  If this variable is defined, an environment variable
554	  named "ver" is created by U-Boot showing the U-Boot
555	  version as printed by the "version" command.
556	  Any change to this variable will be reverted at the
557	  next reset.
558
559config BOARD_LATE_INIT
560	bool
561	help
562	  Sometimes board require some initialization code that might
563	  require once the actual init done, example saving board specific env,
564	  boot-modes etc. which eventually done at late.
565
566	  So this config enable the late init code with the help of board_late_init
567	  function which should defined on respective boards.
568
569config DISPLAY_CPUINFO
570	bool "Display information about the CPU during start up"
571	default y if ARM || NIOS2 || X86 || XTENSA || M68K
572	help
573	  Display information about the CPU that U-Boot is running on
574	  when U-Boot starts up. The function print_cpuinfo() is called
575	  to do this.
576
577config DISPLAY_BOARDINFO
578	bool "Display information about the board during early start up"
579	default y if ARM || M68K || MIPS || PPC || SANDBOX || XTENSA
580	help
581	  Display information about the board that U-Boot is running on
582	  when U-Boot starts up. The board function checkboard() is called
583	  to do this.
584
585config DISPLAY_BOARDINFO_LATE
586	bool "Display information about the board during late start up"
587	help
588	  Display information about the board that U-Boot is running on after
589	  the relocation phase. The board function checkboard() is called to do
590	  this.
591
592menu "Start-up hooks"
593
594config ARCH_EARLY_INIT_R
595	bool "Call arch-specific init soon after relocation"
596	help
597	  With this option U-Boot will call arch_early_init_r() soon after
598	  relocation. Driver model is running by this point, and the cache
599	  is on. Note that board_early_init_r() is called first, if
600	  enabled. This can be used to set up architecture-specific devices.
601
602config ARCH_MISC_INIT
603	bool "Call arch-specific init after relocation, when console is ready"
604	help
605	  With this option U-Boot will call arch_misc_init() after
606	  relocation to allow miscellaneous arch-dependent initialisation
607	  to be performed. This function should be defined by the board
608	  and will be called after the console is set up, after relocaiton.
609
610config BOARD_EARLY_INIT_F
611	bool "Call board-specific init before relocation"
612	help
613	  Some boards need to perform initialisation as soon as possible
614	  after boot. With this option, U-Boot calls board_early_init_f()
615	  after driver model is ready in the pre-relocation init sequence.
616	  Note that the normal serial console is not yet set up, but the
617	  debug UART will be available if enabled.
618
619config BOARD_EARLY_INIT_R
620	bool "Call board-specific init after relocation"
621	help
622	  Some boards need to perform initialisation as directly after
623	  relocation. With this option, U-Boot calls board_early_init_r()
624	  in the post-relocation init sequence.
625
626config LAST_STAGE_INIT
627	bool "Call board-specific as last setup step"
628	help
629	  Some boards need to perform initialisation immediately before control
630	  is passed to the command-line interpreter (e.g. for initializations
631	  that depend on later phases in the init sequence). With this option,
632	  U-Boot calls last_stage_init() before the command-line interpreter is
633	  started.
634
635endmenu
636
637menu "Security support"
638
639config HASH
640	bool # "Support hashing API (SHA1, SHA256, etc.)"
641	help
642	  This provides a way to hash data in memory using various supported
643	  algorithms (such as SHA1, MD5, CRC32). The API is defined in hash.h
644	  and the algorithms it supports are defined in common/hash.c. See
645	  also CMD_HASH for command-line access.
646
647config AVB_VERIFY
648	bool "Build Android Verified Boot operations"
649	depends on LIBAVB && FASTBOOT
650	depends on PARTITION_UUIDS
651	help
652	  This option enables compilation of bootloader-dependent operations,
653	  used by Android Verified Boot 2.0 library (libavb). Includes:
654	    * Helpers to process strings in order to build OS bootargs.
655	    * Helpers to access MMC, similar to drivers/fastboot/fb_mmc.c.
656	    * Helpers to alloc/init/free avb ops.
657
658endmenu
659
660menu "Update support"
661
662config UPDATE_TFTP
663	bool "Auto-update using fitImage via TFTP"
664	depends on FIT
665	help
666	  This option allows performing update of NOR with data in fitImage
667	  sent via TFTP boot.
668
669config UPDATE_TFTP_CNT_MAX
670	int "The number of connection retries during auto-update"
671	default 0
672	depends on UPDATE_TFTP
673
674config UPDATE_TFTP_MSEC_MAX
675	int "Delay in mSec to wait for the TFTP server during auto-update"
676	default 100
677	depends on UPDATE_TFTP
678
679endmenu
680
681source "common/spl/Kconfig"
682