common: update: add a generic interface for FIT image
[platform/kernel/u-boot.git] / common / Kconfig
1 source "common/Kconfig.boot"
2
3 menu "Console"
4
5 config MENU
6         bool
7         help
8           This is the library functionality to provide a text-based menu of
9           choices for the user to make choices with.
10
11 config CONSOLE_RECORD
12         bool "Console recording"
13         help
14           This provides a way to record console output (and provide console
15           input) through circular buffers. This is mostly useful for testing.
16           Console output is recorded even when the console is silent.
17           To enable console recording, call console_record_reset_enable()
18           from your code.
19
20 config CONSOLE_RECORD_OUT_SIZE
21         hex "Output buffer size"
22         depends on CONSOLE_RECORD
23         default 0x400 if CONSOLE_RECORD
24         help
25           Set the size of the console output buffer. When this fills up, no
26           more data will be recorded until some is removed. The buffer is
27           allocated immediately after the malloc() region is ready.
28
29 config CONSOLE_RECORD_IN_SIZE
30         hex "Input buffer size"
31         depends on CONSOLE_RECORD
32         default 0x100 if CONSOLE_RECORD
33         help
34           Set the size of the console input buffer. When this contains data,
35           tstc() and getc() will use this in preference to real device input.
36           The buffer is allocated immediately after the malloc() region is
37           ready.
38
39 config DISABLE_CONSOLE
40         bool "Add functionality to disable console completely"
41         help
42                 Disable console (in & out).
43
44 config IDENT_STRING
45         string "Board specific string to be added to uboot version string"
46         help
47           This options adds the board specific name to u-boot version.
48
49 config LOGLEVEL
50         int "loglevel"
51         default 4
52         range 0 10
53         help
54           All Messages with a loglevel smaller than the console loglevel will
55           be compiled in. The loglevels are defined as follows:
56
57             0 - emergency
58             1 - alert
59             2 - critical
60             3 - error
61             4 - warning
62             5 - note
63             6 - info
64             7 - debug
65             8 - debug content
66             9 - debug hardware I/O
67
68 config SPL_LOGLEVEL
69         int
70         default LOGLEVEL
71
72 config TPL_LOGLEVEL
73         int
74         default LOGLEVEL
75
76 config SILENT_CONSOLE
77         bool "Support a silent console"
78         help
79           This option allows the console to be silenced, meaning that no
80           output will appear on the console devices. This is controlled by
81           setting the environment variable 'silent' to a non-empty value.
82           Note this also silences the console when booting Linux.
83
84           When the console is set up, the variable is checked, and the
85           GD_FLG_SILENT flag is set. Changing the environment variable later
86           will update the flag.
87
88 config SILENT_U_BOOT_ONLY
89         bool "Only silence the U-Boot console"
90         depends on SILENT_CONSOLE
91         help
92           Normally when the U-Boot console is silenced, Linux's console is
93           also silenced (assuming the board boots into Linux). This option
94           allows the linux console to operate normally, even if U-Boot's
95           is silenced.
96
97 config SILENT_CONSOLE_UPDATE_ON_SET
98         bool "Changes to the 'silent' environment variable update immediately"
99         depends on SILENT_CONSOLE
100         default y if SILENT_CONSOLE
101         help
102           When the 'silent' environment variable is changed, update the
103           console silence flag immediately. This allows 'setenv' to be used
104           to silence or un-silence the console.
105
106           The effect is that any change to the variable will affect the
107           GD_FLG_SILENT flag.
108
109 config SILENT_CONSOLE_UPDATE_ON_RELOC
110         bool "Allow flags to take effect on relocation"
111         depends on SILENT_CONSOLE
112         help
113           In some cases the environment is not available until relocation
114           (e.g. NAND). This option makes the value of the 'silent'
115           environment variable take effect at relocation.
116
117 config PRE_CONSOLE_BUFFER
118         bool "Buffer characters before the console is available"
119         help
120           Prior to the console being initialised (i.e. serial UART
121           initialised etc) all console output is silently discarded.
122           Defining CONFIG_PRE_CONSOLE_BUFFER will cause U-Boot to
123           buffer any console messages prior to the console being
124           initialised to a buffer. The buffer is a circular buffer, so
125           if it overflows, earlier output is discarded.
126
127           Note that this is not currently supported in SPL. It would be
128           useful to be able to share the pre-console buffer with SPL.
129
130 config PRE_CON_BUF_SZ
131         int "Sets the size of the pre-console buffer"
132         depends on PRE_CONSOLE_BUFFER
133         default 4096
134         help
135           The size of the pre-console buffer affects how much console output
136           can be held before it overflows and starts discarding earlier
137           output. Normally there is very little output at this early stage,
138           unless debugging is enabled, so allow enough for ~10 lines of
139           text.
140
141           This is a useful feature if you are using a video console and
142           want to see the full boot output on the console. Without this
143           option only the post-relocation output will be displayed.
144
145 config PRE_CON_BUF_ADDR
146         hex "Address of the pre-console buffer"
147         depends on PRE_CONSOLE_BUFFER
148         default 0x2f000000 if ARCH_SUNXI && MACH_SUN9I
149         default 0x4f000000 if ARCH_SUNXI && !MACH_SUN9I
150         default 0x0f000000 if ROCKCHIP_RK3288
151         default 0x0f200000 if ROCKCHIP_RK3399
152         help
153           This sets the start address of the pre-console buffer. This must
154           be in available memory and is accessed before relocation and
155           possibly before DRAM is set up. Therefore choose an address
156           carefully.
157
158           We should consider removing this option and allocating the memory
159           in board_init_f_init_reserve() instead.
160
161 config CONSOLE_MUX
162         bool "Enable console multiplexing"
163         default y if DM_VIDEO || VIDEO || LCD
164         help
165           This allows multiple devices to be used for each console 'file'.
166           For example, stdout can be set to go to serial and video.
167           Similarly, stdin can be set to come from serial and keyboard.
168           Input can be provided from either source. Console multiplexing
169           adds a small amount of size to U-Boot.  Changes to the environment
170           variables stdout, stdin and stderr will take effect immediately.
171
172 config SYS_CONSOLE_IS_IN_ENV
173         bool "Select console devices from the environment"
174         default y if CONSOLE_MUX
175         help
176           This allows multiple input/output devices to be set at boot time.
177           For example, if stdout is set to "serial,video" then output will
178           be sent to both the serial and video devices on boot. The
179           environment variables can be updated after boot to change the
180           input/output devices.
181
182 config SYS_CONSOLE_OVERWRITE_ROUTINE
183         bool "Allow board control over console overwriting"
184         help
185           If this is enabled, and the board-specific function
186           overwrite_console() returns 1, the stdin, stderr and stdout are
187           switched to the serial port, else the settings in the environment
188           are used. If this is not enabled, the console will not be switched
189           to serial.
190
191 config SYS_CONSOLE_ENV_OVERWRITE
192         bool "Update environment variables during console init"
193         help
194           The console environment variables (stdout, stdin, stderr) can be
195           used to determine the correct console devices on start-up. This
196           option writes the console devices to these variables on console
197           start-up (after relocation). This causes the environment to be
198           updated to match the console devices actually chosen.
199
200 config SYS_CONSOLE_INFO_QUIET
201         bool "Don't display the console devices on boot"
202         help
203           Normally U-Boot displays the current settings for stdout, stdin
204           and stderr on boot when the post-relocation console is set up.
205           Enable this option to suppress this output. It can be obtained by
206           calling stdio_print_current_devices() from board code.
207
208 config SYS_STDIO_DEREGISTER
209         bool "Allow deregistering stdio devices"
210         default y if USB_KEYBOARD
211         help
212           Generally there is no need to deregister stdio devices since they
213           are never deactivated. But if a stdio device is used which can be
214           removed (for example a USB keyboard) then this option can be
215           enabled to ensure this is handled correctly.
216
217 config SPL_SYS_STDIO_DEREGISTER
218         bool "Allow deregistering stdio devices in SPL"
219         help
220           Generally there is no need to deregister stdio devices since they
221           are never deactivated. But if a stdio device is used which can be
222           removed (for example a USB keyboard) then this option can be
223           enabled to ensure this is handled correctly. This is very rarely
224           needed in SPL.
225
226 config SYS_DEVICE_NULLDEV
227         bool "Enable a null device for stdio"
228         default y if SPLASH_SCREEN || SYS_STDIO_DEREGISTER
229         help
230           Enable creation of a "nulldev" stdio device. This allows silent
231           operation of the console by setting stdout to "nulldev". Enable
232           this to use a serial console under board control.
233
234 endmenu
235
236 menu "Logging"
237
238 config LOG
239         bool "Enable logging support"
240         depends on DM
241         help
242           This enables support for logging of status and debug messages. These
243           can be displayed on the console, recorded in a memory buffer, or
244           discarded if not needed. Logging supports various categories and
245           levels of severity.
246
247 if LOG
248
249 config LOG_MAX_LEVEL
250         int "Maximum log level to record"
251         default 6
252         range 0 9
253         help
254           This selects the maximum log level that will be recorded. Any value
255           higher than this will be ignored. If possible log statements below
256           this level will be discarded at build time. Levels:
257
258             0 - emergency
259             1 - alert
260             2 - critical
261             3 - error
262             4 - warning
263             5 - note
264             6 - info
265             7 - debug
266             8 - debug content
267             9 - debug hardware I/O
268
269 config LOG_DEFAULT_LEVEL
270         int "Default logging level to display"
271         default LOG_MAX_LEVEL
272         range 0 LOG_MAX_LEVEL
273         help
274           This is the default logging level set when U-Boot starts. It can
275           be adjusted later using the 'log level' command. Note that setting
276           this to a value above LOG_MAX_LEVEL will be ineffective, since the
277           higher levels are not compiled in to U-Boot.
278
279             0 - emergency
280             1 - alert
281             2 - critical
282             3 - error
283             4 - warning
284             5 - note
285             6 - info
286             7 - debug
287             8 - debug content
288             9 - debug hardware I/O
289
290 config LOG_CONSOLE
291         bool "Allow log output to the console"
292         default y
293         help
294           Enables a log driver which writes log records to the console.
295           Generally the console is the serial port or LCD display. Only the
296           log message is shown - other details like level, category, file and
297           line number are omitted.
298
299 config LOGF_FILE
300         bool "Show source file name in log messages by default"
301         help
302           Show the source file name in log messages by default. This value
303           can be overridden using the 'log format' command.
304
305 config LOGF_LINE
306         bool "Show source line number in log messages by default"
307         help
308           Show the source line number in log messages by default. This value
309           can be overridden using the 'log format' command.
310
311 config LOGF_FUNC
312         bool "Show function name in log messages by default"
313         help
314           Show the function name in log messages by default. This value can
315           be overridden using the 'log format' command.
316
317 config LOG_SYSLOG
318         bool "Log output to syslog server"
319         depends on NET
320         help
321           Enables a log driver which broadcasts log records via UDP port 514
322           to syslog servers.
323
324 config SPL_LOG
325         bool "Enable logging support in SPL"
326         depends on LOG
327         help
328           This enables support for logging of status and debug messages. These
329           can be displayed on the console, recorded in a memory buffer, or
330           discarded if not needed. Logging supports various categories and
331           levels of severity.
332
333 if SPL_LOG
334
335 config SPL_LOG_MAX_LEVEL
336         int "Maximum log level to record in SPL"
337         depends on SPL_LOG
338         default 3
339         range 0 9
340         help
341           This selects the maximum log level that will be recorded. Any value
342           higher than this will be ignored. If possible log statements below
343           this level will be discarded at build time. Levels:
344
345             0 - emergency
346             1 - alert
347             2 - critical
348             3 - error
349             4 - warning
350             5 - note
351             6 - info
352             7 - debug
353             8 - debug content
354             9 - debug hardware I/O
355
356 config SPL_LOG_CONSOLE
357         bool "Allow log output to the console in SPL"
358         default y
359         help
360           Enables a log driver which writes log records to the console.
361           Generally the console is the serial port or LCD display. Only the
362           log message is shown - other details like level, category, file and
363           line number are omitted.
364
365 endif
366
367 config TPL_LOG
368         bool "Enable logging support in TPL"
369         depends on LOG
370         help
371           This enables support for logging of status and debug messages. These
372           can be displayed on the console, recorded in a memory buffer, or
373           discarded if not needed. Logging supports various categories and
374           levels of severity.
375
376 if TPL_LOG
377
378 config TPL_LOG_MAX_LEVEL
379         int "Maximum log level to record in TPL"
380         depends on TPL_LOG
381         default 3
382         range 0 9
383         help
384           This selects the maximum log level that will be recorded. Any value
385           higher than this will be ignored. If possible log statements below
386           this level will be discarded at build time. Levels:
387
388             0 - emergency
389             1 - alert
390             2 - critical
391             3 - error
392             4 - warning
393             5 - note
394             6 - info
395             7 - debug
396             8 - debug content
397             9 - debug hardware I/O
398
399 config TPL_LOG_CONSOLE
400         bool "Allow log output to the console in TPL"
401         default y
402         help
403           Enables a log driver which writes log records to the console.
404           Generally the console is the serial port or LCD display. Only the
405           log message is shown - other details like level, category, file and
406           line number are omitted.
407
408 endif
409
410 config LOG_ERROR_RETURN
411         bool "Log all functions which return an error"
412         help
413           When an error is returned in U-Boot it is sometimes difficult to
414           figure out the root cause. For example, reading from SPI flash may
415           fail due to a problem in the SPI controller or due to the flash part
416           not returning the expected information. This option changes
417           log_ret() to log any errors it sees. With this option disabled,
418           log_ret() is a nop.
419
420           You can add log_ret() to all functions which return an error code.
421
422 config LOG_TEST
423         bool "Provide a test for logging"
424         depends on UNIT_TEST
425         default y if SANDBOX
426         help
427           This enables a 'log test' command to test logging. It is normally
428           executed from a pytest and simply outputs logging information
429           in various different ways to test that the logging system works
430           correctly with various settings.
431
432 endif
433
434 endmenu
435
436 menu "Init options"
437
438 config BOARD_TYPES
439         bool "Call get_board_type() to get and display the board type"
440         help
441           If this option is enabled, checkboard() will call get_board_type()
442           to get a string containing the board type and this will be
443           displayed immediately after the model is shown on the console
444           early in boot.
445
446 config DISPLAY_CPUINFO
447         bool "Display information about the CPU during start up"
448         default y if ARC|| ARM || NIOS2 || X86 || XTENSA || M68K
449         help
450           Display information about the CPU that U-Boot is running on
451           when U-Boot starts up. The function print_cpuinfo() is called
452           to do this.
453
454 config DISPLAY_BOARDINFO
455         bool "Display information about the board during early start up"
456         default y if ARC || ARM || M68K || MIPS || PPC || SANDBOX || XTENSA
457         help
458           Display information about the board that U-Boot is running on
459           when U-Boot starts up. The board function checkboard() is called
460           to do this.
461
462 config DISPLAY_BOARDINFO_LATE
463         bool "Display information about the board during late start up"
464         help
465           Display information about the board that U-Boot is running on after
466           the relocation phase. The board function checkboard() is called to do
467           this.
468
469 menu "Start-up hooks"
470
471 config ARCH_EARLY_INIT_R
472         bool "Call arch-specific init soon after relocation"
473         help
474           With this option U-Boot will call arch_early_init_r() soon after
475           relocation. Driver model is running by this point, and the cache
476           is on. Note that board_early_init_r() is called first, if
477           enabled. This can be used to set up architecture-specific devices.
478
479 config ARCH_MISC_INIT
480         bool "Call arch-specific init after relocation, when console is ready"
481         help
482           With this option U-Boot will call arch_misc_init() after
483           relocation to allow miscellaneous arch-dependent initialisation
484           to be performed. This function should be defined by the board
485           and will be called after the console is set up, after relocation.
486
487 config BOARD_EARLY_INIT_F
488         bool "Call board-specific init before relocation"
489         help
490           Some boards need to perform initialisation as soon as possible
491           after boot. With this option, U-Boot calls board_early_init_f()
492           after driver model is ready in the pre-relocation init sequence.
493           Note that the normal serial console is not yet set up, but the
494           debug UART will be available if enabled.
495
496 config BOARD_EARLY_INIT_R
497         bool "Call board-specific init after relocation"
498         help
499           Some boards need to perform initialisation as directly after
500           relocation. With this option, U-Boot calls board_early_init_r()
501           in the post-relocation init sequence.
502
503 config BOARD_LATE_INIT
504         bool "Execute Board late init"
505         help
506           Sometimes board require some initialization code that might
507           require once the actual init done, example saving board specific env,
508           boot-modes etc. which eventually done at late.
509
510           So this config enable the late init code with the help of board_late_init
511           function which should defined on respective boards.
512
513 config LAST_STAGE_INIT
514         bool "Call board-specific as last setup step"
515         help
516           Some boards need to perform initialisation immediately before control
517           is passed to the command-line interpreter (e.g. for initializations
518           that depend on later phases in the init sequence). With this option,
519           U-Boot calls last_stage_init() before the command-line interpreter is
520           started.
521
522 config MISC_INIT_R
523         bool "Execute Misc Init"
524         default y if ARCH_KEYSTONE || ARCH_SUNXI || MPC85xx
525         default y if ARCH_OMAP2PLUS && !AM33XX
526         help
527           Enabling this option calls 'misc_init_r' function
528
529 config PCI_INIT_R
530         bool "Enumerate PCI buses during init"
531         depends on PCI
532         default y if !DM_PCI
533         help
534           With this option U-Boot will call pci_init() soon after relocation,
535           which will enumerate PCI buses. This is needed, for instance, in the
536           case of DM PCI-based Ethernet devices, which will not be detected
537           without having the enumeration performed earlier.
538
539 endmenu
540
541 endmenu         # Init options
542
543 menu "Security support"
544
545 config HASH
546         bool # "Support hashing API (SHA1, SHA256, etc.)"
547         help
548           This provides a way to hash data in memory using various supported
549           algorithms (such as SHA1, MD5, CRC32). The API is defined in hash.h
550           and the algorithms it supports are defined in common/hash.c. See
551           also CMD_HASH for command-line access.
552
553 config AVB_VERIFY
554         bool "Build Android Verified Boot operations"
555         depends on LIBAVB
556         depends on PARTITION_UUIDS
557         help
558           This option enables compilation of bootloader-dependent operations,
559           used by Android Verified Boot 2.0 library (libavb). Includes:
560             * Helpers to process strings in order to build OS bootargs.
561             * Helpers to access MMC, similar to drivers/fastboot/fb_mmc.c.
562             * Helpers to alloc/init/free avb ops.
563
564 if AVB_VERIFY
565
566 config AVB_BUF_ADDR
567         hex "Define AVB buffer address"
568         default FASTBOOT_BUF_ADDR
569         help
570           AVB requires a buffer for memory transactions. This variable defines the
571           buffer address.
572
573 config AVB_BUF_SIZE
574         hex "Define AVB buffer SIZE"
575         default FASTBOOT_BUF_SIZE
576         help
577           AVB requires a buffer for memory transactions. This variable defines the
578           buffer size.
579
580 endif # AVB_VERIFY
581
582 config SPL_HASH
583         bool # "Support hashing API (SHA1, SHA256, etc.)"
584         help
585           This provides a way to hash data in memory using various supported
586           algorithms (such as SHA1, MD5, CRC32). The API is defined in hash.h
587           and the algorithms it supports are defined in common/hash.c. See
588           also CMD_HASH for command-line access.
589
590 config TPL_HASH
591         bool # "Support hashing API (SHA1, SHA256, etc.)"
592         help
593           This provides a way to hash data in memory using various supported
594           algorithms (such as SHA1, MD5, CRC32). The API is defined in hash.h
595           and the algorithms it supports are defined in common/hash.c. See
596           also CMD_HASH for command-line access.
597
598 endmenu
599
600 menu "Update support"
601
602 config UPDATE_COMMON
603         bool
604         default n
605         select DFU_WRITE_ALT
606
607 config UPDATE_TFTP
608         bool "Auto-update using fitImage via TFTP"
609         depends on FIT
610         select UPDATE_COMMON
611         help
612           This option allows performing update of NOR with data in fitImage
613           sent via TFTP boot.
614
615 config UPDATE_TFTP_CNT_MAX
616         int "The number of connection retries during auto-update"
617         default 0
618         depends on UPDATE_TFTP
619
620 config UPDATE_TFTP_MSEC_MAX
621         int "Delay in mSec to wait for the TFTP server during auto-update"
622         default 100
623         depends on UPDATE_TFTP
624
625 config UPDATE_FIT
626         bool "Firmware update using fitImage"
627         depends on FIT
628         depends on DFU
629         select UPDATE_COMMON
630         help
631           This option allows performing update of DFU-capable storage with
632           data in fitImage.
633
634 config ANDROID_AB
635         bool "Android A/B updates"
636         default n
637         help
638           If enabled, adds support for the new Android A/B update model. This
639           allows the bootloader to select which slot to boot from based on the
640           information provided by userspace via the Android boot_ctrl HAL. This
641           allows a bootloader to try a new version of the system but roll back
642           to previous version if the new one didn't boot all the way.
643
644 endmenu
645
646 menu "Blob list"
647
648 config BLOBLIST
649         bool "Support for a bloblist"
650         help
651           This enables support for a bloblist in U-Boot, which can be passed
652           from TPL to SPL to U-Boot proper (and potentially to Linux). The
653           blob list supports multiple binary blobs of data, each with a tag,
654           so that different U-Boot components can store data which can survive
655           through to the next stage of the boot.
656
657 config SPL_BLOBLIST
658         bool "Support for a bloblist in SPL"
659         depends on BLOBLIST
660         default y if SPL
661         help
662           This enables a bloblist in SPL. If this is the first part of U-Boot
663           to run, then the bloblist is set up in SPL and passed to U-Boot
664           proper. If TPL also has a bloblist, then SPL uses the one from there.
665
666 config TPL_BLOBLIST
667         bool "Support for a bloblist in TPL"
668         depends on BLOBLIST
669         default y if TPL
670         help
671           This enables a bloblist in TPL. The bloblist is set up in TPL and
672           passed to SPL and U-Boot proper.
673
674 config BLOBLIST_SIZE
675         hex "Size of bloblist"
676         depends on BLOBLIST
677         default 0x400
678         help
679           Sets the size of the bloblist in bytes. This must include all
680           overhead (alignment, bloblist header, record header). The bloblist
681           is set up in the first part of U-Boot to run (TPL, SPL or U-Boot
682           proper), and this sane bloblist is used for subsequent stages.
683
684 config BLOBLIST_ADDR
685         hex "Address of bloblist"
686         depends on BLOBLIST
687         default 0xe000 if SANDBOX
688         help
689           Sets the address of the bloblist, set up by the first part of U-Boot
690           which runs. Subsequent U-Boot stages typically use the same address.
691
692 endmenu
693
694 source "common/spl/Kconfig"
695
696 config IMAGE_SIGN_INFO
697         bool
698         select SHA1
699         select SHA256
700         help
701           Enable image_sign_info helper functions.
702
703 if IMAGE_SIGN_INFO
704
705 config SPL_IMAGE_SIGN_INFO
706         bool
707         select SHA1
708         select SHA256
709         help
710           Enable image_sign_info helper functions in SPL.
711
712 endif