#
# Kernel configuration file
#

menu "L4Linux configuration"

# We're running on top of L4, always true
config L4
	def_bool y
	select IRQ_EDGE_EOI_HANDLER
	select HARDIRQS_SW_RESEND

config L4_OBJ_TREE
	string "L4 tree build directory"
	default "/home/user/l4/obj-config"
	help
	  This path needs to point to an L4 build directory tree.

config L4_STATIC_BUILD
	bool


choice
	prompt "Target architecture"
	default L4_ARCH_X86

	config L4_ARCH_X86
		bool "x86-32/x86-64 architecture"
		select RTC_CLASS
		select IRQ_DOMAIN
		select SPARSE_IRQ
		select IRQ_DOMAIN_HIERARCHY
		select PCI_MSI_IRQ_DOMAIN if PCI_MSI

	config L4_ARCH_ARM
		select GENERIC_ALLOCATOR
		select IRQ_DOMAIN
		select NEED_MACH_MEMORY_H
		select SPARSE_IRQ
		select COMMON_CLK
		select IRQ_DOMAIN_HIERARCHY
		bool "ARM architecture"

	config L4_ARCH_ARM64
		select HAVE_EXIT_THREAD
		select IRQ_DOMAIN
		select SPARSE_IRQ
		bool "ARM64/AARCH64 architecture"
endchoice

config L4_ARCH
	string
	default "x86" if L4_ARCH_X86
	default "arm" if L4_ARCH_ARM
	default "arm64" if L4_ARCH_ARM64

config L4_VMLINUZ_SUFFIX
	string "vmlinuz suffix"
	help
	  Suffix to be appended to the binary name 'vmlinuz' that is
	  generated by the build process.

config USE_OF
	bool "Flattened Device Tree support"
	select OF
	select OF_EARLY_FLATTREE
	help
	  Include support for flattened device tree machine descriptions.

config PHYSICAL_START
	hex
	default 0x0

config L4_LINK_LIBIO_DIRECT
	bool

choice
	prompt "Platform support"
	default L4_PLATFORM_GENERIC
	depends on L4_ARCH_ARM

	config L4_PLATFORM_GENERIC
		bool "Generic"
		select CLKDEV_LOOKUP

	config L4_PLATFORM_REALVIEW
		bool "Realview"
		select CLKDEV_LOOKUP

endchoice


menu "Features"

config L4_ARM_UPAGE_TLS
	bool "Provide TLS register in memory accessible region"
	depends on L4_ARCH_ARM && !SMP
	default y
	help
	  This option makes the kernel provide the TLS register
	  in 0xbffffff0 at the cost of writing it in there on every thread
	  switch. If you do not need the TLS register do not enable this
	  option. Setting the register is still done via the normal way.

config L4_SERVER
	bool "Make Linux be a server"
	help
	  Linux can act as an L4Re server and offer services to other
	  L4Re clients. Enabling this option adds the infrastructure for
	  this, additional options need to be enabled to get specific
	  services.

endmenu

menu "IRQ Handling"

choice
	prompt "IRQ Handling"
	default L4_IRQ_SINGLE
	depends on !L4_VCPU

	config L4_IRQ_SINGLE
	  bool "Use one thread per IRQ"
	  help
	    Use traditional one thread per Interrupt style.

	config L4_IRQ_MULTI
	  bool "Use one thread for all IRQs"
	  help
	    Uses only one IRQ thread to attach to multiple interrupts.

endchoice # IRQ Handling

endmenu # IRQ Handling

menu "Stub drivers"

config L4_EXTERNAL_RTC
	bool "Use the rtc server"
	default y
	depends on L4_ARCH_X86
	depends on RTC_CLASS
	help
	  Use the "rtc" server as the source for the clock. This option has
	  to be enabled for the UX mode.

config L4_VPCI
	bool "Use virtual PCI bus"
	depends on PCI
	help
	  Use (para-)virtual PCI bus to find any devices provided by IO
	  component.

config L4_VBUS
	bool "Bus driver for l4vbus"
	select L4_EVENTS
	help
	  This driver provides a Linux-internal bus for L4's vbus.

config L4_PM_BUTTON
	bool "L4 Power management virtual button events"
	select L4_VBUS
	depends on INPUT
	help
	  This driver handles events on the virtual power, sleep and lid
	  buttons.

config L4_BLK_DRV
	bool "Block driver for FDX"
	select L4_EVENTS
	select GENERIC_ALLOCATOR
	help
	  Build block driver for FDX interface.
	  It does not harm to include this driver, block devices need to be
	  explicitely enabled via "l4bd.add=path[,rw]".

config L4_SERVER_FDX
	bool "File transfer service"
	depends on L4_SERVER
	select SYSFS
	help
	  Shared-memory-based data transfer service FDX.

config L4_BLK_DS_DRV
	tristate "Block driver for dataspaces"
	select DAX
	depends on BLOCK
	help
	  This driver implements block devices which are backed by L4Re
	  dataspaces.

config L4_CHR_DS_DRV
	bool "Character driver for dataspaces"
	help
	  This driver implements a character device which are backed by
	  L4Re dataspaces.

config L4_PLATFORM_HAS_GPIO
	bool

config L4_GPIO_DRV
	bool "GPIO driver"
	depends on L4_PLATFORM_HAS_GPIO
	select ARCH_REQUIRE_GPIOLIB
	help
	  GPIO driver using io for GPIO access.

config L4_SERVER_INPUT
	bool "Input server"
	depends on L4_SERVER
	help
	  This makes Linux be an L4Re::Event server that forwards input
	  events.

config L4_SERVER_FB
	bool "Framebuffer server"
	depends on L4_SERVER && FB
	help
	  This driver makes Linux a framebuffer provider via L4Re::Goos
	  interface. Disable fbcon by adding the parameter 'fbcon=map:1' to
	  L4Linux command line.

comment "Enable Linux framebuffer support for framebuffer driver!"
	depends on !FB

config L4_EVENTS
	bool

config L4_INPUT_DRIVER
	bool "L4Re Input driver"
	select L4_EVENTS
	help
	  Input driver for getting input from L4Re.

config L4_FB_DRIVER
	bool "L4Re Framebuffer driver"
	default y
	select FB_CFB_FILLRECT
	select FB_CFB_COPYAREA
	select FB_CFB_IMAGEBLIT
	select L4_INPUT_DRIVER
	depends on FB
	help
	  Framebuffer driver for L4Re.

config L4_FB_DRIVER_DBG
	bool "Include tuning and statistics for l4fb driver"
	depends on L4_DEBUG_STATS
	depends on L4_FB_DRIVER
	help
	  Allows tuning of some l4fb inner workings.

config L4_FB_DRIVER_XF86IF
	bool #"Support for the X Window System driver"
	depends on L4_FB_DRIVER
	help
	  This enables the compile of support for the X Window System driver
	  for the console.

#config L4_NET_ANKH_DRV
#	bool "Network driver for Ankh"
#	help
#	  Network driver for the Ankh network service.

config L4_NET_L4SHM
	bool "l4shm based network driver"
	select L4_USE_L4SHMC
	help
	  Network driver based on l4shm.

config L4_SERIAL
	bool "Pseudo serial driver for console"
	default y
	select SERIAL_CORE
	select SERIAL_CORE_CONSOLE
	help
	  Serial type driver used for console.

config L4_SERIAL_CONSOLE
	bool "Serial console support"
	default y
	depends on L4_SERIAL
	help
	  If you say Y here, you will be able to use the pseudo serial
	  interface as a system console.

config L4_SERIAL_SHM
	bool "Pseudo serial driver using shared memory"
	default y
	select SERIAL_CORE
	select L4_USE_L4SHMC
	help
	  Serial driver using shared memory.

config L4_TCG_STPM
	bool #"(virtual) TPM support"
	depends on TCG_TPM
	help
	  Support for (virtual) TPMs provided by the L4 service STPM of TUD:OS.

endmenu # stub drivers

menu "Debugging options"

config L4_DEBUG
	bool "Debugging options"
	help
	  Show possible debugging options.

config L4_DEBUG_REGISTER_NAMES
	bool "Register Linux program names in the kernel debugger"
	depends on L4_DEBUG
	help
	  The program names of Linux programs can be registered so that they
	  show up in various debugging aids that are displaying thread
	  information. Note, this requires the "jdb" capability to be passed
	  to L4Linux.

config L4_DEBUG_SEGFAULTS
	bool "Print error information on user program segfaults"
	depends on L4_DEBUG
	select DEBUG_FS
	help
	  When this option is turned on additional information is printed
	  when a program causes a page fault that cannot be resolved (a
	  segmentation fault).

config L4_DEBUG_STATS
	bool "Do some statistics"
	depends on L4_DEBUG
	select DEBUG_FS
	help
	  Statistics.

config L4_DEBUG_TAMED_COUNT_INTERRUPT_DISABLE
	bool "Count interrupt disables"
	depends on L4_DEBUG && !L4_VCPU
	help
	  Counts the interrupts disabled events.

endmenu # debugging options

menu "Advanced options"

config L4_MEMSIZE
	int "Kernel default memory size"
	default 32
	help
	  Default memory size in MByte. Configureable with the usual "mem="
	  kernel parameter.

config L4_VCPU
	def_bool y
	bool "Use vCPU execution model"

config L4_DMAPOOL
	bool "Use separate memory pool for DMA memory"
	depends on L4_ARCH_ARM
	select DMABOUNCE
	help
	  Choose 'N'.

menu "Priority configuration"

config L4_PRIO_SERVER_PROC
	int "L4 priority of the Linux server and processes"
	default 1
	help
	  This value defines the L4 priority of the Linux server and it's
	  user processes.

	  Leave unchanged if unsure.

config L4_PRIO_IDLER
	int "Priority of idler thread"
	default 2
	depends on !L4_VCPU
	help
	  Leave unchanged if unsure.

config L4_PRIO_IRQ_BASE
	int "Start of L4 priorities for IRQs"
	default 3
	help
	  This value defines the base where the IRQ priorities are
	  starting.

	  Leave unchanged if unsure.

config L4_PRIO_TAMER
	int "Priority of tamer thread"
	default 22
	depends on !L4_VCPU
	help
	  Leave unchanged if unsure.

config L4_PRIO_L4ANKH
	int "Priority of l4ankh receive thread"
	default 7
	help
	  Leave unchanged if unsure.

endmenu # priority configuration

config L4_CONFIG_CHECKS
	bool "Configuration sanity checks"
	default y
	help
	  Leave this enabled.
	  
config L4_SAMPLE_MODULE
	tristate "Compile sample module"
	help
	  Enable as module if you want to compile the sample module.

endmenu # advanced

endmenu # l4linux options

config L4_USE_L4SHMC
	bool

# some delimiter (for .config)
comment ""
source "arch/l4/Kconfig.$(LINSRCARCH)"
