summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig31
-rw-r--r--arch/arm/config.mk8
-rw-r--r--arch/arm/cpu/arm920t/Makefile2
-rw-r--r--arch/arm/cpu/arm926ejs/Makefile2
-rw-r--r--arch/arm/cpu/arm926ejs/cache.c2
-rw-r--r--arch/arm/cpu/armv7/cache_v7_asm.S2
-rw-r--r--arch/arm/cpu/pxa/cache.c2
-rw-r--r--arch/arm/include/asm/assembler.h2
-rw-r--r--arch/arm/include/asm/cache.h2
-rw-r--r--arch/arm/include/asm/setjmp.h2
-rw-r--r--arch/arm/lib/Makefile2
-rw-r--r--arch/arm/lib/cache.c2
-rw-r--r--arch/arm/lib/crt0.S2
-rw-r--r--arch/arm/lib/lib1funcs.S2
-rw-r--r--arch/arm/lib/memcpy.S2
-rw-r--r--arch/arm/lib/memset.S2
-rw-r--r--arch/arm/mach-at91/arm926ejs/Makefile8
-rw-r--r--arch/arm/mach-orion5x/Makefile2
18 files changed, 57 insertions, 20 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7c5012a..d6b0cea 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -181,6 +181,25 @@ config SEMIHOSTING
the hosted environment to call out to the emulator to
retrieve files from the host machine.
+config SYS_THUMB_BUILD
+ bool "Build U-Boot using the Thumb instruction set"
+ depends on !ARM64
+ help
+ 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.
+
+config SPL_SYS_THUMB_BUILD
+ bool "Build SPL using the Thumb instruction set"
+ default y if SYS_THUMB_BUILD
+ depends on !ARM64
+ help
+ Use this flag to build SPL 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.
+
config SYS_L2CACHE_OFF
bool "L2cache off"
help
@@ -571,6 +590,7 @@ config ARCH_KEYSTONE
bool "TI Keystone"
select CPU_V7
select SUPPORT_SPL
+ select SYS_THUMB_BUILD
select CMD_POWEROFF
config ARCH_MESON
@@ -595,6 +615,7 @@ config ARCH_MX6
select SYS_FSL_HAS_SEC if SECURE_BOOT
select SYS_FSL_SEC_COMPAT_4
select SYS_FSL_SEC_LE
+ select SYS_THUMB_BUILD if SPL
config ARCH_MX5
bool "Freescale MX5"
@@ -654,6 +675,7 @@ config OMAP34XX
imply SPL_NAND_SUPPORT
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
+ imply SYS_THUMB_BUILD
config OMAP44XX
bool "OMAP44XX SoC"
@@ -671,11 +693,13 @@ config OMAP44XX
imply SPL_NAND_SUPPORT
imply SPL_POWER_SUPPORT
imply SPL_SERIAL_SUPPORT
+ imply SYS_THUMB_BUILD
config OMAP54XX
bool "OMAP54XX SoC"
select ARCH_OMAP2
select ARM_ERRATA_798870
+ select SYS_THUMB_BUILD
imply SPL_DISPLAY_PRINT
imply SPL_ENV_SUPPORT
imply SPL_EXT_SUPPORT
@@ -693,6 +717,7 @@ config OMAP54XX
config AM43XX
bool "AM43XX SoC"
select ARCH_OMAP2
+ imply SYS_THUMB_BUILD
help
Support for AM43xx SOC from Texas Instruments.
The AM43xx high performance SOC features a Cortex-A9
@@ -703,6 +728,7 @@ config AM43XX
config AM33XX
bool "AM33XX SoC"
select ARCH_OMAP2
+ imply SYS_THUMB_BUILD
help
Support for AM335x SOC from Texas Instruments.
The AM335x high performance SOC features a Cortex-A8
@@ -715,6 +741,7 @@ config ARCH_RMOBILE
select DM
select DM_SERIAL
select BOARD_EARLY_INIT_F
+ imply SYS_THUMB_BUILD
config TARGET_S32V234EVB
bool "Support s32v234evb"
@@ -744,6 +771,7 @@ config ARCH_SOCFPGA
select ARCH_EARLY_INIT_R
select ARCH_MISC_INIT
select SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
+ select SYS_THUMB_BUILD
config TARGET_CM_T43
bool "Support cm_t43"
@@ -766,6 +794,7 @@ config ARCH_SUNXI
select SPL_STACK_R if SUPPORT_SPL
select SPL_SYS_MALLOC_SIMPLE if SUPPORT_SPL
select SYS_NS16550
+ select SPL_SYS_THUMB_BUILD if !ARM64
select USB if DISTRO_DEFAULTS
select USB_STORAGE if DISTRO_DEFAULTS
select USB_KEYBOARD if DISTRO_DEFAULTS
@@ -1095,6 +1124,7 @@ config STM32
select CPU_V7M
select DM
select DM_SERIAL
+ select SYS_THUMB_BUILD
config ARCH_STI
bool "Support STMicrolectronics SoCs"
@@ -1114,6 +1144,7 @@ config ARCH_ROCKCHIP
select DM
select SPL_DM if SPL
select SYS_MALLOC_F
+ select SYS_THUMB_BUILD if !ARM64
select SPL_SYS_MALLOC_SIMPLE if SPL
select DM_GPIO
select DM_I2C
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 3a81f13..08d7d1b 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -31,7 +31,7 @@ PLATFORM_RELFLAGS += $(LLVM_RELFLAGS)
PLATFORM_CPPFLAGS += -D__ARM__
# Choose between ARM/Thumb instruction sets
-ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
+ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
AFLAGS_IMPLICIT_IT := $(call as-option,-Wa$(comma)-mimplicit-it=always)
PF_CPPFLAGS_ARM := $(AFLAGS_IMPLICIT_IT) \
$(call cc-option, -mthumb -mthumb-interwork,\
@@ -44,8 +44,7 @@ PF_CPPFLAGS_ARM := $(call cc-option,-marm,) \
endif
# Only test once
-ifneq ($(CONFIG_SPL_BUILD),y)
-ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
+ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
archprepare: checkthumb
checkthumb:
@@ -57,7 +56,6 @@ checkthumb:
false; \
fi
endif
-endif
# Try if EABI is supported, else fall back to old API,
# i. e. for example:
@@ -99,7 +97,7 @@ LDFLAGS_u-boot += -pie
#
# http://sourceware.org/bugzilla/show_bug.cgi?id=12532
#
-ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
+ifeq ($(CONFIG_$(SPL_)SYS_THUMB_BUILD),y)
ifeq ($(GAS_BUG_12532),)
export GAS_BUG_12532:=$(shell if [ $(call binutils-version) -lt 0222 ] ; \
then echo y; else echo n; fi)
diff --git a/arch/arm/cpu/arm920t/Makefile b/arch/arm/cpu/arm920t/Makefile
index 1832b9d..7aa432a 100644
--- a/arch/arm/cpu/arm920t/Makefile
+++ b/arch/arm/cpu/arm920t/Makefile
@@ -16,6 +16,6 @@ obj-$(CONFIG_S3C24X0) += s3c24x0/
# some files can only build in ARM mode
-ifdef CONFIG_SYS_THUMB_BUILD
+ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
CFLAGS_cpu.o := -marm
endif
diff --git a/arch/arm/cpu/arm926ejs/Makefile b/arch/arm/cpu/arm926ejs/Makefile
index fe78922..0f73011 100644
--- a/arch/arm/cpu/arm926ejs/Makefile
+++ b/arch/arm/cpu/arm926ejs/Makefile
@@ -23,7 +23,7 @@ obj-$(if $(filter spear,$(SOC)),y) += spear/
# some files can only build in ARM or THUMB2, not THUMB1
-ifdef CONFIG_SYS_THUMB_BUILD
+ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
ifndef CONFIG_HAS_THUMB2
CFLAGS_cpu.o := -marm
diff --git a/arch/arm/cpu/arm926ejs/cache.c b/arch/arm/cpu/arm926ejs/cache.c
index 02cb24c..d56e594 100644
--- a/arch/arm/cpu/arm926ejs/cache.c
+++ b/arch/arm/cpu/arm926ejs/cache.c
@@ -63,6 +63,6 @@ void flush_dcache_all(void)
__weak void l2_cache_disable(void) {}
-#if defined CONFIG_SYS_THUMB_BUILD
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
__weak void invalidate_l2_cache(void) {}
#endif
diff --git a/arch/arm/cpu/armv7/cache_v7_asm.S b/arch/arm/cpu/armv7/cache_v7_asm.S
index a433628..bd27ab2 100644
--- a/arch/arm/cpu/armv7/cache_v7_asm.S
+++ b/arch/arm/cpu/armv7/cache_v7_asm.S
@@ -7,7 +7,7 @@
#include <linux/sizes.h>
#include <asm/system.h>
-#ifdef CONFIG_SYS_THUMB_BUILD
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
#define ARM(x...)
#define THUMB(x...) x
#else
diff --git a/arch/arm/cpu/pxa/cache.c b/arch/arm/cpu/pxa/cache.c
index d26354e..30e1e34 100644
--- a/arch/arm/cpu/pxa/cache.c
+++ b/arch/arm/cpu/pxa/cache.c
@@ -52,6 +52,6 @@ void flush_dcache_all(void)
__weak void l2_cache_disable(void) {}
-#if defined CONFIG_SYS_THUMB_BUILD
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
__weak void invalidate_l2_cache(void) {}
#endif
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index d24be2d..b146918 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -77,7 +77,7 @@
* We disable it especially for Thumb builds since those instructions
* are not made in a Thumb ready way...
*/
-#ifdef CONFIG_SYS_THUMB_BUILD
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
#define CALGN(code...)
#else
#define CALGN(code...) code
diff --git a/arch/arm/include/asm/cache.h b/arch/arm/include/asm/cache.h
index 5400cbe..fac65d8 100644
--- a/arch/arm/include/asm/cache.h
+++ b/arch/arm/include/asm/cache.h
@@ -16,7 +16,7 @@
/*
* Invalidate L2 Cache using co-proc instruction
*/
-#ifdef CONFIG_SYS_THUMB_BUILD
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
void invalidate_l2_cache(void);
#else
static inline void invalidate_l2_cache(void)
diff --git a/arch/arm/include/asm/setjmp.h b/arch/arm/include/asm/setjmp.h
index df9934b..c3399a7 100644
--- a/arch/arm/include/asm/setjmp.h
+++ b/arch/arm/include/asm/setjmp.h
@@ -39,7 +39,7 @@ static inline int setjmp(jmp_buf jmp)
"x30", "cc", "memory");
#else
asm volatile(
-#ifdef CONFIG_SYS_THUMB_BUILD
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
".align 2\n"
"adr r0, jmp_target\n"
"add r0, r0, $1\n"
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 166fa9e..b95e105 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -71,7 +71,7 @@ asflags-y += -DCONFIG_ARM_ASM_UNIFIED
# some files can only build in ARM or THUMB2, not THUMB1
-ifdef CONFIG_SYS_THUMB_BUILD
+ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
asflags-$(CONFIG_HAS_THUMB2) += -DCONFIG_THUMB2_KERNEL
ifndef CONFIG_HAS_THUMB2
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index 4f72f89..7683386 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -107,7 +107,7 @@ phys_addr_t noncached_alloc(size_t size, size_t align)
}
#endif /* CONFIG_SYS_NONCACHED_MEMORY */
-#if defined(CONFIG_SYS_THUMB_BUILD)
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
void invalidate_l2_cache(void)
{
unsigned int val = 0;
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 2c4867a..fa81317 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -156,7 +156,7 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */
mov r0, r9 /* gd_t */
ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */
/* call board_init_r */
-#if defined(CONFIG_SYS_THUMB_BUILD)
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD)
ldr lr, =board_init_r /* this is auto-relocated! */
bx lr
#else
diff --git a/arch/arm/lib/lib1funcs.S b/arch/arm/lib/lib1funcs.S
index 76968ce..6e29cbf 100644
--- a/arch/arm/lib/lib1funcs.S
+++ b/arch/arm/lib/lib1funcs.S
@@ -368,7 +368,7 @@ ENDPROC(Ldiv0)
.popsection
/* Thumb-1 specialities */
-#if defined(CONFIG_SYS_THUMB_BUILD) && !defined(CONFIG_HAS_THUMB2)
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD) && !defined(CONFIG_HAS_THUMB2)
.pushsection .text.__gnu_thumb1_case_sqi, "ax"
ENTRY(__gnu_thumb1_case_sqi)
push {r1}
diff --git a/arch/arm/lib/memcpy.S b/arch/arm/lib/memcpy.S
index 00602e9..588b3f8 100644
--- a/arch/arm/lib/memcpy.S
+++ b/arch/arm/lib/memcpy.S
@@ -56,7 +56,7 @@
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
.syntax unified
-#if defined(CONFIG_SYS_THUMB_BUILD) && !defined(MEMCPY_NO_THUMB_BUILD)
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD) && !defined(MEMCPY_NO_THUMB_BUILD)
.thumb
.thumb_func
#endif
diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
index df053a3..cc4cc44 100644
--- a/arch/arm/lib/memset.S
+++ b/arch/arm/lib/memset.S
@@ -16,7 +16,7 @@
.align 5
.syntax unified
-#if defined(CONFIG_SYS_THUMB_BUILD) && !defined(MEMSET_NO_THUMB_BUILD)
+#if CONFIG_IS_ENABLED(SYS_THUMB_BUILD) && !defined(MEMSET_NO_THUMB_BUILD)
.thumb
.thumb_func
#endif
diff --git a/arch/arm/mach-at91/arm926ejs/Makefile b/arch/arm/mach-at91/arm926ejs/Makefile
index d36e15a..624ccd7 100644
--- a/arch/arm/mach-at91/arm926ejs/Makefile
+++ b/arch/arm/mach-at91/arm926ejs/Makefile
@@ -27,3 +27,11 @@ obj-y += timer.o
ifndef CONFIG_SKIP_LOWLEVEL_INIT
obj-y += lowlevel_init.o
endif
+
+ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
+ifndef CONFIG_HAS_THUMB2
+
+CFLAGS_cache.o := -marm
+
+endif
+endif
diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile
index 33dcad4..5249aa8 100644
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -19,7 +19,7 @@ endif
# some files can only build in ARM or THUMB2, not THUMB1
-ifdef CONFIG_SYS_THUMB_BUILD
+ifdef CONFIG_$(SPL_)SYS_THUMB_BUILD
ifndef CONFIG_HAS_THUMB2
CFLAGS_cpu.o := -marm