public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Aneesh V <aneesh@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 3/6] ARM: enable Thumb build
Date: Thu,  8 Mar 2012 22:50:19 +0530	[thread overview]
Message-ID: <1331227222-12419-4-git-send-email-aneesh@ti.com> (raw)
In-Reply-To: <1331227222-12419-1-git-send-email-aneesh@ti.com>

Enable Thumb build and ARM-Thumb interworking based on the new
config flag CONFIG_SYS_THUMB_BUILD

Signed-off-by: Aneesh V <aneesh@ti.com>
---
Changes in v4:
- Use ':=' instead of '+=' when computed make variables
  are involved

Changes in v3:
- None

Changes from V1 to V2:
- None

Changes from RFC to V1:
- Fixed review comments from Tom Rini <trini@ti.com>
---
 README             |    8 ++++++++
 arch/arm/config.mk |   22 +++++++++++++++-------
 2 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 8964672..bdb428e 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..d4fa1f8 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:
-PF_CPPFLAGS_ARM := $(call cc-option,-marm,)
+# 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,) \
+		$(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)
 
-- 
1.7.1

  parent reply	other threads:[~2012-03-08 17:20 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 17:20 [U-Boot] [PATCH v4 0/6] Enable Thumb build for ARM platforms Aneesh V
2012-03-08 17:20 ` [U-Boot] [PATCH v4 1/6] arm: adapt asm/linkage.h from Linux Aneesh V
2012-03-11  2:01   ` Mike Frysinger
2012-03-12  8:11     ` Aneesh V
2012-03-08 17:20 ` [U-Boot] [PATCH v4 2/6] armv7: add appropriate headers for assembly functions Aneesh V
2012-03-11  2:02   ` Mike Frysinger
2012-03-08 17:20 ` Aneesh V [this message]
2012-03-11  2:02   ` [U-Boot] [PATCH v4 3/6] ARM: enable Thumb build Mike Frysinger
2012-03-12  8:20     ` Aneesh V
2012-03-08 17:20 ` [U-Boot] [PATCH v4 4/6] armv7: Use -march=armv7-a and thereby enable Thumb-2 Aneesh V
2012-05-23 15:01   ` Thierry Reding
2012-05-23 15:20     ` Stephen Warren
2012-05-24  6:46       ` Thierry Reding
2012-07-06 23:02   ` Marek Vasut
2012-07-06 23:32     ` Tetsuyuki Kobayashi
2012-07-06 23:43       ` Aneesh V
2012-07-07  7:59         ` Marek Vasut
2012-07-07 10:08           ` Albert ARIBAUD
2012-03-08 17:20 ` [U-Boot] [PATCH v4 5/6] omap4+: Avoid using __attribute__ ((__packed__)) Aneesh V
2012-03-08 17:20 ` [U-Boot] [PATCH v4 6/6] OMAP4: enable Thumb build Aneesh V
2012-03-15 13:25 ` [U-Boot] [PATCH v4 0/6] Enable Thumb build for ARM platforms Aneesh V
2012-03-15 16:29   ` Tom Rini
2012-04-03 22:48   ` Allen Martin
2012-04-03 22:59     ` Måns Rullgård
2012-03-15 20:23 ` Tom Rini
2012-03-15 20:46   ` Wolfgang Denk
2012-03-15 20:54     ` Tom Rini
2012-03-15 21:01       ` Wolfgang Denk
2012-03-15 21:12         ` Tom Rini
2012-03-15 22:21           ` Tom Rini
2012-03-16  7:16             ` Wolfgang Denk
2012-03-16  7:48             ` Sricharan R
2012-03-16 14:36               ` Tom Rini
2012-03-17  7:10                 ` R, Sricharan
2012-03-16 15:27 ` [U-Boot] [PATCH 1/2] tools, config.mk: Add gcc-version.sh, cc-version test from Linux Tom Rini
2012-03-16 15:27 ` [U-Boot] [PATCH 2/2] Makefile: Add a 'checkthumb' rule Tom Rini
2012-03-16 16:07   ` Mike Frysinger
2012-03-16 17:09     ` Tom Rini
2012-03-16 16:34   ` [U-Boot] [PATCH v2] " Tom Rini
2012-03-16 19:40     ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1331227222-12419-4-git-send-email-aneesh@ti.com \
    --to=aneesh@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox