Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Loongson: Set Loongson32 to MIPS32R1

LS232 (Loonson 2-issue 32-bit, also called GS232 (Godson 2-issue 32-bit))
is the CPU core (microarchitecture) of Loongson 1A/1B/1C.

According to "LS232 用户手册 (LS232 User Manual)", LS232 implements the
MIPS32 Release 1 instruction set, and part of the MIPS32 Release 2
instruction set.

In the manual, LS232 implements all of the MIPS32R2 instruction set
except the FPU instructions, and LS232 also implements 5 FPU
instructions of the MIPS32R2 instruction set: CEIL.L.fmt, CVT.L.fmt,
FLOOR.L.fmt, TRUNC.L.fmt, and ROUND.L.fmt.

But a bug of the DI instruction has been found during tests, the DI
instruction can not disable interrupts in arch_local_irq_disable() with
CONFIG_PREEMPT_NONE=y and CFLAGS='-mno-branch-likely' in some cases.

[paul.burton@mips.com:
- Remove the _MIPS_ISA redefinition to match the change made for the
generic MIPSr1 CPUs by commit 344ebf09949c ("MIPS: Always use
-march=<arch>, not -<arch> shortcuts").]

Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/16155/
Cc: linux-mips@linux-mips.org
Cc: ralf@linux-mips.org

authored by

谢致邦 (XIE Zhibang) and committed by
Paul Burton
968dc5a0 6386889a

+6 -7
+5 -3
arch/mips/Kconfig
··· 1424 1424 select LEDS_GPIO_REGISTER 1425 1425 help 1426 1426 The Loongson 1B is a 32-bit SoC, which implements the MIPS32 1427 - release 2 instruction set. 1427 + Release 1 instruction set and part of the MIPS32 Release 2 1428 + instruction set. 1428 1429 1429 1430 config CPU_LOONGSON1C 1430 1431 bool "Loongson 1C" ··· 1434 1433 select LEDS_GPIO_REGISTER 1435 1434 help 1436 1435 The Loongson 1C is a 32-bit SoC, which implements the MIPS32 1437 - release 2 instruction set. 1436 + Release 1 instruction set and part of the MIPS32 Release 2 1437 + instruction set. 1438 1438 1439 1439 config CPU_MIPS32_R1 1440 1440 bool "MIPS32 Release 1" ··· 1835 1833 config CPU_LOONGSON1 1836 1834 bool 1837 1835 select CPU_MIPS32 1838 - select CPU_MIPSR2 1836 + select CPU_MIPSR1 1839 1837 select CPU_HAS_PREFETCH 1840 1838 select CPU_SUPPORTS_32BIT_KERNEL 1841 1839 select CPU_SUPPORTS_HIGHMEM
+1 -4
arch/mips/loongson32/Platform
··· 1 - cflags-$(CONFIG_CPU_LOONGSON1) += \ 2 - $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ 3 - -Wa,-mips32r2 -Wa,--trap 4 - 1 + cflags-$(CONFIG_CPU_LOONGSON1) += -march=mips32 -Wa,--trap 5 2 platform-$(CONFIG_MACH_LOONGSON32) += loongson32/ 6 3 cflags-$(CONFIG_MACH_LOONGSON32) += -I$(srctree)/arch/mips/include/asm/mach-loongson32 7 4 load-$(CONFIG_LOONGSON1_LS1B) += 0xffffffff80100000