From patchwork Wed Mar 9 13:16:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Schwierzeck X-Patchwork-Id: 86111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C719AB6FB9 for ; Thu, 10 Mar 2011 00:18:46 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61B81280E2; Wed, 9 Mar 2011 14:18:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q4TWOQpAQwPP; Wed, 9 Mar 2011 14:18:02 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 96C4A280CD; Wed, 9 Mar 2011 14:17:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC27D28082 for ; Wed, 9 Mar 2011 14:17:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Togo0f3TqFU8 for ; Wed, 9 Mar 2011 14:17:39 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 7D1FC280A5 for ; Wed, 9 Mar 2011 14:17:26 +0100 (CET) Received: by mail-bw0-f44.google.com with SMTP id 13so603743bwz.3 for ; Wed, 09 Mar 2011 05:17:26 -0800 (PST) Received: by 10.204.165.193 with SMTP id j1mr5568933bky.11.1299676643047; Wed, 09 Mar 2011 05:17:23 -0800 (PST) Received: from localhost.localdomain (dslb-088-073-208-151.pools.arcor-ip.net [88.73.208.151]) by mx.google.com with ESMTPS id x6sm1289031bkv.12.2011.03.09.05.17.20 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Mar 2011 05:17:22 -0800 (PST) From: daniel.schwierzeck@googlemail.com To: u-boot@lists.denx.de Date: Wed, 9 Mar 2011 14:16:59 +0100 Message-Id: <1299676619-7963-7-git-send-email-daniel.schwierzeck@googlemail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1299676619-7963-1-git-send-email-daniel.schwierzeck@googlemail.com> References: <1299676619-7963-1-git-send-email-daniel.schwierzeck@googlemail.com> Cc: sr@denx.de, Daniel Schwierzeck Subject: [U-Boot] [RFC PATCH 6/6] Mips: Update setting of endianess and CPU optimization flags X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The current Mips CPU config.mk code always expects a Mips 4kc core and toolchain. This is not appropiate for other toolchains and CPUs/SoCs. Replace the current MIPSFLAGS code by cc-option macro and use -march=mips32r2 as default optimization level for all Mips32 CPUs. Replace the endianess determination code from toolchain prefix by a more generic one inspired by the Linux arch/mips/Makefile. Move the -mtune setting to the SoC specific config.mk makefiles. Signed-off-by: Daniel Schwierzeck Cc: Shinya Kuribayashi --- arch/mips/cpu/mips32/au1x00/config.mk | 2 ++ arch/mips/cpu/mips32/config.mk | 21 +++++++-------------- arch/mips/cpu/mips32/incaip/config.mk | 2 ++ arch/mips/cpu/mips32/purple/config.mk | 2 ++ 4 files changed, 13 insertions(+), 14 deletions(-) -- 1.7.4.1 diff --git a/arch/mips/cpu/mips32/au1x00/config.mk b/arch/mips/cpu/mips32/au1x00/config.mk index 3516213..ecfcb9c 100644 --- a/arch/mips/cpu/mips32/au1x00/config.mk +++ b/arch/mips/cpu/mips32/au1x00/config.mk @@ -20,3 +20,5 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # + +PLATFORM_CPPFLAGS += $(call cc-option,-mtune=4kc) diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk index a173c54..a91dcb4 100644 --- a/arch/mips/cpu/mips32/config.mk +++ b/arch/mips/cpu/mips32/config.mk @@ -20,20 +20,13 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2) -MIPSFLAGS:=$(shell \ -if [ "$v" -lt "14" ]; then \ - echo "-mcpu=4kc"; \ -else \ - echo "-march=4kc -mtune=4kc"; \ -fi) -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE))) -ENDIANNESS = -EL -else -ENDIANNESS = -EB -endif +# Optimization flags for all Mips32 CPUs +MIPSFLAGS = $(call cc-option,-march=mips32r2,-mips32r2 -Wa,-mips32r2) -MIPSFLAGS += $(ENDIANNESS) +# Determine endianess from toolchain prefix +ENDIANESS = $(shell $(CC) -dumpmachine | \ + grep -q 'mips.*el-.*' && echo -EL || echo -EB) + +PLATFORM_CPPFLAGS += $(MIPSFLAGS) $(ENDIANESS) -PLATFORM_CPPFLAGS += $(MIPSFLAGS) diff --git a/arch/mips/cpu/mips32/incaip/config.mk b/arch/mips/cpu/mips32/incaip/config.mk index 3516213..ecfcb9c 100644 --- a/arch/mips/cpu/mips32/incaip/config.mk +++ b/arch/mips/cpu/mips32/incaip/config.mk @@ -20,3 +20,5 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # + +PLATFORM_CPPFLAGS += $(call cc-option,-mtune=4kc) diff --git a/arch/mips/cpu/mips32/purple/config.mk b/arch/mips/cpu/mips32/purple/config.mk index 3516213..ecfcb9c 100644 --- a/arch/mips/cpu/mips32/purple/config.mk +++ b/arch/mips/cpu/mips32/purple/config.mk @@ -20,3 +20,5 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # + +PLATFORM_CPPFLAGS += $(call cc-option,-mtune=4kc)