config SW
	bool
	default y
	select AUDIT_ARCH
	select VIRT_IO
	select HAVE_AOUT
	select HAVE_IDE
	select HAVE_OPROFILE
#	select HAVE_SYSCALL_WRAPPERS
	select HAVE_IRQ_WORK
	select HAVE_PCSPKR_PLATFORM
	select HAVE_PERF_EVENTS
	select HAVE_GENERIC_HARDIRQS
	select GENERIC_CLOCKEVENTS
	select GENERIC_IRQ_PROBE
	select GENERIC_IRQ_LEGACY
	select GENERIC_IDLE_LOOP
	select AUTO_IRQ_AFFINITY if SMP
	select GENERIC_IRQ_SHOW
	select ARCH_WANT_IPC_PARSE_VERSION
	select ARCH_HAVE_NMI_SAFE_CMPXCHG
	select ARCH_SUPPORTS_MSI
	select ARCH_MIGHT_HAVE_PC_SERIO
	select ARCH_NO_PREEMPT
	select ARCH_USE_CMPXCHG_LOCKREF
	select GENERIC_SMP_IDLE_THREAD
	select HAVE_MOD_ARCH_SPECIFIC
	select MODULES_USE_ELF_RELA
	select ARCH_SUPPORTS_NUMA_BALANCING
	select ARCH_WANTS_PROT_NUMA_PROT_NONE
	select HAVE_ARCH_TRANSPARENT_HUGEPAGE
	select HAVE_GENERIC_RCU_GUP
	select HAVE_ARCH_AUDITSYSCALL
	select HAVE_ARCH_SECCOMP_FILTER
	select GENERIC_SIGALTSTACK
	select ODD_RT_SIGACTION
	select OLD_SIGSUSPEND
	select GENERIC_STRNCPY_FROM_USER
	select GENERIC_STRNLEN_USER
	select ARCH_HAS_PHYS_TO_DMA
	select DMA_DIRECT_OPS
	select HAVE_MEMBLOCK
	select HAVE_MEMBLOCK_NODE_MAP	if DISCONTIGMEM
	select NO_BOOTMEM
	select ARCH_USE_QUEUED_RWLOCKS
	select ARCH_USE_QUEUED_SPINLOCKS
	select COMMON_CLK
	select HANDLE_DOMAIN_IRQ
	select ARCH_INLINE_READ_LOCK if !PREEMPT
	select ARCH_INLINE_READ_LOCK_BH if !PREEMPT
	select ARCH_INLINE_READ_LOCK_IRQ if !PREEMPT
	select ARCH_INLINE_READ_LOCK_IRQSAVE if !PREEMPT
	select ARCH_INLINE_READ_UNLOCK if !PREEMPT
	select ARCH_INLINE_READ_UNLOCK_BH if !PREEMPT
	select ARCH_INLINE_READ_UNLOCK_IRQ if !PREEMPT
	select ARCH_INLINE_READ_UNLOCK_IRQRESTORE if !PREEMPT
	select ARCH_INLINE_WRITE_LOCK if !PREEMPT
	select ARCH_INLINE_WRITE_LOCK_BH if !PREEMPT
	select ARCH_INLINE_WRITE_LOCK_IRQ if !PREEMPT
	select ARCH_INLINE_WRITE_LOCK_IRQSAVE if !PREEMPT
	select ARCH_INLINE_WRITE_UNLOCK if !PREEMPT
	select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPT
	select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPT
	select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPT
	select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPT
	select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPT
	select ARCH_INLINE_SPIN_LOCK if !PREEMPT
	select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPT
	select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPT
	select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPT
	select ARCH_INLINE_SPIN_UNLOCK if !PREEMPT
	select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPT
	select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPT
	select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPT
	select ARCH_SUPPORTS_ATOMIC_RMW
	select ARCH_HAS_SG_CHAIN
	select IRQ_FORCED_THREADING
	select GENERIC_IRQ_MIGRATION if SMP
	select HAVE_FUNCTION_TRACER
	select HAVE_DYNAMIC_FTRACE
	select HAVE_FTRACE_MCOUNT_RECORD
	select HAVE_C_RECORDMCOUNT
	select HAVE_FUNCTION_GRAPH_TRACER
	select HAVE_KPROBES
	select HAVE_KRETPROBES
	select HAVE_SYSCALL_TRACEPOINTS
	select ARCH_SUPPORTS_UPROBES
	select OF_EARLY_FLATTREE if OF

	help
	  The SW is a 64-bit general-purpose processor designed and
	  marketed by the Digital Equipment Corporation of blessed memory,
	  now Hewlett-Packard.  The SW Linux project has a home page at
	  <http://www.swlinux.org/>.

config 64BIT
	def_bool y

config MMU
	bool
	default y

config PGTABLE_LEVELS
	int
	default 4


config RWSEM_GENERIC_SPINLOCK
	bool

config RWSEM_XCHGADD_ALGORITHM
	bool
	default y

config ARCH_HAS_ILOG2_U32
	bool
	default n

config ARCH_HAS_ILOG2_U64
	bool
	default n

config GENERIC_GPIO
	bool

config ZONE_DMA32
	bool
	default y

config NEED_DMA_MAP_STATE
	def_bool y

config NEED_SG_DMA_LENGTH
	def_bool y

config ARCH_WANT_HUGE_PMD_SHARE
	def_bool y

config GENERIC_ISA_DMA
	bool
	default y

config NONCACHE_PAGE
	bool
	depends on SW
	default y


config AUDIT_ARCH
	bool

choice
	prompt "SW CPU type"
	depends on SW

config  SW6B
	bool "SW6B"
	depends on SW
	select SPARSE_IRQ
	select DCA

config SW6A
	bool "SW6A"
	depends on SW
endchoice

menu "System setup"

choice
	prompt "SW system type"

config PLATFORM_XUELANG
	bool "Xuelang"
	depends on SW6B
	help
	  SW6B board chipset

config PLATFORM_QEMU
	bool "Qemu"
	depends on SW6B
	help
	  Full-system emulation and Virtualization

endchoice

choice
	prompt "SW CHIP type"
	depends on SW

config SW_CHIP3
	bool "SW_CHIP3"

config SW_CHIP2
	bool "SW_CHIP2"

config SW_CHIP_QEMU
	bool "SW_CHIP_QEMU"
	depends on PLATFORM_QEMU
endchoice

choice
	prompt "SW runtime system"
	depends on SW6B
config SW_FPGA
        bool "SW6B FPGA Platform"
        help
          SW FPGA Support

config SW_SIM
	bool "SW6B Hardware Simulator Support"
	help
	  Used for SW Hardware Simulator
config SW_ASIC
	bool "SW6B ASIC CHIP"
	help
	  SW6B asic chipset
endchoice

config SW6B_ASIC_DEBUG
        bool "SW6B_ASIC_DEBUG"
        depends on SW_ASIC
        help
          "Used for debug"

config SW64_WITH_32BIT_STATFS
	bool "64-bit platform with 32-bit statfs"
	default y
	help
	  SW-64 is the only 64-bit platform with 32-bit statfs. And doesn't
	  even seem to implement statfs64

config LOCK_MEMB
	bool "Insert mem barrier before lock instruction"
	default y

config SW6_IRQ_CHIP
	bool "support SW6 irq chipset"
	depends on OF
	select GENERIC_IRQ_CHIP
	select IRQ_DOMAIN
	default y
	help
	  SW6 irq chipset

choice
	prompt "DMA Mapping Type"
	depends on SW && PCI

config DIRECT_DMA
	bool "Direct DMA Mapping"
	depends on SW && PCI

config IOMMU
	bool "Hardware IOMMU"
	depends on SW && PCI
	help
	  SW IOMMU support

config SWIOTLB
	bool "Software IO TLB"
	depends on SW && PCI
	help
	  Software IO TLB

endchoice

config SW_RRU
	bool "Enable rru for debug"
	depends on SW
	default n
	help
	  Enable rru for recording usr stdout and stderr. Do not
	  enable it in a release kernel.

# clear all implied options (don't want default values for those):
# Most of these machines have ISA slots; not exactly sure which don't,
# and this doesn't activate hordes of code, so do it always.
config ISA
	bool
	default y
	help
	  Find out whether you have ISA slots on your motherboard.  ISA is the
	  name of a bus system, i.e. the way the CPU talks to the other stuff
	  inside your box.  Other bus systems are PCI, EISA, MicroChannel
	  (MCA) or VESA.  ISA is an older system, now being displaced by PCI;
	  newer boards don't support it.  If you have ISA, say Y, otherwise N.

config ISA_DMA_API
	bool
	default y

config PCI
	bool "PCI Support"
	depends on SW
	select GENERIC_PCI_IOMAP
	default y
	help
	  Find out whether you have a PCI motherboard. PCI is the name of a
	  bus system, i.e. the way the CPU talks to the other stuff inside
	  your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
	  VESA. If you have PCI, say Y, otherwise N.

config PCI_DOMAINS
	bool
	default y

config PCI_SYSCALL
	def_bool PCI

config IOMMU_HELPER
	def_bool PCI

config PHYSICAL_START
	hex "Physical address where the kernel starts"
	default "0x900000"
	help
	  This gives the physical address where the kernel starts, and it
	  is 0x10000 before _text. If you plan to use kernel for capturing
	  the crash dump change this value to start of the reserved region
	  (the "X" value as specified in the "crashkernel=YM@XM" command
	  line boot parameter passed to the panic-ed kernel).

config KEXEC
	bool "Kexec system call (EXPERIMENTAL)"
	select KEXEC_CORE
	---help---
	  kexec is a system call that implements the ability to shutdown your
	  current kernel, and to start another kernel.  It is like a reboot
	  but it is independent of the system firmware.   And like a reboot
	  you can start any kernel with it, not just Linux.

	  The name comes from the similarity to the exec system call.

	  It is an ongoing process to be certain the hardware in a machine
	  is properly shutdown, so do not be surprised if this code does not
	  initially work for you.  As of this writing the exact hardware
	  interface is strongly in flux, so no good recommendation can be
	  made.

config CRASH_DUMP
	bool "Kernel crash dumps (EXPERIMENTAL)"
	help
	  Generate crash dump after being started by kexec.
	  This should be normally only set in special crash dump kernels
	  which are loaded in the main kernel with kexec-tools into
	  a specially reserved region and then later executed after
	  a crash by kdump/kexec. The crash dump kernel must be compiled
	  to a memory address not used by the main kernel or firmware using
	  PHYSICAL_START.

config SECCOMP
	def_bool y
	prompt "Enable seccomp to safely compute untrusted bytecode"
	---help---
	  This kernel feature is useful for number crunching applications
	  that may need to compute untrusted bytecode during their
	  execution. By using pipes or other transports made available to
	  the process as file descriptors supporting the read/write
	  syscalls, it's possible to isolate those applications in
	  their own address space using seccomp. Once seccomp is
	  enabled via prctl(PR_SET_SECCOMP), it cannot be disabled
	  and the task is only allowed to execute a few safe syscalls
	  defined by each seccomp mode.

	  If unsure, say Y. Only embedded should say N here.

config GENERIC_HWEIGHT
	bool
	default y

config SW_VDSO
	bool "vDSO support"
	depends on SW
	select GENERIC_TIME_VSYSCALL
	---help---
	  This enables support for vDSO.If you want your system to
	  use __vdso_* functions(e.g. __vdso_gettimeofday),say Y.

config LOCK_FIXUP
	bool "fix up the lock"
	depends on SW
	---help---
	  Add an instruction("memb\n") to ensure the correctness of the lock.


config SMP
	bool "Symmetric multi-processing support"
	depends on SW
	select USE_GENERIC_SMP_HELPERS
	---help---
	  This enables support for systems with more than one CPU. If you have
	  a system with only one CPU, like most personal computers, say N. If
	  you have a system with more than one CPU, say Y.

	  If you say N here, the kernel will run on single and multiprocessor
	  machines, but will use only one CPU of a multiprocessor machine. If
	  you say Y here, the kernel will run on many, but not all,
	  singleprocessor machines. On a singleprocessor machine, the kernel
	  will run faster if you say N here.

	  See also the SMP-HOWTO available at
	  <http://www.tldp.org/docs.html#howto>.

	  If you don't know what to do here, say N.

config HAVE_DEC_LOCK
	bool "Use arch-specified dec_and_lock"
	depends on SMP && !NUMA
	default y

config TRACE_IRQFLAGS_SUPPORT
	def_bool y

config ARCH_SUPPORTS_UPROBES
	def_bool y

config NR_CPUS
	int "Maximum number of CPUs (2-256)"
	range 2 256
	depends on SMP
	default "32" if SW6B
	help
	  SW6 support can handle a maximum of 256 CPUs.

config HOTPLUG_CPU
	bool "Support for hot-pluggable CPUs"
	depends on SMP
	---help---
	  Say Y here to allow turning CPUs off and on. CPUs can be
	  controlled through /sys/devices/system/cpu.
	  ( Note: power management support will enable this option
	  automatically on SMP systems. )
	  Say N if you want to disable CPU hotplug.


config ARCH_DISCONTIGMEM_ENABLE
	bool "Discontiguous Memory Support"
	help
	  Say Y to support efficient handling of discontiguous physical memory,
	  for architectures which are either NUMA (Non-Uniform Memory Access)
	  or have huge holes in the physical address space for other reasons.
	  See <file:Documentation/vm/numa> for more.

source "kernel/Kconfig.preempt"


config NUMA
	bool "NUMA Support"
	depends on DISCONTIGMEM
	help
	  Say Y to compile the kernel to support NUMA (Non-Uniform Memory
	  Access).  This option is for configuring high-end multiprocessor
	  server machines.  If in doubt, say N.

config NODES_SHIFT
	int
	default "7"
	depends on NEED_MULTIPLE_NODES

config RELOCATABLE
	bool "Relocatable kernel"
	help
	  This builds a kernel image that retains relocation information
	  so it can be loaded someplace besides the default 1MB.
	  The relocations make the kernel binary about 15% larger,
	  but are discarded at runtime

config RELOCATION_TABLE_SIZE
	hex "Relocation table size"
	depends on RELOCATABLE
	range 0x0 0x01000000
	default "0x80000"
	---help---
	  A table of relocation data will be appended to the kernel binary
	  and parsed at boot to fix up the relocated kernel.

	  This option allows the amount of space reserved for the table to be
	  adjusted, although the default of 1Mb should be ok in most cases.

	  The build will fail and a valid size suggested if this is too small.

	  If unsure, leave at the default value.

config RANDOMIZE_BASE
	bool "Randomize the address of the kernel image"
	depends on RELOCATABLE
	---help---
	  Randomizes the physical and virtual address at which the
	  kernel image is loaded, as a security feature that
	  deters exploit attempts relying on knowledge of the location
	  of kernel internals.

	  Entropy is generated using any coprocessor 0 registers available.

	  The kernel will be offset by up to RANDOMIZE_BASE_MAX_OFFSET.

	  If unsure, say N.

config RANDOMIZE_BASE_MAX_OFFSET
	hex "Maximum kASLR offset" if EXPERT
	depends on RANDOMIZE_BASE
	range 0x0 0x20000000
	default "0x10000000"
	---help---
	  When kASLR is active, this provides the maximum offset that will
	  be applied to the kernel image. It should be set according to the
	  amount of physical RAM available in the target system minus
	  PHYSICAL_START and must be a power of 2.

	  This is limited by the size of KTEXT space, 512Mb. The default is 256MB.


config VERBOSE_MCHECK
	bool "Verbose Machine Checks"

config VERBOSE_MCHECK_ON
	int "Verbose Printing Mode (0=off, 1=on, 2=all)"
	depends on VERBOSE_MCHECK
	default 1
	---help---
	  This option allows the default printing mode to be set, and then
	  possibly overridden by a boot command argument.

	  For example, if one wanted the option of printing verbose
	  machine checks, but wanted the default to be as if verbose
	  machine check printing was turned off, then one would choose
	  the printing mode to be 0. Then, upon reboot, one could add
	  the boot command line "verbose_mcheck=1" to get the normal
	  verbose machine check printing, or "verbose_mcheck=2" to get
	  the maximum information available.

	  Take the default (1) unless you want more control or more info.

config HZ
	int "HZ of the short timer"
	default 500

config SW64_BUILTIN_DTB
	bool "Embed DTB in kernel image"
	depends on OF
	default n
	help
	  Embeds a device tree binary in the kernel image.

config SW64_BUILTIN_DTB_NAME
	string "Built in DTB"
	depends on SW64_BUILTIN_DTB
	help
	  Set the name of the DTB to embed, leave blank to pick one
	  automatically based on kernel configuration.

source "drivers/pci/Kconfig"
source "drivers/eisa/Kconfig"

source "drivers/pcmcia/Kconfig"

source "fs/Kconfig.binfmt"

source "arch/sw_64/lib/Kconfig"

endmenu

menu "Power management options"
source "kernel/power/Kconfig"

config ARCH_SUSPEND_POSSIBLE
	depends on SW
	def_bool y

config ARCH_HIBERNATION_POSSIBLE
	depends on SW
	def_bool y

config SW_64_SUSPEND_DEEPSLEEP_NONBOOT_CORE
	depends on SUSPEND
	bool "SW_64 non bootcore suspend into deep sleep mode"
	default n

config SW_64_SUSPEND_DEEPSLEEP_BOOTCORE
	depends on SUSPEND
	bool "SW_64 bootcore suspend into deep sleep mode"
	default n


source "drivers/cpuidle/Kconfig"

source "drivers/idle/Kconfig"


endmenu


# DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig
# but we also need it if VGA_HOSE is set
config DUMMY_CONSOLE
	bool
	depends on VGA_HOSE
	default y


source "arch/sw_64/kvm/Kconfig"

source "kylin/Kconfig"
