#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#
mainmenu "U-Boot $UBOOTVERSION Configuration"

config UBOOTVERSION
	string
	option env="UBOOTVERSION"

# Allow defaults in arch-specific code to override any given here
source "arch/Kconfig"

menu "General setup"

config LOCALVERSION
	string "Local version - append to U-Boot release"
	help
	  Append an extra string to the end of your U-Boot version.
	  This will show up on your boot log, for example.
	  The string you set here will be appended after the contents of
	  any files with a filename matching localversion* in your
	  object and source tree, in that order.  Your total string can
	  be a maximum of 64 characters.

config LOCALVERSION_AUTO
	bool "Automatically append version information to the version string"
	default y
	help
	  This will try to automatically determine if the current tree is a
	  release tree by looking for git tags that belong to the current
	  top of tree revision.

	  A string of the format -gxxxxxxxx will be added to the localversion
	  if a git-based tree is found.  The string generated by this will be
	  appended after any matching localversion* files, and after the value
	  set in CONFIG_LOCALVERSION.

	  (The actual string used here is the first eight characters produced
	  by running the command:

	    $ git rev-parse --verify HEAD

	  which is done within the script "scripts/setlocalversion".)

config CC_OPTIMIZE_FOR_SIZE
	bool "Optimize for size"
	default y
	help
	  Enabling this option will pass "-Os" instead of "-O2" to gcc
	  resulting in a smaller U-Boot image.

	  This option is enabled by default for U-Boot.

config SYS_MALLOC_F
	bool "Enable malloc() pool before relocation"
	default y if DM
	help
	  Before relocation memory is very limited on many platforms. Still,
	  we can provide a small malloc() pool if needed. Driver model in
	  particular needs this to operate, so that it can allocate the
	  initial serial device and any others that are needed.

config SYS_MALLOC_F_LEN
	hex "Size of malloc() pool before relocation"
	depends on SYS_MALLOC_F
	default 0x400
	help
	  Before relocation memory is very limited on many platforms. Still,
	  we can provide a small malloc() pool if needed. Driver model in
	  particular needs this to operate, so that it can allocate the
	  initial serial device and any others that are needed.

menuconfig EXPERT
	bool "Configure standard U-Boot features (expert users)"
	default y
	help
	  This option allows certain base U-Boot options and settings
	  to be disabled or tweaked. This is for specialized
	  environments which can tolerate a "non-standard" U-Boot.
	  Only use this if you really know what you are doing.

if EXPERT
	config SYS_MALLOC_CLEAR_ON_INIT
	bool "Init with zeros the memory reserved for malloc (slow)"
	default y
	help
	  This setting is enabled by default. The reserved malloc
	  memory is initialized with zeros, so first malloc calls
	  will return the pointer to the zeroed memory. But this
	  slows the boot time.

	  It is recommended to disable it, when CONFIG_SYS_MALLOC_LEN
	  value, has more than few MiB, e.g. when uses bzip2 or bmp logo.
	  Then the boot time can be significantly reduced.
	  Warning:
	  When disabling this, please check if malloc calls, maybe
	  should be replaced by calloc - if expects zeroed memory.
endif
endmenu		# General setup

menu "Boot images"

config SUPPORT_SPL
	bool

config SUPPORT_TPL
	bool

config SPL
	bool
	depends on SUPPORT_SPL
	prompt "Enable SPL"
	help
	  If you want to build SPL as well as the normal image, say Y.

config SPL_STACK_R
	depends on SPL
	bool "Enable SDRAM location for SPL stack"
	help
	  SPL starts off execution in SRAM and thus typically has only a small
	  stack available. Since SPL sets up DRAM while in its board_init_f()
	  function, it is possible for the stack to move there before
	  board_init_r() is reached. This option enables a special SDRAM
	  location for the SPL stack. U-Boot SPL switches to this after
	  board_init_f() completes, and before board_init_r() starts.

config SPL_STACK_R_ADDR
	depends on SPL_STACK_R
	hex "SDRAM location for SPL stack"
	help
	  Specify the address in SDRAM for the SPL stack. This will be set up
	  before board_init_r() is called.

config TPL
	bool
	depends on SPL && SUPPORT_TPL
	prompt "Enable TPL"
	help
	  If you want to build TPL as well as the normal image and SPL, say Y.

config FIT
	bool "Support Flattened Image Tree"
	help
	  This option allows to boot the new uImage structrure,
	  Flattened Image Tree.  FIT is formally a FDT, which can include
	  images of various types (kernel, FDT blob, ramdisk, etc.)
	  in a single blob.  To boot this new uImage structure,
	  pass the address of the blob to the "bootm" command.

config FIT_VERBOSE
	bool "Display verbose messages on FIT boot"
	depends on FIT

config FIT_SIGNATURE
	bool "Enable signature verification of FIT uImages"
	depends on FIT
	depends on DM
	select RSA
	help
	  This option enables signature verification of FIT uImages,
	  using a hash signed and verified using RSA. If
	  CONFIG_SHA_PROG_HW_ACCEL is defined, i.e support for progressive
	  hashing is available using hardware, RSA library will use it.
	  See doc/uImage.FIT/signature.txt for more details.

config SYS_EXTRA_OPTIONS
	string "Extra Options (DEPRECATED)"
	help
	  The old configuration infrastructure (= mkconfig + boards.cfg)
	  provided the extra options field. If you have something like
	  "HAS_BAR,BAZ=64", the optional options
	    #define CONFIG_HAS
	    #define CONFIG_BAZ	64
	  will be defined in include/config.h.
	  This option was prepared for the smooth migration from the old
	  configuration to Kconfig. Since this option will be removed sometime,
	  new boards should not use this option.

config SYS_TEXT_BASE
	depends on SPARC || ARC || X86 || ARCH_UNIPHIER || ARCH_ZYNQMP
	depends on !EFI_APP
	hex "Text Base"
	help
	  TODO: Move CONFIG_SYS_TEXT_BASE for all the architecture

config SYS_CLK_FREQ
	depends on ARC || ARCH_SUNXI
	int "CPU clock frequency"
	help
	  TODO: Move CONFIG_SYS_CLK_FREQ for all the architecture

endmenu		# Boot images

source "common/Kconfig"

source "dts/Kconfig"

source "net/Kconfig"

source "drivers/Kconfig"

source "fs/Kconfig"

source "lib/Kconfig"

source "test/Kconfig"
