mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-30 18:05:48 +01:00 
			
		
		
		
	This patch adds a small printf() version that supports all basic formats. Its intented to be used in U-Boot SPL versions on platforms with very limited internal RAM sizes. To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This will result in the SPL using this tiny function and the main U-Boot still using the full-blown printf() function. This code was copied from: http://www.sparetimelabs.com/printfrevisited With mostly only coding style related changes so that its checkpatch clean. The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp (Marvell AXP) SPL: Without this patch: 58963 18536 1928 79427 13643 ./spl/u-boot-spl With this patch: 56542 18536 1956 77034 12cea ./spl/u-boot-spl Note: To make it possible to compile tiny-printf.c instead of vsprintf.c when CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are moved from common/console.c into vsprintf.c in this patch. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Tom Rini <trini@konsulko.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
		
			
				
	
	
		
			143 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			143 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| menu "Library routines"
 | |
| 
 | |
| config CC_OPTIMIZE_LIBS_FOR_SPEED
 | |
| 	bool "Optimize libraries for speed"
 | |
| 	help
 | |
| 	  Enabling this option will pass "-O2" to gcc when compiling
 | |
| 	  under "lib" directory.
 | |
| 
 | |
| 	  If unsure, say N.
 | |
| 
 | |
| config HAVE_PRIVATE_LIBGCC
 | |
| 	bool
 | |
| 
 | |
| config USE_PRIVATE_LIBGCC
 | |
| 	bool "Use private libgcc"
 | |
| 	depends on HAVE_PRIVATE_LIBGCC
 | |
| 	help
 | |
| 	  This option allows you to use the built-in libgcc implementation
 | |
| 	  of U-boot instead of the one privided by the compiler.
 | |
| 	  If unsure, say N.
 | |
| 
 | |
| config SYS_HZ
 | |
| 	int
 | |
| 	default 1000
 | |
| 	help
 | |
| 	  The frequency of the timer returned by get_timer().
 | |
| 	  get_timer() must operate in milliseconds and this option must be
 | |
| 	  set to 1000.
 | |
| 
 | |
| config SYS_VSNPRINTF
 | |
| 	bool "Enable safe version of sprintf()"
 | |
| 	help
 | |
| 	  Since sprintf() can overflow its buffer, it is common to use
 | |
| 	  snprintf() instead, which knows the buffer size and can avoid
 | |
| 	  overflow. However, this does increase code size slightly (for
 | |
| 	  Thumb-2, about 420 bytes). Enable this option for safety when
 | |
| 	  using sprintf() with data you do not control.
 | |
| 
 | |
| config USE_TINY_PRINTF
 | |
| 	bool "Enable tiny printf() version"
 | |
| 	help
 | |
| 	  This option enables a tiny, stripped down printf version.
 | |
| 	  This should only be used in space limited environments,
 | |
| 	  like SPL versions with hard memory limits. This version
 | |
| 	  reduces the code size by about 2.5KiB on armv7.
 | |
| 
 | |
| 	  The supported format specifiers are %c, %s, %u/%d and %x.
 | |
| 
 | |
| config REGEX
 | |
| 	bool "Enable regular expression support"
 | |
| 	default y if NET
 | |
| 	help
 | |
| 	  If this variable is defined, U-Boot is linked against the
 | |
| 	  SLRE (Super Light Regular Expression) library, which adds
 | |
| 	  regex support to some commands, for example "env grep" and
 | |
| 	  "setexpr".
 | |
| 
 | |
| config LIB_RAND
 | |
| 	bool "Pseudo-random library support "
 | |
| 	help
 | |
| 	  This library provides pseudo-random number generator functions.
 | |
| 
 | |
| source lib/dhry/Kconfig
 | |
| 
 | |
| source lib/rsa/Kconfig
 | |
| 
 | |
| config TPM
 | |
| 	bool "Trusted Platform Module (TPM) Support"
 | |
| 	depends on DM
 | |
| 	help
 | |
| 	  This enables support for TPMs which can be used to provide security
 | |
| 	  features for your board. The TPM can be connected via LPC or I2C
 | |
| 	  and a sandbox TPM is provided for testing purposes. Use the 'tpm'
 | |
| 	  command to interactive the TPM. Driver model support is provided
 | |
| 	  for the low-level TPM interface, but only one TPM is supported at
 | |
| 	  a time by the TPM library.
 | |
| 
 | |
| menu "Hashing Support"
 | |
| 
 | |
| config SHA1
 | |
| 	bool "Enable SHA1 support"
 | |
| 	help
 | |
| 	  This option enables support of hashing using SHA1 algorithm.
 | |
| 	  The hash is calculated in software.
 | |
| 	  The SHA1 algorithm produces a 160-bit (20-byte) hash value
 | |
| 	  (digest).
 | |
| 
 | |
| config SHA256
 | |
| 	bool "Enable SHA256 support"
 | |
| 	help
 | |
| 	  This option enables support of hashing using SHA256 algorithm.
 | |
| 	  The hash is calculated in software.
 | |
| 	  The SHA256 algorithm produces a 256-bit (32-byte) hash value
 | |
| 	  (digest).
 | |
| 
 | |
| config SHA_HW_ACCEL
 | |
| 	bool "Enable hashing using hardware"
 | |
| 	help
 | |
| 	  This option enables hardware acceleration
 | |
| 	  for SHA1/SHA256 hashing.
 | |
| 	  This affects the 'hash' command and also the
 | |
| 	  hash_lookup_algo() function.
 | |
| 
 | |
| config SHA_PROG_HW_ACCEL
 | |
| 	bool "Enable Progressive hashing support using hardware"
 | |
| 	depends on SHA_HW_ACCEL
 | |
| 	help
 | |
| 	  This option enables hardware-acceleration for
 | |
| 	  SHA1/SHA256 progressive hashing.
 | |
| 	  Data can be streamed in a block at a time and the hashing
 | |
| 	  is performed in hardware.
 | |
| endmenu
 | |
| 
 | |
| menu "Compression Support"
 | |
| 
 | |
| config LZ4
 | |
| 	bool "Enable LZ4 decompression support"
 | |
| 	help
 | |
| 	  If this option is set, support for LZ4 compressed images
 | |
| 	  is included. The LZ4 algorithm can run in-place as long as the
 | |
| 	  compressed image is loaded to the end of the output buffer, and
 | |
| 	  trades lower compression ratios for much faster decompression.
 | |
| 	  
 | |
| 	  NOTE: This implements the release version of the LZ4 frame
 | |
| 	  format as generated by default by the 'lz4' command line tool.
 | |
| 	  This is not the same as the outdated, less efficient legacy
 | |
| 	  frame format currently (2015) implemented in the Linux kernel
 | |
| 	  (generated by 'lz4 -l'). The two formats are incompatible.
 | |
| 
 | |
| endmenu
 | |
| 
 | |
| config ERRNO_STR
 | |
| 	bool "Enable function for getting errno-related string message"
 | |
| 	help
 | |
| 	  The function errno_str(int errno), returns a pointer to the errno
 | |
| 	  corresponding text message:
 | |
| 	  - if errno is null or positive number - a pointer to "Success" message
 | |
| 	  - if errno is negative - a pointer to errno related message
 | |
| 
 | |
| source lib/efi/Kconfig
 | |
| 
 | |
| endmenu
 |