summaryrefslogtreecommitdiff
path: root/arch/mips/loongson2ef/Platform
AgeCommit message (Collapse)AuthorFilesLines
2023-08-03MIPS: Loongson: Move arch cflags to MIPS top level MakefileJiaxun Yang1-35/+0
[ Upstream commit 194a835210521282ad31e8f7047556318611f596 ] Arch cflags should be independent to Platform. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Stable-dep-of: 531b3d1195d0 ("MIPS: Loongson: Fix build error when make modules_install") Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-21MIPS: Prefer cc-option for additions to cflagsNathan Chancellor1-1/+1
commit 337ff6bb8960fdc128cabd264aaea3d42ca27a32 upstream. A future change will switch as-option to use KBUILD_AFLAGS instead of KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause issues if the flag being tested requires a flag previously added to KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions so that the flags are tested properly. Signed-off-by: Nathan Chancellor <nathan@kernel.org> Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> Tested-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-07MIPS: Loongson{2ef,64}: Wrap -mno-branch-likely with cc-optionNathan Chancellor1-1/+2
This flag is not supported by clang, which results in a warning: clang-14: warning: argument unused during compilation: '-mno-branch-likely' [-Wunused-command-line-argument] This breaks cc-option, which adds -Werror to make this warning fatal and catch flags that are not supported. Wrap this flag in cc-option so that it does not cause cc-option to fail, which can cause randconfigs to be really noisy, due to warnings not getting disabled that should be. Additionally, move the cc-option check to Kconfig so that the check is done at configuration time, rather than build time, as builds with no configuration change will be quicker because the cc-option call will not need to happen in those instances. Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-12-09MIPS: Loongson2ef: Remove unnecessary {as,cc}-option callsNathan Chancellor1-15/+4
When building with LLVM's integrated assembler, the build errors because it does not implement -mfix-loongson2f-{jump,nop}: arch/mips/loongson2ef/Platform:36: *** only binutils >= 2.20.2 have needed option -mfix-loongson2f-nop. Stop. The error is a little misleading because binutils are not being used in this case. To clear this up, remove the as-option calls because binutils 2.23 is the minimum supported version for building the kernel. At the same time, remove the cc-option calls for the '-march=' flags, as GCC 5.1.0 is the minimum supported version. This change will not fix the LLVM build for CONFIG_CPU_LOONGSON2{E,F}, as it does not implement the loongson2{e,f} march arguments (nor r4600, so it will error prior to this change) nor the assembler flags mentioned above but it will make the errors more obvious. Link: https://github.com/ClangBuiltLinux/linux/issues/1529 Reported-by: Ryutaroh Matsumoto <ryutaroh@ict.e.titech.ac.jp> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2020-09-23MIPS: Loongson2ef: Disable Loongson MMI instructionsJiaxun Yang1-0/+4
It was missed when I was forking Loongson2ef from Loongson64 but should be applied to Loongson2ef as march=loongson2f will also enable Loongson MMI in GCC-9+. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Fixes: 71e2f4dd5a65 ("MIPS: Fork loongson2ef from loongson64") Reported-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: stable@vger.kernel.org # v5.8+ Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2020-06-22MIPS: Loongson-2EF: disable fix-loongson3-llsc in compilerLichao Liu1-0/+22
Firstly, Loongson-2EF support ll/sc instructions, but doesn't need fix-loongson3-llsc compile option. Secondly, fix-loongson3-llsc will cause kernel startup fail at futex_init, because compiler will add 'sync' before 'll', which will affect __ex_table. futex_init will pass NULL uaddr parameter to futex_atomic_cmpxchg_inatomic. futex_atomic_cmpxchg_inatomic will access uaddr directly, which will cause page fault exception, the exception should be handled by __ex_table's nextinsn if the exception insn exsit in __ex_table. Because __ex_table is affected by compiler, the exception can not be handled, and futex_atomic_cmpxchg_inatomic will crash. Error code as below: __ex_table.insn = 1b, which is 'sync' compiled with fix-loongson3-llsc, but the actual exception instrction is ll. So, do_page_fault will not find the correct inst in __ex_table, and can not handle this exception. "1: "user_ll("%1", "%3")" \n" " bne %1, %z4, 3f \n" " .set pop \n" " move $1, %z5 \n" " .set "MIPS_ISA_ARCH_LEVEL" \n" "2: "user_sc("$1", "%2")" \n" " beqz $1, 1b \n" "3: " __SYNC_ELSE(full, loongson3_war, __WEAK_LLSC_MB) "\n" " .insn \n" " .set pop \n" " .section .fixup,\"ax\" \n" "4: li %0, %6 \n" " j 3b \n" " .previous \n" " .section __ex_table,\"a\" \n" " "__UA_ADDR "\t1b, 4b \n" " "__UA_ADDR "\t2b, 4b \n" " .previous Signed-off-by: Lichao Liu <liulichao@loongson.cn> Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2020-05-13MIPS: Only include the platform file neededThomas Bogendoerfer1-1/+0
Instead of including all Platform files, we simply include the needed one and avoid clashes with makefile variables. Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2019-11-02MIPS: Fork loongson2ef from loongson64Jiaxun Yang1-0/+32
As later model of GSx64 family processors including 2-series-soc have similar design with initial loongson3a while loongson2e/f seems less identical, we separate loongson2e/f support code out of mach-loongson64 to make our life easier. This patch contains mostly file moving works. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> [paulburton@kernel.org: Squash in the MAINTAINERS updates] Signed-off-by: Paul Burton <paulburton@kernel.org> Cc: linux-mips@vger.kernel.org Cc: paul.burton@mips.com