#
# 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_SYS_MALLOC_SIMPLE
	bool
	depends on SPL
	prompt "Only use malloc_simple functions in the spl"
	help
	  Say Y here to only use the *_simple malloc functions from
	  malloc_simple.c, rather then using the versions from dlmalloc.c
	  this will make the SPL binary smaller at the cost of more heap
	  usage as the *_simple malloc functions do not re-use free-ed mem.

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 SPL_STACK_R_MALLOC_SIMPLE_LEN
	depends on SPL_STACK_R && SPL_SYS_MALLOC_SIMPLE
	hex "Size of malloc_simple heap after switching to DRAM SPL stack"
	default 0x100000
	help
	  Specify the amount of the stack to use as memory pool for
	  malloc_simple after switching the stack to DRAM. This may be set
	  to give board_init_r() a larger heap then the initial heap in
	  SRAM which is limited to SYS_MALLOC_F_LEN bytes.

config SPL_SEPARATE_BSS
	depends on SPL
	bool "BSS section is in a different memory region from text"
	help
	  Some platforms need a large BSS region in SPL and can provide this
	  because RAM is already set up. In this case BSS can be moved to RAM.
	  This option should then be enabled so that the correct device tree
	  location is used. Normally we put the device tree at the end of BSS
	  but with this option enabled, it goes at _image_binary_end.

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 || \
		(M68K && !TARGET_ASTRO_MCF5373L) || MICROBLAZE
	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"
