#
# For a description of the syntax of this configuration file,
# see Documentation/kbuild/kconfig-language.txt.
#

mainmenu "APEX Boot Loader Configuration"

config ARM
	bool
	default y
	help
	  The ARM series is a line of low-power-consumption RISC chip designs
	  licensed by ARM ltd and targeted at embedded applications and
	  handhelds such as the Compaq IPAQ.  ARM-based PCs are no longer
	  manufactured, but  legacy ARM-based PC hardware remains popular in
	  Europe.  There is an ARM Linux project with a web page at
	  <http://www.arm.linux.org.uk/>.


config CPU_ARMV4
	bool

config CPU_ARMV5
	bool

config CPU_ARMV6
	bool

config CPU_XSCALE
	bool

config CPU_ARM7
	bool

config CPU_ARM720T
	bool

config CPU_ARM9
	bool

config CPU_ARM920T
	bool

config CPU_ARM922T
	bool

config CPU_ARM925T
	bool

config CPU_ARM926T
	bool

config CPU_ARM11
	bool

config CPU_ARM1136
	bool


choice
	prompt "ARM Platform"
	default ARCH_LH7952X

config ARCH_LH7952X
	bool "Sharp LH7952X"

config ARCH_LH7A40X
	bool "Sharp LH7A40X"

config ARCH_IXP42X
	bool "Intel IXP42X"

config ARCH_S3C2410
	bool "Samsung S3C2410"

config ARCH_MX3
	bool "Freescale iMX3"

endchoice

config EXPERIMENTAL
	bool "Enable experimental features"
	default n
	help
	  This option grants configuration access to experimental
	  features.  It is best to leave this disabled.

config SMALL
	bool "Make APEX small"
	default n
	help
	  This option helps make APEX as small as possible.  It
	  removes unnecessary strings and selects smallest command and
	  driver implementations when available.  Selecting this
	  option may make APEX difficult for novice users to operate.

config THUMB
	bool "Use Thumb instructions"
	default n
	depends on SMALL=y && EXPERIMENTAL=y
	help
	  This option builds some portions of the loader with thumb
	  instructions, a 16 bit instruction format available in some
	  ARM cores.  This feature is intended to produce a smaller
	  executable for the sake of squeezing more features into a
	  smaller space.
	  
	  This feature is experimental and, frankly unlikely to
	  work.  It's best to leave it disabled unless you are
	  prepared for the worst.

menu "General Setup"

config CROSS_COMPILE
	string "Cross compiler prefix"
	default "/usr/arm-linux/gcc3/arm-linux-" if ARCH_LH7952X
	default "/usr/arm-linux/gcc3/arm-linux-" if ARCH_LH7A40X
	default "/usr/armv5b-softfloat-linux/gcc-3.4.2-glibc-2.3.3/bin/armv5b-softfloat-linux-" if ARCH_IXP42X
	help
	  This option defines a compiler prefix for the building APEX
	  with a cross compiler.  This prefix may also be set with the
	  environment variable CROSS_COMPILE.  The environment
	  variable will override this configuration option.


choice
	prompt "Compiler Optimization"
	default CC_OPTIMIZE_FOR_SIZE

config CC_OPTIMIZE_FOR_SIZE
	bool "Set compiler optimization for smallest code size"
	help
	  This option sets the -Os compiler option.

config CC_OPTIMIZE_FOR_SPEED
	bool "Set compiler optimization for the fastest execution"
	help
	  This option sets the -Os compiler option.

config CC_NO_OPTIMIZATION
	bool "Disable optimization"
	help
	  This option sets the -O0 compiler option.

endchoice

config STARTUP_UART
	bool "Support for UART output during the boot/bootstrap process"
	default n
	help
	  This option is similar to DEBUG_LL in that it initializes a
	  UART as soon as possible and provides functions PUTC and
	  PUTHEX to write to the UART.  It is intended to allow
	  low-level  bootstrap code to communicate with the user in
	  the event that something has gone awry.

config DEBUG_LL
	bool "Low-level debug support"
	default n
	select STARTUP_UART
	help
	  Setting this option enables extra debug code in the bool
	  loader startup.

config SPINNER
	bool "Spinner"
	default y
	depends on SMALL=n
	help
	  Implements a user feedback device for showing progress when
	  APEX is executing long tasks.  Usually, the feedback is
	  limited to a spinning bar on the console.  Target
	  implementations may include custom code, e.g. flashing LEDs

config ATAG
	bool "Build ATAG list for Linux kernel"
	default y
	help
	  It is strongly recommended that ATAG support be included
	  with the boot loader.  Linux kernel version 2.6 requires
	  it.  Including ATAG support will not preclude booting to
	  older kernels.

config MMU
	bool "Enable MMU for APEX"
	default n
	depends on SMALL=n
	help
	  This option enables the MMU while the boot-loader is
	  running.  Doing so may make the loader run faster because
	  the MMU being enabled allows instructions and data to be
	  cacheable and write-buffered.  The MMU is disabled before
	  jumping to the Linux kernel or using the 'go' command.

config FORCE_WRITETHROUGH_DCACHE
	bool "Force write-through caching"
	default n
	depends on MMU
	help
	  If you distrust the write-back cache logic, enable this
	  option to prevent cached sections from being write-buffered
	  as well.  It is usually safe to set this option to 'N'.

config DISABLE_MMU_AT_BOOT
	bool "Disable MMU when APEX boots"
	default y
	help
	  Generally, it isn't necessary to disable the MMU when APEX
	  starts.  It is off when the CPU resets.  However, when
	  bootstrapping from one boot loader into APEX, it may be
	  necessary to disable the MMU because the previous loader
	  fails to do so.  It is safe, and prudent, to leave this
	  feature enabled.

	  Believe it or not, this option is independent of the MMU
	  enable option which activates the MMU for running APEX and
	  disables it before executing the Linux kernel or a loaded 
	  program.

config INTERRUPTS
	bool "Enable interrupt handlers"
	depends on EXPERIMENTAL && !SMALL
	default n
	help
	  This feature is experimental.  Leave it disabled unless you
	  know what you are doing.

config SDRAMBOOT_REPORT
	bool "Report that APEX was executed directly from SDRAM"
	default y
	depends on !SMALL
	help
 	  This option enables a message in the service report that APEX
	  was executed from SDRAM and, therefore, could not initialize
	  SDRAM.  This is purely informational, but is very helpful to
	  users who are new to using APEX.

config STACK_SIZE
	hex "Size of C runtime stack"
	default "0x1000"
	help
	  APEX uses a C runtime stack that can generally be small. A
	  4KiB (0x1000) stack should be adequate.  You may want to
	  reduce the stack size to 2KiB if your system has no SDRAM
	  and you will be running from SRAM.  If you want to know
	  exactly how much stack is being used, enable the STACKLIMIT
	  option.

config STACKLIMIT
	bool "Report how much stack has been used"
	default n
	depends on !SMALL && EXPERIMENTAL
	select CLEAR_STACKS
	help
 	  This option enables a message in the service report
	  describing how much of the stack has been used.  It isn't
	  guaranteed to be correct, but it should be an approximation.

config BOOTSTRAP_MEMTEST
	bool "Perform a memory test during the bootstrap"
	default n
	help
	  This option enables memory tests during initialization, just
	  after SDRAM has been initialized.  Memory tests are
	  suppressed when running from SDRAM.
	  
	  In order for this code to work, the initialize_bootstrap ()
	  function *must* return TRUE when SDRAM has been initialized,
	  signaling that the loader is not already running in SDRAM.

config BOOTSTRAP_MEMTEST_BASE
	hex "Bootstrap Memory Test Base Address"
	depends on BOOTSTRAP_MEMTEST
	help
	  Base address for SDRAM post-initialization memory test.

config BOOTSTRAP_MEMTEST_SIZE
	hex "Bootstrap Memory Test Size"
	default 0x00100000
	depends on BOOTSTRAP_MEMTEST
	help
	  Length of regionfor SDRAM post-initialization memory test.
	  It is best if this is a power of 2.

config BOOTSTRAP_MEMTEST_FULL
	bool "Perform full memory test"
	default n
	depends on BOOTSTRAP_MEMTEST
	help
	  The memory test at least performs a walking data bit test
	  and a walking address bit test.  This option enables a full
	  scan memory test as well.  Given the nature of memory these
	  days, the full test is probably unnecessary.  Most failures
	  occur in manufacturing due to solder shorts or cold solder
	  joints.

	  The full memory test will add a significant interval to the
	  boot of time.  It is disabled by default.

endmenu

source src/mach-lh7952x/Kconfig
source src/mach-lh7a40x/Kconfig
source src/mach-ixp42x/Kconfig
source src/mach-s3c2410/Kconfig
source src/mach-mx3/Kconfig

source src/apex/Kconfig

source src/drivers/Kconfig
source src/drivers-lh/Kconfig

source src/net/Kconfig

menu "Environment"

config ENV
	bool "Enable environment"
	default y
	help
	  This option enable the environment which is, by itself, not
	  very expensive.  This will allow the environment variables
	  to take on the default values and be used in substitutions.
	  In order for the user to be able to change the environment
	  at runtime, set the CONFIG_ENV_OPTION.

	  Also note that the environment isn't explicitly visible from
	  the APEX command without enabling environment commands.

	  Unless you are trying to shrink APEX to it's smallest
	  possible size, it is best to set this option Y.

config ENV_MUTABLE
	bool "Allow runtime changes to the environment"
	depends on ENV
	default y
	help
	  This option enables a runtime, user changeable environment.
	  The target configuration must define a region to hold the
	  environment data.  Without a changeable environment, only
	  the default values will be available.

config ENV_LINK
	bool "Assist user-mode access to the environment"
	depends on ENV && !CONFIG_SMALL
	default y
	help
	  This option puts a marker and a string near the beginning of
	  the APEX image to help user-mode applications find the
	  environment.  See the same program show-apex-env for
	  details.  It is safe to enable this feature even if it won't
	  be used.

config ENV_REGION
	string "Environment region"
	depends on ENV_MUTABLE
	default "nor:128k+64k" if MACH_M7200
	default "nor:128k+64k" if MACH_LPD7A40X
	default "nor:128k+64k" if MACH_LPD79520
	default "nor:128k+64k" if MACH_LNODE80
	default "nor:128k+64k" if (MACH_LPD79524 && NOR_BOOT)
	default "nand:64k+32k" if (MACH_LPD79524 && NAND_BOOT)
	default "nor:128k+64k" if MACH_NSLU2
	default "nor:120k+8k"  if MACH_KEV79524
	help
	  This region stores the user configurable environment.   

config ENV_CHECK_LEN
	int "Count of bytes of environment to scan for preexisting data"
	depends on ENV
	default 1024
	help
	  In order to increase APEX's paranoia about writing to the
	  environment, set this option to the number of bytes to scan
	  in the environment region for preexisting data.  If all
	  bytes are 0xff, the environment is deemed 'empty'.  On the
	  other hand, if IO with the environment is slow, e.g. I2C
	  EEPROM, it is best to set this value to zero since the scan
	  can take a long time and must be performed often.

config VARIATIONS
	bool "Enable environment variations"
	default n
	select ALIASES
	help
	  Variations refer to variable variations that are selected by
	  the special variable 'variation'.  When defined, reference
	  to environment variables or aliases will first be satisfied
	  by the original name with the variation suffix.  If that
	  value is not present, the original name is checked.

	  The motive for this feature is to allow for boot-time
	  selection of alternative operating system parameters.
	  Setting the variation will select every variable that has an
	  available variation defined, 'startup', 'cmdline',
	  'bootaddr', and even driver regions.

config VARIATION_SUFFIX
	string "Default variation suffix"
	depends on VARIATIONS
	default "-alt"
	help
	  This is the variation suffix used for alternative
	  environment variables.  The mechanism for variations doesn't
	  require that there be only one alternative, but this
	  configuration option and the options that allow declaration
	  of other variations should be sufficient.

choice
	prompt "Bootstrap Method"
	depends on USES_NOR_BOOTFLASH\
         || USES_NAND_BOOTFLASH\
	 || USES_COMPANION_EVT1_BOOT\
	 || USES_COMPANION_EVT2_BOOT
	default NOR_BOOT
	help
	  There are many ways in which the system could bootstreap.
	  The most common is NOR flash mapped into the memory space.
	  Other, methods include NAND flash boot, I2C EEPROM booting,
	  and SD/MMC card booting.  NOR is the easiest as the CPU has
	  access to the complete boot loader and the loader can copy
	  itself to RAM once RAM is initialized.  Other methods depend
	  on the CPU to copy a small portion of the loader (or a
	  bootstrap) into SRAM which then perform the rest of the boot
	  process.

config NO_BOOTSTRAP
	bool "No Bootstrap"
	help
	  This option disables any possible specialized bootstrap
	  option and only supports a relocation of the loader from the
	  location where it is running to SDRAM.  This is, in fact,
	  the same as NOR_NOOTFLASH.

config NOR_BOOT
	depends on USES_NOR_BOOTFLASH
	bool "NOR Flash Boot"

config NAND_BOOT
	depends on USES_NAND_BOOTFLASH
	bool "NAND Flash Boot"
	select RELOCATE_NAND
	help
	  Selecting NAND as the bootflash select an APEX relocation
	  routine to one that copies from the NAND.

config COMPANION_EVT1_BOOT
	depends on USES_COMPANION_EVT1_BOOT && DRIVER_LH_MMC
	bool "Companion EVT1 I2C Boot"
	select RELOCATE_COMPANION_EVT1
	help
	  This enables an implementation of the relocate_apex ()
	  function that copies the boot loader from SD/MMC or from I2C
	  EEPROM.
	  
	  It is very important to recognize that the I2C/MMC boot
	  process is limited to a 68KiB loader.  There is 80KiB of
	  SRAM.  4KiB is used to load the first page from I2C at
	  0xb0000000.  There is 4KiB for stack and 4KiB for bootstrap
	  data.  That leaves only 68KiB for the whole loader to be
	  read from MMC and executed from SRAM.

	  This also means that the loader on the SD card does not have
	  to resemble the loader in SRAM in any way.

config COMPANION_EVT2_BOOT
	depends on USES_COMPANION_EVT2_BOOT && DRIVER_LH_MMC
	bool "Companion EVT2 NAND Boot"
	select RELOCATE_COMPANION_EVT2
	select PREINITIALIZATION
	help
	  This enables preinitialization() that copies all of the boot
	  loader from NAND flash to SRAM so that the system can get on
	  it's feet.  The EVT2 NAND flash part only supports reading
	  of 512 bytes from NAND flash in the absence of a stream-read
	  feature in the NAND flash part.

endchoice

comment "   Default Startup"
depends on !ENV_DEFAULT_STARTUP_OVERRIDE

config AUTOBOOT
	bool "Automatically boot operating system"
	depends on ENV
	depends on !ENV_DEFAULT_STARTUP_OVERRIDE
	default n

config AUTOBOOT_DELAY
	int "Autoboot delay"
	depends on AUTOBOOT
	depends on !ENV_DEFAULT_STARTUP_OVERRIDE
	default "50"
	help
	  Tenths of a second that APEX will pause before automatically
	  booting the operating system kernel.

config ENV_STARTUP_KERNEL_COPY
	bool "Copy Linux kernel to RAM at startup" 
	depends on ENV
	depends on !ENV_DEFAULT_STARTUP_OVERRIDE
	default y
	
config ENV_REGION_KERNEL_SWAP
	bool "Endian swap when copying kernel"
	depends on ENV && ENV_STARTUP_KERNEL_COPY
	depends on !ENV_DEFAULT_STARTUP_OVERRIDE
	default n
	help
	  The kernel source is in a different endian format from the
	  system that will use it.  This option performs a byte-swap
	  when copying it. 

config ENV_STARTUP_RAMDISK_COPY
	bool "Copy ramdisk to RAM at startup" 
	depends on ENV && USE_RAMDISK
	depends on !ENV_DEFAULT_STARTUP_OVERRIDE
	default y if MACH_LNODE80
	default y if MACH_M7200
	default y if MACH_NSLU2
	
config ENV_REGION_RAMDISK_SWAP
	bool "Endian swap when copying ramdisk"
	depends on ENV && ENV_STARTUP_RAMDISK_COPY
	depends on !ENV_DEFAULT_STARTUP_OVERRIDE
	default n
	help
	  The ramdis source is in a different endian format from the
	  system that will use it.  This option performs a byte-swap
	  when copying it. 

comment "   Regions"

config ENV_REGION_KERNEL
	string "Source region for kernel"
	depends on ENV
	default "nor:256k+1024k" if MACH_M7200
	default "nor:256k+1024k" if MACH_LNODE80
	default "nor:256k+1536k" if MACH_LPD7A40X || MACH_LPD7952X
	default "nor:0x60010+0xffff0" if MACH_NSLU2
	default "nor:128k+1536k" if MACH_KEV79524
	default "ext2://2/zImage" if MACH_COMPANION
	help
	  Defines the default kernel region.  Typically, APEX copies
	  this region to the $bootaddr boot address. 

config ENV_REGION_KERNEL_ALT_P
	bool "Define alternate kernel region"
	depends on ENV && VARIATIONS
	help
	  Set to define the alternative kernel region.

config ENV_REGION_KERNEL_ALT
	string "Alternative source region for kernel"
	depends on ENV_REGION_KERNEL_ALT_P
	help
	  Defines the alternative kernel region.

config ENV_REGION_RAMDISK
	string "Source region for ramdisk image"
	depends on ENV && USE_RAMDISK
	default "nor:1280k+1536k" if MACH_M7200
	default "nor:1280k+1536k" if MACH_LNODE80
	default "nor:0x160010+0x69fff0" if MACH_NSLU2
	help
	  Defines the ramdisk image region.  Typically, APEX copies
	  this region to the $ramdiskaddr address.

config ENV_REGION_RAMDISK_ALT_P
	bool "Define alternate ramdisk image region"
	depends on ENV && VARIATIONS && USE_RAMDISK
	help
	  Set to define the alternative kernel region.

config ENV_REGION_RAMDISK_ALT
	string "Alternative source region for ramdisk image"
	depends on ENV_REGION_RAMDISK_ALT_P && USE_RAMDISK
	help
	  This is the region of the alternative ramdisk image.

comment "   Overrides"

config ENV_DEFAULT_CMDLINE_OVERRIDE
	bool "Override the target default kernel command line"
	depends on ENV
	default false
	help
	  Set this option so that you can override the target's
	  default command line.  This may be useful if the target
	  console is not available to the user.

config ENV_DEFAULT_CMDLINE
	string "Default kernel command line"
	depends on ENV && ENV_DEFAULT_CMDLINE_OVERRIDE
	help
	  Setting this option will override the default command line
	  for the target.  One of these is used when there is no user
	  defined command line in the environment.  You may want to
	  use this option to set a custom command line when there is
	  not easy access to the console.

config ENV_DEFAULT_CMDLINE_ALT_P
	bool "Define alternate kernel command line"
	depends on ENV && VARIATIONS
	help
	  Set to define the alternative kernel command line.

config ENV_DEFAULT_CMDLINE_ALT
	string "Alternative kernel command line"
	depends on ENV_DEFAULT_CMDLINE_ALT_P

config ENV_DEFAULT_STARTUP_OVERRIDE
	bool "Override the target startup command"
	depends on ENV
	default false

config ENV_DEFAULT_STARTUP
	string "Default startup command"
	depends on ENV && ENV_DEFAULT_STARTUP_OVERRIDE

config ENV_DEFAULT_STARTUP_ALT_P
	bool "Define alternate startup command"
	depends on ENV && VARIATIONS
	help
	  Set to define the alternative startup command.

config ENV_DEFAULT_STARTUP_ALT
	string "Alternative startup command"
	depends on ENV_DEFAULT_STARTUP_ALT_P

endmenu

config USES_NOR_BOOTFLASH
	bool

config USES_NAND_BOOTFLASH
	bool

config USES_COMPANION_EVT1_BOOT
	bool

config RELOCATE_COMPANION_EVT1
	bool

config USES_COMPANION_EVT2_BOOT
	bool

config RELOCATE_COMPANION_EVT2
	bool

config RELOCATE_NAND
	bool

config PREINITIALIZATION
	bool

config BIGENDIAN
	bool

config LITTLEENDIAN
	bool

config ALIGNMENT_TRAP
	bool
	default y
	depends INTERRUPTS

config CLEAR_STACKS
	bool

config ALIASES
	bool
