Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3702bba5 authored by Wu Zhangjin's avatar Wu Zhangjin Committed by Ralf Baechle
Browse files

MIPS: Loongson: Add GCC 4.4 support for Loongson2E



Because only gcc >=4.4 have loongson-specific support, we need to choose
the suitable -march argument for gcc <= 4.3 and gcc >= 4.4, and here, we
use -march=loongson2e for loongson2e.

Thanks goes to Arnaud Patard <apatard@mandriva.com> for suggestion of
using cc-options(Documentation/kbuild/makefiles.txt). and thanks Zhang
Le for introducing the new CPU_LOONGSON2E kernel option.

NOTE: -mtune option is not need if -march and -mtune use the same value.

Signed-off-by: default avatarZhang Le <r0bertz@gentoo.org>
Signed-off-by: default avatarWu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 3209e70e
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -1030,12 +1030,10 @@ choice
	prompt "CPU type"
	default CPU_R4X00

config CPU_LOONGSON2
	bool "Loongson 2"
	depends on SYS_HAS_CPU_LOONGSON2
	select CPU_SUPPORTS_32BIT_KERNEL
	select CPU_SUPPORTS_64BIT_KERNEL
	select CPU_SUPPORTS_HIGHMEM
config CPU_LOONGSON2E
	bool "Loongson 2E"
	depends on SYS_HAS_CPU_LOONGSON2E
	select CPU_LOONGSON2
	help
	  The Loongson 2E processor implements the MIPS III instruction set
	  with many extensions.
@@ -1282,7 +1280,13 @@ config CPU_CAVIUM_OCTEON

endchoice

config SYS_HAS_CPU_LOONGSON2
config CPU_LOONGSON2
	bool
	select CPU_SUPPORTS_32BIT_KERNEL
	select CPU_SUPPORTS_64BIT_KERNEL
	select CPU_SUPPORTS_HIGHMEM

config SYS_HAS_CPU_LOONGSON2E
	bool

config SYS_HAS_CPU_MIPS32_R1
+5 −1
Original line number Diff line number Diff line
@@ -120,7 +120,11 @@ cflags-$(CONFIG_CPU_R4300) += -march=r4300 -Wa,--trap
cflags-$(CONFIG_CPU_VR41XX)	+= -march=r4100 -Wa,--trap
cflags-$(CONFIG_CPU_R4X00)	+= -march=r4600 -Wa,--trap
cflags-$(CONFIG_CPU_TX49XX)	+= -march=r4600 -Wa,--trap
cflags-$(CONFIG_CPU_LOONGSON2)	+= -march=r4600 -Wa,--trap
# only gcc >= 4.4 have the loongson-specific support
cflags-$(CONFIG_CPU_LOONGSON2)	+= -Wa,--trap
cflags-$(CONFIG_CPU_LOONGSON2E) += \
	$(call cc-option,-march=loongson2e,-march=r4600)

cflags-$(CONFIG_CPU_MIPS32_R1)	+= $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
			-Wa,-mips32 -Wa,--trap
cflags-$(CONFIG_CPU_MIPS32_R2)	+= $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ config LEMOTE_FULOONG2E
    select ARCH_SPARSEMEM_ENABLE
    select CEVT_R4K
    select CSRC_R4K
    select SYS_HAS_CPU_LOONGSON2
    select SYS_HAS_CPU_LOONGSON2E
    select DMA_NONCOHERENT
    select BOOT_ELF32
    select BOARD_SCACHE