[Top] [All Lists]

[PATCH v4 2/4] Loongson-2F: Enable fixups of the latest binutils

To: Ralf Baechle <>
Subject: [PATCH v4 2/4] Loongson-2F: Enable fixups of the latest binutils
From: Wu Zhangjin <>
Date: Wed, 7 Apr 2010 21:11:52 +0800
Cc:, Wu Zhangjin <>, Zhang Le <>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:in-reply-to:references; bh=ccLDHo8YL/CFeFz74yy3p7YGpPDZlJTgdHodFdiH4PE=; b=OmsIMh2AFStdJkng0GL0rKfZHP77SezpGNWzeDucKMPsLstx3iYIiQfdsvPNvCpBQD NzzjD+sgZ2zqkZi/6DdUY55CItAcoQYj40PRoNpt09VxxeZS61qMH1BWSUPfx/fqdp+C d/OqVvFqqgPd6H5UF7CcEImSHIIay7grdy0Io=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=HFop5Uf1eH8bXIByy+dYnf27TTunFq5lj+VNwWOiZNIFUjakyYTelEzbzQX0eVgUwl jeW9a5R0GcFtkHTd8U8kx+McQ8dzeUVr+KWHUN8dOFs70EAgi7J3kRe5HiavHstE/+ZZ HeQmXnIJAZKGbZg/Deg7ZD8BeEVV+pwe3CvUk=
In-reply-to: <>
In-reply-to: <>
Original-recipient: rfc822;
References: <>
References: <>
From: Wu Zhangjin <>

Changes from old revision:

  o Incorporated with the feedbacks from Ralf and used the options
  introduced from "Loongson: Add CPU_LOONGSON2F_WORKAROUNDS".

As the "Fixups of Loongson2F" patch[1] to binutils have been applied
into binutils 2.20.1. It's time to enable the options provided by the
patch to compile the kernel.

Without these fixups, the system will hang unexpectedly for the bug of

To learn more about these fixups, please refer to the following

[1] "Fixups of Loongson2F" patch for binutils(actually for gas)
[2] Chapter 15 of "Loongson2F User Manual"(Chinese Version)
[3] English Version of the above chapter 15

Signed-off-by: Zhang Le <>
Signed-off-by: Wu Zhangjin <>
 arch/mips/Makefile |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 2f2eac2..14f12bc 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -136,6 +136,19 @@ cflags-$(CONFIG_CPU_LOONGSON2E) += \
        $(call cc-option,-march=loongson2e,-march=r4600)
 cflags-$(CONFIG_CPU_LOONGSON2F) += \
        $(call cc-option,-march=loongson2f,-march=r4600)
+# enable the workarounds for loongson2f
+  ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-nop,),)
+    $(error gcc does not support needed option -mfix-loongson2f-nop)
+  else
+    cflags-$(CONFIG_CPU_NOP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-nop
+  endif
+  ifeq ($(call as-option,-Wa$(comma)-mfix-loongson2f-jump,),)
+    $(error gcc does not support needed option -mfix-loongson2f-jump)
+  else
+    cflags-$(CONFIG_CPU_JUMP_WORKAROUNDS) += -Wa$(comma)-mfix-loongson2f-jump
+  endif
 cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 
                        -Wa,-mips32 -Wa,--trap

<Prev in Thread] Current Thread [Next in Thread>