aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-12-09 14:52:10 -0500
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2013-01-31 15:44:46 -0500
commitbc7dea00a9a0ea385bbc4aed67dfdcf7d8879953 (patch)
tree242257c7c0a016595b672b3151abdf71ec5745a2
parentb849a60e0903b1c5430c3859864554662e127a8d (diff)
ARM: let CPUs not being able to run in ARM mode enter in THUMB mode
Some ARM cores are not capable to run in ARM mode (e.g. Cortex-M3). So obviously these cannot enter the kernel in ARM mode. Make an exception for them and let them enter in THUMB mode. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Message-Id: 1358162123-30113-1-git-send-email-u.kleine-koenig@pengutronix.de Acked-by: Nicolas Pitre <nico@linaro.org>
-rw-r--r--arch/arm/Kconfig3
-rw-r--r--arch/arm/kernel/head-nommu.S8
-rw-r--r--arch/arm/mm/Kconfig9
3 files changed, 17 insertions, 3 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 67874b82a4ed..e04c7793f47e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1656,8 +1656,9 @@ config HZ
1656 default 100 1656 default 100
1657 1657
1658config THUMB2_KERNEL 1658config THUMB2_KERNEL
1659 bool "Compile the kernel in Thumb-2 mode" 1659 bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
1660 depends on CPU_V7 && !CPU_V6 && !CPU_V6K 1660 depends on CPU_V7 && !CPU_V6 && !CPU_V6K
1661 default y if CPU_THUMBONLY
1661 select AEABI 1662 select AEABI
1662 select ARM_ASM_UNIFIED 1663 select ARM_ASM_UNIFIED
1663 select ARM_UNWIND 1664 select ARM_UNWIND
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 2c228a07e58c..6a2e09c952c7 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -32,15 +32,21 @@
32 * numbers for r1. 32 * numbers for r1.
33 * 33 *
34 */ 34 */
35 .arm
36 35
37 __HEAD 36 __HEAD
37
38#ifdef CONFIG_CPU_THUMBONLY
39 .thumb
40ENTRY(stext)
41#else
42 .arm
38ENTRY(stext) 43ENTRY(stext)
39 44
40 THUMB( adr r9, BSYM(1f) ) @ Kernel is always entered in ARM. 45 THUMB( adr r9, BSYM(1f) ) @ Kernel is always entered in ARM.
41 THUMB( bx r9 ) @ If this is a Thumb-2 kernel, 46 THUMB( bx r9 ) @ If this is a Thumb-2 kernel,
42 THUMB( .thumb ) @ switch to Thumb now. 47 THUMB( .thumb ) @ switch to Thumb now.
43 THUMB(1: ) 48 THUMB(1: )
49#endif
44 50
45 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode 51 setmode PSR_F_BIT | PSR_I_BIT | SVC_MODE, r9 @ ensure svc mode
46 @ and irqs disabled 52 @ and irqs disabled
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 3fd629d5a513..8defd638c79e 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -397,6 +397,13 @@ config CPU_V7
397 select CPU_PABRT_V7 397 select CPU_PABRT_V7
398 select CPU_TLB_V7 if MMU 398 select CPU_TLB_V7 if MMU
399 399
400config CPU_THUMBONLY
401 bool
402 # There are no CPUs available with MMU that don't implement an ARM ISA:
403 depends on !MMU
404 help
405 Select this if your CPU doesn't support the 32 bit ARM instructions.
406
400# Figure out what processor architecture version we should be using. 407# Figure out what processor architecture version we should be using.
401# This defines the compiler instruction set which depends on the machine type. 408# This defines the compiler instruction set which depends on the machine type.
402config CPU_32v3 409config CPU_32v3
@@ -608,7 +615,7 @@ config ARCH_DMA_ADDR_T_64BIT
608 bool 615 bool
609 616
610config ARM_THUMB 617config ARM_THUMB
611 bool "Support Thumb user binaries" 618 bool "Support Thumb user binaries" if !CPU_THUMBONLY
612 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || CPU_V7 || CPU_FEROCEON 619 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_V6 || CPU_V6K || CPU_V7 || CPU_FEROCEON
613 default y 620 default y
614 help 621 help