MIPS: Loongson: Add Loongson-3 Kconfig options
authorHuacai Chen <chenhc@lemote.com>
Fri, 21 Mar 2014 10:44:07 +0000 (18:44 +0800)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 31 Mar 2014 16:17:12 +0000 (18:17 +0200)
Added Kconfig options include: Loongson-3 CPU and machine definition,
CPU cache features, UEFI-like firmware interface (LEFI), HT-linked PCI,
and swiotlb support.

Signed-off-by: Huacai Chen <chenhc@lemote.com>
Signed-off-by: Hongliang Tao <taohl@lemote.com>
Signed-off-by: Hua Yan <yanh@lemote.com>
Tested-by: Alex Smith <alex.smith@imgtec.com>
Reviewed-by: Alex Smith <alex.smith@imgtec.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: linux-mips@linux-mips.org
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/6637
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/Kconfig
arch/mips/loongson/Kconfig
arch/mips/loongson/Platform

index 5a95acafcd05aa93ee830691136d06393cd51fe2..a5ea11d8ec4e283ebe053cc461315fb5c74621ab 100644 (file)
@@ -1153,6 +1153,18 @@ choice
        prompt "CPU type"
        default CPU_R4X00
 
+config CPU_LOONGSON3
+       bool "Loongson 3 CPU"
+       depends on SYS_HAS_CPU_LOONGSON3
+       select CPU_SUPPORTS_64BIT_KERNEL
+       select CPU_SUPPORTS_HIGHMEM
+       select CPU_SUPPORTS_HUGEPAGES
+       select WEAK_ORDERING
+       select WEAK_REORDERING_BEYOND_LLSC
+       help
+               The Loongson 3 processor implements the MIPS64R2 instruction
+               set with many extensions.
+
 config CPU_LOONGSON2E
        bool "Loongson 2E"
        depends on SYS_HAS_CPU_LOONGSON2E
@@ -1549,6 +1561,10 @@ config CPU_BMIPS5000
        select SYS_SUPPORTS_SMP
        select SYS_SUPPORTS_HOTPLUG_CPU
 
+config SYS_HAS_CPU_LOONGSON3
+       bool
+       select CPU_SUPPORTS_CPUFREQ
+
 config SYS_HAS_CPU_LOONGSON2E
        bool
 
@@ -1761,7 +1777,7 @@ choice
 
 config PAGE_SIZE_4KB
        bool "4kB"
-       depends on !CPU_LOONGSON2
+       depends on !CPU_LOONGSON2 && !CPU_LOONGSON3
        help
         This option select the standard 4kB Linux page size.  On some
         R3000-family processors this is the only available page size.  Using
@@ -2493,6 +2509,17 @@ config PCI
          your box. Other bus systems are ISA, EISA, or VESA. If you have PCI,
          say Y, otherwise N.
 
+config HT_PCI
+       bool "Support for HT-linked PCI"
+       default y
+       depends on CPU_LOONGSON3
+       select PCI
+       select PCI_DOMAINS
+       help
+         Loongson family machines use Hyper-Transport bus for inter-core
+         connection and device connection. The PCI bus is a subordinate
+         linked at HT. Choose Y for Loongson-3 based machines.
+
 config PCI_DOMAINS
        bool
 
index 263beb9322a8218a79ffef69a9aba244feab9d03..a5d46f5efe03d1dea580e0a94f5862b709813ed4 100644 (file)
@@ -59,6 +59,35 @@ config LEMOTE_MACH2F
 
          These family machines include fuloong2f mini PC, yeeloong2f notebook,
          LingLoong allinone PC and so forth.
+
+config LEMOTE_MACH3A
+       bool "Lemote Loongson 3A 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 HW_HAS_PCI
+       select ISA
+       select HT_PCI
+       select I8259
+       select IRQ_CPU
+       select NR_CPUS_DEFAULT_4
+       select SYS_HAS_CPU_LOONGSON3
+       select SYS_HAS_EARLY_PRINTK
+       select SYS_SUPPORTS_SMP
+       select SYS_SUPPORTS_64BIT_KERNEL
+       select SYS_SUPPORTS_HIGHMEM
+       select SYS_SUPPORTS_LITTLE_ENDIAN
+       select LOONGSON_MC146818
+       select ZONE_DMA32
+       select LEFI_FIRMWARE_INTERFACE
+       help
+               Lemote Loongson 3A family machines utilize the 3A revision of
+               Loongson processor and RS780/SBX00 chipset.
 endchoice
 
 config CS5536
@@ -86,8 +115,25 @@ config LOONGSON_UART_BASE
        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 All-Memory DMA"
+       default y
+       depends on CPU_LOONGSON3
+       select IOMMU_HELPER
+       select NEED_SG_DMA_LENGTH
+       select NEED_DMA_MAP_STATE
+
 config LOONGSON_MC146818
        bool
        default n
 
+config LEFI_FIRMWARE_INTERFACE
+       bool
+
 endif # MACH_LOONGSON
index 29692e5433b19d0d5f00d41bd61f0008242d46eb..6205372b6c2d7c0c4918c9f904c930c41eac9615 100644 (file)
@@ -30,3 +30,4 @@ platform-$(CONFIG_MACH_LOONGSON) += loongson/
 cflags-$(CONFIG_MACH_LOONGSON) += -I$(srctree)/arch/mips/include/asm/mach-loongson -mno-branch-likely
 load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000
 load-$(CONFIG_LEMOTE_MACH2F) += 0xffffffff80200000
+load-$(CONFIG_CPU_LOONGSON3) += 0xffffffff80200000