if MACH_LOONGSON

choice
	prompt "Machine Type"

config LEMOTE_FULOONG2E
	bool "Lemote Fuloong(2e) mini-PC"
	select ARCH_SPARSEMEM_ENABLE
	select CEVT_R4K
	select CSRC_R4K
	select SYS_HAS_CPU_LOONGSON2E
	select DMA_NONCOHERENT
	select BOOT_ELF32
	select BOARD_SCACHE
	select HW_HAS_PCI
	select I8259
	select ISA
	select IRQ_CPU
	select SYS_SUPPORTS_32BIT_KERNEL
	select SYS_SUPPORTS_64BIT_KERNEL
	select SYS_SUPPORTS_LITTLE_ENDIAN
	select SYS_SUPPORTS_HIGHMEM
	select SYS_HAS_EARLY_PRINTK
	select GENERIC_ISA_DMA_SUPPORT_BROKEN
	select CPU_HAS_WB
	select LOONGSON_MC146818
	help
	  Lemote Fuloong(2e) mini-PC board based on the Chinese Loongson-2E CPU and
	  an FPGA northbridge

	  Lemote Fuloong(2e) mini PC have a VIA686B south bridge.

config LEMOTE_MACH2F
	bool "Lemote Loongson 2F family machines"
	select ARCH_SPARSEMEM_ENABLE
	select BOARD_SCACHE
	select BOOT_ELF32
	select CEVT_R4K if ! MIPS_EXTERNAL_TIMER
	select CPU_HAS_WB
	select CS5536
	select CSRC_R4K if ! MIPS_EXTERNAL_TIMER
	select DMA_NONCOHERENT
	select GENERIC_ISA_DMA_SUPPORT_BROKEN
	select HAVE_CLK
	select HW_HAS_PCI
	select I8259
	select IRQ_CPU
	select ISA
	select SYS_HAS_CPU_LOONGSON2F
	select SYS_HAS_EARLY_PRINTK
	select SYS_SUPPORTS_32BIT_KERNEL
	select SYS_SUPPORTS_64BIT_KERNEL
	select SYS_SUPPORTS_HIGHMEM
	select SYS_SUPPORTS_LITTLE_ENDIAN
	select LOONGSON_MC146818
	help
	  Lemote Loongson 2F family machines utilize the 2F revision of
	  Loongson processor and the AMD CS5536 south bridge.

	  These family machines include fuloong2f mini PC, yeeloong2f notebook,
	  LingLoong allinone PC and so forth.

config LOONGSON_MACH3X
	bool "Generic Loongson 3 family machines"
	select ARCH_SPARSEMEM_ENABLE
	select GENERIC_ISA_DMA_SUPPORT_BROKEN
	select GENERIC_HARDIRQS_NO__DO_IRQ
	select BOOT_ELF32
	select BOARD_SCACHE
	select CSRC_R4K
	select CEVT_R4K
	select CPU_HAS_WB
	select HAVE_CLK
	select HW_HAS_PCI
	select ISA
	select I8259
	select IRQ_CPU
	select SYS_HAS_CPU_LOONGSON3
	select SYS_HAS_EARLY_PRINTK
	select SYS_SUPPORTS_SMP
	select SYS_SUPPORTS_NUMA
	select SYS_SUPPORTS_32BIT_KERNEL
	select SYS_SUPPORTS_64BIT_KERNEL
	select SYS_SUPPORTS_HIGHMEM
	select SYS_SUPPORTS_LITTLE_ENDIAN
	select LOONGSON_MC146818
	select ZONE_DMA32 if 64BIT
	select DMA_MAYBE_COHERENT
	select UEFI_FIRMWARE_INTERFACE
	select PHYS48_TO_HT40
	select USE_OF
	select BUILTIN_DTB
	help
		Generic Loongson 3 family machines utilize the 3A/3B revision
		of Loongson processor and RS780/SBX00 chipset.
endchoice

config PCI_MSI_IRQ_BALANCE
	bool "ht irq stipe4 for pci msi irq balance"
	depends on LOONGSON_MACH3X && PCI_MSI

config CS5536
	bool

config CS5536_MFGPT
	bool "CS5536 MFGPT Timer"
	depends on CS5536
	select MIPS_EXTERNAL_TIMER
	help
	  This option enables the mfgpt0 timer of AMD CS5536.

	  If you want to enable the Loongson2 CPUFreq Driver, Please enable
	  this option at first, otherwise, You will get wrong system time.

	  If unsure, say Yes.

config GS464E_NODE_COUNTER
	bool "Loongson3 Node Counter"
	depends on LOONGSON_MACH3X
	select MIPS_EXTERNAL_TIMER
	help
	  This option enables the node counter of Loongson3A(B)2000/3000.

	  If you want to ease the contension of AMD RS780/SBX0 HPET device space reading,
	  Please enable this option. This option replace HPET CSRC with node counter.

	  If unsure, say No.

config GS464V_STABLE_COUNTER
	bool "Loongson3 Stable Counter"
	depends on LOONGSON_MACH3X
	help
	  This option enables the stable counter of Loongson3A3000_COMP.

	  If you want to enable loongson4k StableCounter Driver,Please enable this option.
	  This option replace node counter with stable counter.

	  If unsure, say No.

menuconfig LOONGSON3_HPET_SUPPORT
	bool "Loongson3 HPET Support"
	depends on LOONGSON_MACH3X

if LOONGSON3_HPET_SUPPORT
config RS780_HPET
	bool "RS780/SBX00 HPET Timer"
	depends on LOONGSON_MACH3X
	select MIPS_EXTERNAL_TIMER
	help
	  This option enables the hpet timer of AMD RS780/SBX00.

	  If you want to enable the Loongson3 CPUFreq Driver, Please enable
	  this option at first, otherwise, You will get wrong system time.

	  If unsure, say Yes.

config LS7A_HPET
	bool "LS7A HPET Timer"
	depends on LOONGSON_MACH3X
	select MIPS_EXTERNAL_TIMER
	help
	  This option enables the hpet timer of LS7A.

	  If you want to enable the Loongson3 CPUFreq Driver, Please enable
	  this option at first, otherwise, You will get wrong system time.

	  If unsure, say Yes.

endif # LOONGSON3_HPET_SUPPORT

config CPU_SUPPORTS_UNCACHED_ACCELERATED
	bool "CPU support uncached accelerated"
	default n
	depends on CPU_LOONGSON3
	help
	  IF set Y ,framebuffer driver will access memory by uncached accelerated which
	  reflected in ioremap and mmap.

config LS7A_MSI_SUPPORT
	bool "LS7A MSI Support"
	depends on LOONGSON_MACH3X
	help
	  This option enables the MSI of LS7A.

	  If unsure, say Yes.

config LOONGSON_UART_BASE
	bool
	default y
	depends on EARLY_PRINTK || SERIAL_8250

config IOMMU_HELPER
	bool

config NEED_SG_DMA_LENGTH
	bool

config SWIOTLB
	bool "Soft IOMMU Support for Big Memory (>4GB)"
	depends on CPU_LOONGSON3
	select IOMMU_HELPER
	select NEED_SG_DMA_LENGTH
	select NEED_DMA_MAP_STATE

config PHYS48_TO_HT40
	bool
	default y if CPU_LOONGSON3

config PHASE_LOCK
	bool "Loongson3 Hierarchical Lock Support"
	default y
	depends on CPU_LOONGSON3
	help
	  Say Y to compile the kernel to support hierarchical lock (PHASE_LOCK).
	  This option improves performance on systems with more than two nodes.

config LOONGSON_MC146818
	bool
	default n

config UEFI_FIRMWARE_INTERFACE
	bool

config HAVE_SETUP_PER_CPU_AREA
	def_bool y

config NEED_PER_CPU_EMBED_FIRST_CHUNK
	def_bool y

config ARCH_HAS_CPU_AUTOPROBE
	def_bool y

config HUGETLB_DIV16
	bool "hugetlb page size div 16"
	depends on PAGE_SIZE_16KB || PAGE_SIZE_64KB
	default n
endif # MACH_LOONGSON
