Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
[platform/kernel/u-boot.git] / lib / Kconfig
1 menu "Library routines"
2
3 config ADDR_MAP
4         bool "Enable support for non-identity virtual-physical mappings"
5         help
6           Enables helper code for implementing non-identity virtual-physical
7           memory mappings for 32bit CPUs.
8
9 config SYS_NUM_ADDR_MAP
10         int "Size of the address-map table"
11         depends on ADDR_MAP
12         default 16
13         help
14           Sets the number of entries in the virtual-physical mapping table.
15
16 config BCH
17         bool "Enable Software based BCH ECC"
18         help
19           Enables software based BCH ECC algorithm present in lib/bch.c
20           This is used by SoC platforms which do not have built-in ELM
21           hardware engine required for BCH ECC correction.
22
23 config BINMAN_FDT
24         bool "Allow access to binman information in the device tree"
25         depends on BINMAN && OF_CONTROL
26         default y
27         help
28           This enables U-Boot to access information about binman entries,
29           stored in the device tree in a binman node. Typical uses are to
30           locate entries in the firmware image. See binman.h for the available
31           functionality.
32
33 config CC_OPTIMIZE_LIBS_FOR_SPEED
34         bool "Optimize libraries for speed"
35         help
36           Enabling this option will pass "-O2" to gcc when compiling
37           under "lib" directory.
38
39           If unsure, say N.
40
41 config DYNAMIC_CRC_TABLE
42         bool "Enable Dynamic tables for CRC"
43         help
44           Enable this option to calculate entries for CRC tables at runtime.
45           This can be helpful when reducing the size of the build image
46
47 config HAVE_ARCH_IOMAP
48         bool
49         help
50           Enable this option if architecture provides io{read,write}{8,16,32}
51           I/O accessor functions.
52
53 config HAVE_PRIVATE_LIBGCC
54         bool
55
56 config LIB_UUID
57         bool
58
59 config PRINTF
60         bool
61         default y
62
63 config SPL_PRINTF
64         bool
65         select SPL_SPRINTF
66         select SPL_STRTO if !SPL_USE_TINY_PRINTF
67
68 config TPL_PRINTF
69         bool
70         select TPL_SPRINTF
71         select TPL_STRTO if !TPL_USE_TINY_PRINTF
72
73 config SPRINTF
74         bool
75         default y
76
77 config SPL_SPRINTF
78         bool
79
80 config TPL_SPRINTF
81         bool
82
83 config SSCANF
84         bool
85         default n
86
87 config STRTO
88         bool
89         default y
90
91 config SPL_STRTO
92         bool
93
94 config TPL_STRTO
95         bool
96
97 config IMAGE_SPARSE
98         bool
99
100 config IMAGE_SPARSE_FILLBUF_SIZE
101         hex "Android sparse image CHUNK_TYPE_FILL buffer size"
102         default 0x80000
103         depends on IMAGE_SPARSE
104         help
105           Set the size of the fill buffer used when processing CHUNK_TYPE_FILL
106           chunks.
107
108 config USE_PRIVATE_LIBGCC
109         bool "Use private libgcc"
110         depends on HAVE_PRIVATE_LIBGCC
111         default y if HAVE_PRIVATE_LIBGCC && ((ARM && !ARM64) || MIPS)
112         help
113           This option allows you to use the built-in libgcc implementation
114           of U-Boot instead of the one provided by the compiler.
115           If unsure, say N.
116
117 config SYS_HZ
118         int
119         default 1000
120         help
121           The frequency of the timer returned by get_timer().
122           get_timer() must operate in milliseconds and this option must be
123           set to 1000.
124
125 config SPL_USE_TINY_PRINTF
126         bool "Enable tiny printf() version in SPL"
127         depends on SPL
128         default y
129         help
130           This option enables a tiny, stripped down printf version.
131           This should only be used in space limited environments,
132           like SPL versions with hard memory limits. This version
133           reduces the code size by about 2.5KiB on armv7.
134
135           The supported format specifiers are %c, %s, %u/%d and %x.
136
137 config TPL_USE_TINY_PRINTF
138         bool "Enable tiny printf() version in TPL"
139         depends on TPL
140         default y if SPL_USE_TINY_PRINTF
141         help
142           This option enables a tiny, stripped down printf version.
143           This should only be used in space limited environments,
144           like SPL versions with hard memory limits. This version
145           reduces the code size by about 2.5KiB on armv7.
146
147           The supported format specifiers are %c, %s, %u/%d and %x.
148
149 config PANIC_HANG
150         bool "Do not reset the system on fatal error"
151         help
152           Define this option to stop the system in case of a fatal error,
153           so that you have to reset it manually. This is probably NOT a good
154           idea for an embedded system where you want the system to reboot
155           automatically as fast as possible, but it may be useful during
156           development since you can try to debug the conditions that lead to
157           the situation.
158
159 config REGEX
160         bool "Enable regular expression support"
161         default y if NET
162         help
163           If this variable is defined, U-Boot is linked against the
164           SLRE (Super Light Regular Expression) library, which adds
165           regex support to some commands, for example "env grep" and
166           "setexpr".
167
168 choice
169         prompt "Pseudo-random library support type"
170         depends on NET_RANDOM_ETHADDR || RANDOM_UUID || CMD_UUID || \
171                    RNG_SANDBOX || UT_LIB && AES || FAT_WRITE
172         default LIB_RAND
173         help
174           Select the library to provide pseudo-random number generator
175           functions.  LIB_HW_RAND supports certain hardware engines that
176           provide this functionality.  If in doubt, select LIB_RAND.
177
178 config LIB_RAND
179         bool "Pseudo-random library support"
180
181 config LIB_HW_RAND
182         bool "HW Engine for random library support"
183
184 endchoice
185
186 config SPL_TINY_MEMSET
187         bool "Use a very small memset() in SPL"
188         help
189           The faster memset() is the arch-specific one (if available) enabled
190           by CONFIG_USE_ARCH_MEMSET. If that is not enabled, we can still get
191           better performance by writing a word at a time. But in very
192           size-constrained environments even this may be too big. Enable this
193           option to reduce code size slightly at the cost of some speed.
194
195 config TPL_TINY_MEMSET
196         bool "Use a very small memset() in TPL"
197         help
198           The faster memset() is the arch-specific one (if available) enabled
199           by CONFIG_USE_ARCH_MEMSET. If that is not enabled, we can still get
200           better performance by writing a word at a time. But in very
201           size-constrained environments even this may be too big. Enable this
202           option to reduce code size slightly at the cost of some speed.
203
204 config RBTREE
205         bool
206
207 config BITREVERSE
208         bool "Bit reverse library from Linux"
209
210 config TRACE
211         bool "Support for tracing of function calls and timing"
212         imply CMD_TRACE
213         select TIMER_EARLY
214         help
215           Enables function tracing within U-Boot. This allows recording of call
216           traces including timing information. The command can write data to
217           memory for exporting for analysis (e.g. using bootchart).
218           See doc/README.trace for full details.
219
220 config TRACE_BUFFER_SIZE
221         hex "Size of trace buffer in U-Boot"
222         depends on TRACE
223         default 0x01000000
224         help
225           Sets the size of the trace buffer in U-Boot. This is allocated from
226           memory during relocation. If this buffer is too small, the trace
227           history will be truncated, with later records omitted.
228
229           If early trace is enabled (i.e. before relocation), this buffer must
230           be large enough to include all the data from the early trace buffer as
231           well, since this is copied over to the main buffer during relocation.
232
233           A trace record is emitted for each function call and each record is
234           12 bytes (see struct trace_call). A suggested minimum size is 1MB. If
235           the size is too small then 'trace stats' will show a message saying
236           how many records were dropped due to buffer overflow.
237
238 config TRACE_CALL_DEPTH_LIMIT
239         int "Trace call depth limit"
240         depends on TRACE
241         default 15
242         help
243           Sets the maximum call depth up to which function calls are recorded.
244
245 config TRACE_EARLY
246         bool "Enable tracing before relocation"
247         depends on TRACE
248         help
249           Sometimes it is helpful to trace execution of U-Boot before
250           relocation. This is possible by using a arch-specific, fixed buffer
251           position in memory. Enable this option to start tracing as early as
252           possible after U-Boot starts.
253
254 config TRACE_EARLY_SIZE
255         hex "Size of early trace buffer in U-Boot"
256         depends on TRACE_EARLY
257         default 0x00100000
258         help
259           Sets the size of the early trace buffer in bytes. This is used to hold
260           tracing information before relocation.
261
262 config TRACE_EARLY_CALL_DEPTH_LIMIT
263         int "Early trace call depth limit"
264         depends on TRACE_EARLY
265         default 200
266         help
267           Sets the maximum call depth up to which function calls are recorded
268           during early tracing.
269
270 config TRACE_EARLY_ADDR
271         hex "Address of early trace buffer in U-Boot"
272         depends on TRACE_EARLY
273         default 0x00100000
274         help
275           Sets the address of the early trace buffer in U-Boot. This memory
276           must be accessible before relocation.
277
278           A trace record is emitted for each function call and each record is
279           12 bytes (see struct trace_call). A suggested minimum size is 1MB. If
280           the size is too small then the message which says the amount of early
281           data being coped will the the same as the
282
283 source lib/dhry/Kconfig
284
285 menu "Security support"
286
287 config AES
288         bool "Support the AES algorithm"
289         help
290           This provides a means to encrypt and decrypt data using the AES
291           (Advanced Encryption Standard). This algorithm uses a symetric key
292           and is widely used as a streaming cipher. Different key lengths are
293           supported by the algorithm but only a 128-bit key is supported at
294           present.
295
296 source lib/rsa/Kconfig
297 source lib/crypto/Kconfig
298
299 config TPM
300         bool "Trusted Platform Module (TPM) Support"
301         depends on DM
302         help
303           This enables support for TPMs which can be used to provide security
304           features for your board. The TPM can be connected via LPC or I2C
305           and a sandbox TPM is provided for testing purposes. Use the 'tpm'
306           command to interactive the TPM. Driver model support is provided
307           for the low-level TPM interface, but only one TPM is supported at
308           a time by the TPM library.
309
310 config SPL_TPM
311         bool "Trusted Platform Module (TPM) Support in SPL"
312         depends on SPL_DM
313         help
314           This enables support for TPMs which can be used to provide security
315           features for your board. The TPM can be connected via LPC or I2C
316           and a sandbox TPM is provided for testing purposes. Use the 'tpm'
317           command to interactive the TPM. Driver model support is provided
318           for the low-level TPM interface, but only one TPM is supported at
319           a time by the TPM library.
320
321 config TPL_TPM
322         bool "Trusted Platform Module (TPM) Support in TPL"
323         depends on TPL_DM
324         help
325           This enables support for TPMs which can be used to provide security
326           features for your board. The TPM can be connected via LPC or I2C
327           and a sandbox TPM is provided for testing purposes. Use the 'tpm'
328           command to interactive the TPM. Driver model support is provided
329           for the low-level TPM interface, but only one TPM is supported at
330           a time by the TPM library.
331
332 endmenu
333
334 menu "Android Verified Boot"
335
336 config LIBAVB
337         bool "Android Verified Boot 2.0 support"
338         depends on ANDROID_BOOT_IMAGE
339         default n
340         help
341           This enables support of Android Verified Boot 2.0 which can be used
342           to assure the end user of the integrity of the software running on a
343           device. Introduces such features as boot chain of trust, rollback
344           protection etc.
345
346 endmenu
347
348 menu "Hashing Support"
349
350 config SHA1
351         bool "Enable SHA1 support"
352         help
353           This option enables support of hashing using SHA1 algorithm.
354           The hash is calculated in software.
355           The SHA1 algorithm produces a 160-bit (20-byte) hash value
356           (digest).
357
358 config SHA256
359         bool "Enable SHA256 support"
360         help
361           This option enables support of hashing using SHA256 algorithm.
362           The hash is calculated in software.
363           The SHA256 algorithm produces a 256-bit (32-byte) hash value
364           (digest).
365
366 config SHA512_ALGO
367         bool "Enable SHA512 algorithm"
368         help
369           This option enables support of internal SHA512 algorithm.
370
371 config SHA512
372         bool "Enable SHA512 support"
373         depends on SHA512_ALGO
374         help
375           This option enables support of hashing using SHA512 algorithm.
376           The hash is calculated in software.
377           The SHA512 algorithm produces a 512-bit (64-byte) hash value
378           (digest).
379
380 config SHA384
381         bool "Enable SHA384 support"
382         depends on SHA512_ALGO
383         help
384           This option enables support of hashing using SHA384 algorithm.
385           The hash is calculated in software.
386           The SHA384 algorithm produces a 384-bit (48-byte) hash value
387           (digest).
388
389 config SHA_HW_ACCEL
390         bool "Enable hashing using hardware"
391         help
392           This option enables hardware acceleration
393           for SHA1/SHA256 hashing.
394           This affects the 'hash' command and also the
395           hash_lookup_algo() function.
396
397 config SHA_PROG_HW_ACCEL
398         bool "Enable Progressive hashing support using hardware"
399         depends on SHA_HW_ACCEL
400         help
401           This option enables hardware-acceleration for
402           SHA1/SHA256 progressive hashing.
403           Data can be streamed in a block at a time and the hashing
404           is performed in hardware.
405
406 config MD5
407         bool "Support MD5 algorithm"
408         help
409           This option enables MD5 support. MD5 is an algorithm designed
410           in 1991 that produces a 16-byte digest (or checksum) from its input
411           data. It has a number of vulnerabilities which preclude its use in
412           security applications, but it can be useful for providing a quick
413           checksum of a block of data.
414
415 config SPL_MD5
416         bool "Support MD5 algorithm in SPL"
417         help
418           This option enables MD5 support in SPL. MD5 is an algorithm designed
419           in 1991 that produces a 16-byte digest (or checksum) from its input
420           data. It has a number of vulnerabilities which preclude its use in
421           security applications, but it can be useful for providing a quick
422           checksum of a block of data.
423
424 config CRC32C
425         bool
426
427 config XXHASH
428         bool
429
430 endmenu
431
432 menu "Compression Support"
433
434 config LZ4
435         bool "Enable LZ4 decompression support"
436         help
437           If this option is set, support for LZ4 compressed images
438           is included. The LZ4 algorithm can run in-place as long as the
439           compressed image is loaded to the end of the output buffer, and
440           trades lower compression ratios for much faster decompression.
441           
442           NOTE: This implements the release version of the LZ4 frame
443           format as generated by default by the 'lz4' command line tool.
444           This is not the same as the outdated, less efficient legacy
445           frame format currently (2015) implemented in the Linux kernel
446           (generated by 'lz4 -l'). The two formats are incompatible.
447
448 config LZMA
449         bool "Enable LZMA decompression support"
450         help
451           This enables support for LZMA (Lempel-Ziv-Markov chain algorithm),
452           a dictionary compression algorithm that provides a high compression
453           ratio and fairly fast decompression speed. See also
454           CONFIG_CMD_LZMADEC which provides a decode command.
455
456 config LZO
457         bool "Enable LZO decompression support"
458         help
459           This enables support for LZO compression algorithm.r
460
461 config GZIP
462         bool "Enable gzip decompression support"
463         select ZLIB
464         default y
465         help
466           This enables support for GZIP compression algorithm.
467
468 config ZLIB_UNCOMPRESS
469         bool "Enables zlib's uncompress() functionality"
470         help
471           This enables an extra zlib functionality: the uncompress() function,
472           which decompresses data from a buffer into another, knowing their
473           sizes. Unlike gunzip(), there is no header parsing.
474
475 config GZIP_COMPRESSED
476         bool
477         select ZLIB
478
479 config BZIP2
480         bool "Enable bzip2 decompression support"
481         help
482           This enables support for BZIP2 compression algorithm.
483
484 config ZLIB
485         bool
486         default y
487         help
488           This enables ZLIB compression lib.
489
490 config ZSTD
491         bool "Enable Zstandard decompression support"
492         select XXHASH
493         help
494           This enables Zstandard decompression library.
495
496 config SPL_LZ4
497         bool "Enable LZ4 decompression support in SPL"
498         help
499           This enables support for the LZ4 decompression algorithm in SPL. LZ4
500           is a lossless data compression algorithm that is focused on
501           fast compression and decompression speed. It belongs to the LZ77
502           family of byte-oriented compression schemes.
503
504 config SPL_LZMA
505         bool "Enable LZMA decompression support for SPL build"
506         help
507           This enables support for LZMA compression algorithm for SPL boot.
508
509 config SPL_LZO
510         bool "Enable LZO decompression support in SPL"
511         help
512           This enables support for LZO compression algorithm in the SPL.
513
514 config SPL_GZIP
515         bool "Enable gzip decompression support for SPL build"
516         select SPL_ZLIB
517         help
518           This enables support for GZIP compression altorithm for SPL boot.
519
520 config SPL_ZLIB
521         bool
522         help
523           This enables compression lib for SPL boot.
524
525 config SPL_ZSTD
526         bool "Enable Zstandard decompression support in SPL"
527         select XXHASH
528         help
529           This enables Zstandard decompression library in the SPL.
530
531 endmenu
532
533 config ERRNO_STR
534         bool "Enable function for getting errno-related string message"
535         help
536           The function errno_str(int errno), returns a pointer to the errno
537           corresponding text message:
538           - if errno is null or positive number - a pointer to "Success" message
539           - if errno is negative - a pointer to errno related message
540
541 config HEXDUMP
542         bool "Enable hexdump"
543         help
544           This enables functions for printing dumps of binary data.
545
546 config SPL_HEXDUMP
547         bool "Enable hexdump in SPL"
548         depends on HEXDUMP
549         default y
550         help
551           This enables functions for printing dumps of binary data in
552           SPL.
553
554 config GETOPT
555         bool "Enable getopt"
556         help
557           This enables functions for parsing command-line options.
558
559 config OF_LIBFDT
560         bool "Enable the FDT library"
561         default y if OF_CONTROL
562         help
563           This enables the FDT library (libfdt). It provides functions for
564           accessing binary device tree images in memory, such as adding and
565           removing nodes and properties, scanning through the tree and finding
566           particular compatible nodes. The library operates on a flattened
567           version of the device tree.
568
569 config OF_LIBFDT_ASSUME_MASK
570         hex "Mask of conditions to assume for libfdt"
571         depends on OF_LIBFDT || FIT
572         default 0
573         help
574           Use this to change the assumptions made by libfdt about the
575           device tree it is working with. A value of 0 means that no assumptions
576           are made, and libfdt is able to deal with malicious data. A value of
577           0xff means all assumptions are made and any invalid data may cause
578           unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h
579
580 config OF_LIBFDT_OVERLAY
581         bool "Enable the FDT library overlay support"
582         depends on OF_LIBFDT
583         default y if ARCH_OMAP2PLUS || ARCH_KEYSTONE
584         help
585           This enables the FDT library (libfdt) overlay support.
586
587 config SPL_OF_LIBFDT
588         bool "Enable the FDT library for SPL"
589         default y if SPL_OF_CONTROL
590         help
591           This enables the FDT library (libfdt). It provides functions for
592           accessing binary device tree images in memory, such as adding and
593           removing nodes and properties, scanning through the tree and finding
594           particular compatible nodes. The library operates on a flattened
595           version of the device tree.
596
597 config SPL_OF_LIBFDT_ASSUME_MASK
598         hex "Mask of conditions to assume for libfdt"
599         depends on SPL_OF_LIBFDT || FIT
600         default 0xff
601         help
602           Use this to change the assumptions made by libfdt in SPL about the
603           device tree it is working with. A value of 0 means that no assumptions
604           are made, and libfdt is able to deal with malicious data. A value of
605           0xff means all assumptions are made and any invalid data may cause
606           unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h
607
608 config TPL_OF_LIBFDT
609         bool "Enable the FDT library for TPL"
610         default y if TPL_OF_CONTROL
611         help
612           This enables the FDT library (libfdt). It provides functions for
613           accessing binary device tree images in memory, such as adding and
614           removing nodes and properties, scanning through the tree and finding
615           particular compatible nodes. The library operates on a flattened
616           version of the device tree.
617
618 config TPL_OF_LIBFDT_ASSUME_MASK
619         hex "Mask of conditions to assume for libfdt"
620         depends on TPL_OF_LIBFDT || FIT
621         default 0xff
622         help
623           Use this to change the assumptions made by libfdt in TPL about the
624           device tree it is working with. A value of 0 means that no assumptions
625           are made, and libfdt is able to deal with malicious data. A value of
626           0xff means all assumptions are made and any invalid data may cause
627           unsafe execution. See FDT_ASSUME_PERFECT, etc. in libfdt_internal.h
628
629 config FDT_FIXUP_PARTITIONS
630         bool "overwrite MTD partitions in DTS through defined in 'mtdparts'"
631         depends on OF_LIBFDT
632         depends on CMD_MTDPARTS
633         help
634           Allow overwriting defined partitions in the device tree blob
635           using partition info defined in the 'mtdparts' environment
636           variable.
637
638 menu "System tables"
639         depends on (!EFI && !SYS_COREBOOT) || (ARM && EFI_LOADER)
640
641 config BLOBLIST_TABLES
642         bool "Put tables in a bloblist"
643         depends on X86
644         help
645           Normally tables are placed at address 0xf0000 and can be up to 64KB
646           long. With this option, tables are instead placed in the bloblist
647           with a pointer from 0xf0000. The size can then be larger and the
648           tables can be placed high in memory.
649
650 config GENERATE_SMBIOS_TABLE
651         bool "Generate an SMBIOS (System Management BIOS) table"
652         default y
653         depends on X86 || EFI_LOADER
654         help
655           The System Management BIOS (SMBIOS) specification addresses how
656           motherboard and system vendors present management information about
657           their products in a standard format by extending the BIOS interface
658           on Intel architecture systems.
659
660           Check http://www.dmtf.org/standards/smbios for details.
661
662           See also SMBIOS_SYSINFO which allows SMBIOS values to be provided in
663           the devicetree.
664
665 endmenu
666
667 config ASN1_COMPILER
668         bool
669
670 config ASN1_DECODER
671         bool
672         help
673           Enable asn1 decoder library.
674
675 config OID_REGISTRY
676         bool
677         help
678           Enable fast lookup object identifier registry.
679
680 config SMBIOS_PARSER
681         bool "SMBIOS parser"
682         help
683           A simple parser for SMBIOS data.
684
685 source lib/efi/Kconfig
686 source lib/efi_loader/Kconfig
687 source lib/optee/Kconfig
688
689 config TEST_FDTDEC
690         bool "enable fdtdec test"
691         depends on OF_LIBFDT
692
693 config LIB_DATE
694         bool
695
696 config LIB_ELF
697         bool
698         help
699           Support basic elf loading/validating functions.
700           This supports for 32 bit and 64 bit versions.
701
702 endmenu
703
704 config PHANDLE_CHECK_SEQ
705         bool "Enable phandle check while getting sequence number"
706         default n
707         help
708           When there are multiple device tree nodes with same name,
709           enable this config option to distinguish them using
710           phandles in fdtdec_get_alias_seq() function.