0001 #
0002 # Loongson Processors' Support
0003 #
0004
0005 cflags-$(CONFIG_CPU_LOONGSON2EF) += -Wa,--trap
0006 cflags-$(CONFIG_CPU_LOONGSON2E) += -march=loongson2e
0007 cflags-$(CONFIG_CPU_LOONGSON2F) += -march=loongson2f
0008 #
0009 # Some versions of binutils, not currently mainline as of 2019/02/04, support
0010 # an -mfix-loongson3-llsc flag which emits a sync prior to each ll instruction
0011 # to work around a CPU bug (see __SYNC_loongson3_war in asm/sync.h for a
0012 # description).
0013 #
0014 # We disable this in order to prevent the assembler meddling with the
0015 # instruction that labels refer to, ie. if we label an ll instruction:
0016 #
0017 # 1: ll v0, 0(a0)
0018 #
0019 # ...then with the assembler fix applied the label may actually point at a sync
0020 # instruction inserted by the assembler, and if we were using the label in an
0021 # exception table the table would no longer contain the address of the ll
0022 # instruction.
0023 #
0024 # Avoid this by explicitly disabling that assembler behaviour. If upstream
0025 # binutils does not merge support for the flag then we can revisit & remove
0026 # this later - for now it ensures vendor toolchains don't cause problems.
0027 #
0028 cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,)
0029
0030 # Enable the workarounds for Loongson2f
0031 ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS
0032 cflags-$(CONFIG_CPU_NOP_WORKAROUNDS) += -Wa,-mfix-loongson2f-nop
0033 cflags-$(CONFIG_CPU_JUMP_WORKAROUNDS) += -Wa,-mfix-loongson2f-jump
0034 endif
0035
0036 # Some -march= flags enable MMI instructions, and GCC complains about that
0037 # support being enabled alongside -msoft-float. Thus explicitly disable MMI.
0038 cflags-y += $(call cc-option,-mno-loongson-mmi)
0039
0040 #
0041 # Loongson Machines' Support
0042 #
0043
0044 cflags-$(CONFIG_MACH_LOONGSON2EF) += -I$(srctree)/arch/mips/include/asm/mach-loongson2ef
0045 cflags-$(CONFIG_CC_HAS_MNO_BRANCH_LIKELY) += -mno-branch-likely
0046 load-$(CONFIG_LEMOTE_FULOONG2E) += 0xffffffff80100000
0047 load-$(CONFIG_LEMOTE_MACH2F) += 0xffffffff80200000