From patchwork Thu Feb 23 14:06:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aneesh V X-Patchwork-Id: 142628 X-Patchwork-Delegate: trini@ti.com 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 4ECA5B6EF3 for ; Fri, 24 Feb 2012 01:07:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6C08D2807C; Thu, 23 Feb 2012 15:06:48 +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 0TO+HZ8K-Lgz; Thu, 23 Feb 2012 15:06:48 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CDD7728096; Thu, 23 Feb 2012 15:06:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5316528077 for ; Thu, 23 Feb 2012 15:06:35 +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 u8K1+SCb774o for ; Thu, 23 Feb 2012 15:06:35 +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 na3sys009aog115.obsmtp.com (na3sys009aog115.obsmtp.com [74.125.149.238]) by theia.denx.de (Postfix) with ESMTPS id 8352228080 for ; Thu, 23 Feb 2012 15:06:31 +0100 (CET) Received: from mail-gx0-f182.google.com ([209.85.161.182]) (using TLSv1) by na3sys009aob115.postini.com ([74.125.148.12]) with SMTP ID DSNKT0ZH5XuuqMGfVU1wwHPf5EkbxhFy1Ak4@postini.com; Thu, 23 Feb 2012 06:06:33 PST Received: by mail-gx0-f182.google.com with SMTP id k5so780000ggn.27 for ; Thu, 23 Feb 2012 06:06:29 -0800 (PST) Received-SPF: pass (google.com: domain of aneesh@ti.com designates 10.236.185.197 as permitted sender) client-ip=10.236.185.197; Authentication-Results: mr.google.com; spf=pass (google.com: domain of aneesh@ti.com designates 10.236.185.197 as permitted sender) smtp.mail=aneesh@ti.com Received: from mr.google.com ([10.236.185.197]) by 10.236.185.197 with SMTP id u45mr3039522yhm.6.1330005989925 (num_hops = 1); Thu, 23 Feb 2012 06:06:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.185.197 with SMTP id u45mr2428994yhm.6.1330005989856; Thu, 23 Feb 2012 06:06:29 -0800 (PST) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id b6sm2300783anc.3.2012.02.23.06.06.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Feb 2012 06:06:29 -0800 (PST) From: Aneesh V To: u-boot@lists.denx.de Date: Thu, 23 Feb 2012 19:36:03 +0530 Message-Id: <1330005966-1444-3-git-send-email-aneesh@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1328528248-20872-1-git-send-email-aneesh@ti.com> References: <1328528248-20872-1-git-send-email-aneesh@ti.com> X-Gm-Message-State: ALoCoQl1X0B5lLH2TDG1tCp70cDmXx6vihXmEKHiJiMYvIq5rtbJoZwzq/tZx34qx0Nk7JlrCPkY Subject: [U-Boot] [PATCH v3 3/6] ARM: enable Thumb build X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Enable Thumb build and ARM-Thumb interworking based on the new config flag CONFIG_SYS_THUMB_BUILD Signed-off-by: Aneesh V --- Changes from RFC to V1: - Fixed review comments from Tom Rini Changes from V1 to V2: - None --- README | 8 ++++++++ arch/arm/config.mk | 20 ++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/README b/README index eba6378..1f4e2e8 100644 --- a/README +++ b/README @@ -426,6 +426,14 @@ The following options need to be configured: Select high exception vectors of the ARM core, e.g., do not clear the V bit of the c1 register of CP15. + CONFIG_SYS_THUMB_BUILD + + Use this flag to build U-Boot using the Thumb instruction + set for ARM architectures. Thumb instruction set provides + better code density. For ARM architectures that support + Thumb2 this flag will result in Thumb2 code generated by + GCC. + - Linux Kernel Interface: CONFIG_CLOCKS_IN_MHZ diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 45f9dca..de9aa53 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -33,25 +33,33 @@ endif PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__ -# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: +# Choose between ARM/Thumb instruction sets +ifeq ($(CONFIG_SYS_THUMB_BUILD),y) +PF_CPPFLAGS_ARM := $(call cc-option, -mthumb -mthumb-interwork,\ + $(call cc-option,-marm,)\ + $(call cc-option,-mno-thumb-interwork,)\ + ) +else PF_CPPFLAGS_ARM := $(call cc-option,-marm,) +PF_CPPFLAGS_ARM += $(call cc-option,-mno-thumb-interwork,) +endif # Try if EABI is supported, else fall back to old API, # i. e. for example: # - with ELDK 4.2 (EABI supported), use: -# -mabi=aapcs-linux -mno-thumb-interwork +# -mabi=aapcs-linux # - with ELDK 4.1 (gcc 4.x, no EABI), use: -# -mabi=apcs-gnu -mno-thumb-interwork +# -mabi=apcs-gnu # - with ELDK 3.1 (gcc 3.x), use: -# -mapcs-32 -mno-thumb-interwork +# -mapcs-32 PF_CPPFLAGS_ABI := $(call cc-option,\ - -mabi=aapcs-linux -mno-thumb-interwork,\ + -mabi=aapcs-linux,\ $(call cc-option,\ -mapcs-32,\ $(call cc-option,\ -mabi=apcs-gnu,\ )\ - ) $(call cc-option,-mno-thumb-interwork,)\ + )\ ) PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)