* [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel
@ 2013-07-10 1:56 Tetsuyuki Kobayashi
2013-07-10 1:56 ` [PATCH 1/3] ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y Tetsuyuki Kobayashi
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Tetsuyuki Kobayashi @ 2013-07-10 1:56 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
I try to build SMP kernel for KZM-A9-GT board in CONFIG_THUMB2_KERNEL=y.
After some modification it successully boots in Thumb2 kernel.
In my case, Thumb2 kernel is 23% smaller than usual ARM kernel.
text data bss dec hex filename
4763561 251580 196164 5211305 4f84a9 out.kzm9g/vmlinux
text data bss dec hex filename
3595265 251668 196164 4043097 3db159 out.kzm9g_thumb/vmlinux
Useful info for Thumb2 kernel
https://wiki.linaro.org/WorkingGroups/KernelArchived/Thumb2Guide
This patch set is based on arm-soc git repositry,
remotes/origin/renesas/soc-cleanup branch
53332005bfde9d2e3c9a66030c0e8c2598eaa1d5 ARM: shmobile: Remove Bonito board support
Tetsuyuki Kobayashi (3):
ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y
ARM: shmobile: Force ARM mode to compile reset vector for secondary
CPUs
ARM: shmobile: Insert align directives before 4 bytes data
arch/arm/mach-shmobile/headsmp-scu.S | 4 +++-
arch/arm/mach-shmobile/headsmp.S | 6 +++++-
arch/arm/mach-shmobile/sleep-sh7372.S | 2 ++
3 files changed, 10 insertions(+), 2 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y
2013-07-10 1:56 [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Tetsuyuki Kobayashi
@ 2013-07-10 1:56 ` Tetsuyuki Kobayashi
2013-07-10 13:20 ` Simon Horman
2013-07-10 1:56 ` [PATCH 2/3] ARM: shmobile: Force ARM mode to compile reset vector for secondary CPUs Tetsuyuki Kobayashi
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Tetsuyuki Kobayashi @ 2013-07-10 1:56 UTC (permalink / raw)
To: linux-arm-kernel
On KZM-A9-GT board (SMP), when CONFIG_THUMB2_KERNEL=y it fails to compile
AS arch/arm/mach-shmobile/headsmp-scu.o
/proj/koba/kernel/arm-soc/arch/arm/mach-shmobile/headsmp-scu.S: Assembler messages:
/proj/koba/kernel/arm-soc/arch/arm/mach-shmobile/headsmp-scu.S:41: Error: shift must be constant -- `bic r2,r2,r3,lsl r1'
make[2]: *** [arch/arm/mach-shmobile/headsmp-scu.o] Error 1
make[1]: *** [arch/arm/mach-shmobile] Error 2
make: *** [sub-make] Error 2
Instruction `bic r2,r2,r3,lsl r1' is not supported in thumb mode. This patch split it into 2 instructions.
Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
arch/arm/mach-shmobile/headsmp-scu.S | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/headsmp-scu.S b/arch/arm/mach-shmobile/headsmp-scu.S
index 6f98654..5ce416c 100644
--- a/arch/arm/mach-shmobile/headsmp-scu.S
+++ b/arch/arm/mach-shmobile/headsmp-scu.S
@@ -38,7 +38,8 @@ ENTRY(shmobile_boot_scu)
lsl r1, r1, #3 @ we will shift by cpu_id * 8 bits
ldr r2, [r0, #8] @ SCU Power Status Register
mov r3, #3
- bic r2, r2, r3, lsl r1 @ Clear bits of our CPU (Run Mode)
+ lsl r3, r3, r1
+ bic r2, r2, r3 @ Clear bits of our CPU (Run Mode)
str r2, [r0, #8] @ write back
b shmobile_invalidate_start
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] ARM: shmobile: Force ARM mode to compile reset vector for secondary CPUs
2013-07-10 1:56 [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Tetsuyuki Kobayashi
2013-07-10 1:56 ` [PATCH 1/3] ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y Tetsuyuki Kobayashi
@ 2013-07-10 1:56 ` Tetsuyuki Kobayashi
2013-07-10 13:20 ` Simon Horman
2013-07-10 1:56 ` [PATCH 3/3] ARM: shmobile: Insert align directives before 4 bytes data Tetsuyuki Kobayashi
2013-07-10 3:44 ` [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Magnus Damm
3 siblings, 1 reply; 9+ messages in thread
From: Tetsuyuki Kobayashi @ 2013-07-10 1:56 UTC (permalink / raw)
To: linux-arm-kernel
Instructions start from boot vector must be ARM mode.
This patch specify ARM mode explicitly and use 'bx' instruction to be
able to change to Thumb mode.
Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
arch/arm/mach-shmobile/headsmp.S | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index 559d1ce..afed58e 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -26,10 +26,13 @@ ENDPROC(shmobile_invalidate_start)
* This will be mapped at address 0 by SBAR register.
* We need _long_ jump to the physical address.
*/
+ .arm
.align 12
ENTRY(shmobile_boot_vector)
ldr r0, 2f
- ldr pc, 1f
+ ldr r1, 1f
+ bx r1
+
ENDPROC(shmobile_boot_vector)
.globl shmobile_boot_fn
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] ARM: shmobile: Insert align directives before 4 bytes data
2013-07-10 1:56 [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Tetsuyuki Kobayashi
2013-07-10 1:56 ` [PATCH 1/3] ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y Tetsuyuki Kobayashi
2013-07-10 1:56 ` [PATCH 2/3] ARM: shmobile: Force ARM mode to compile reset vector for secondary CPUs Tetsuyuki Kobayashi
@ 2013-07-10 1:56 ` Tetsuyuki Kobayashi
2013-07-10 13:21 ` Simon Horman
2013-07-10 3:44 ` [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Magnus Damm
3 siblings, 1 reply; 9+ messages in thread
From: Tetsuyuki Kobayashi @ 2013-07-10 1:56 UTC (permalink / raw)
To: linux-arm-kernel
In thumb2 mode instructions are not align to 4 byte. This patch insert
align directives before putting 4 byte data.
Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
arch/arm/mach-shmobile/headsmp-scu.S | 1 +
arch/arm/mach-shmobile/headsmp.S | 1 +
arch/arm/mach-shmobile/sleep-sh7372.S | 2 ++
3 files changed, 4 insertions(+)
diff --git a/arch/arm/mach-shmobile/headsmp-scu.S b/arch/arm/mach-shmobile/headsmp-scu.S
index 5ce416c..0a77488 100644
--- a/arch/arm/mach-shmobile/headsmp-scu.S
+++ b/arch/arm/mach-shmobile/headsmp-scu.S
@@ -46,6 +46,7 @@ ENTRY(shmobile_boot_scu)
ENDPROC(shmobile_boot_scu)
.text
+ .align 2
.globl shmobile_scu_base
shmobile_scu_base:
.space 4
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S
index afed58e..dfb41df 100644
--- a/arch/arm/mach-shmobile/headsmp.S
+++ b/arch/arm/mach-shmobile/headsmp.S
@@ -35,6 +35,7 @@ ENTRY(shmobile_boot_vector)
ENDPROC(shmobile_boot_vector)
+ .align 2
.globl shmobile_boot_fn
shmobile_boot_fn:
1: .space 4
diff --git a/arch/arm/mach-shmobile/sleep-sh7372.S b/arch/arm/mach-shmobile/sleep-sh7372.S
index 53f4840..9782862 100644
--- a/arch/arm/mach-shmobile/sleep-sh7372.S
+++ b/arch/arm/mach-shmobile/sleep-sh7372.S
@@ -41,6 +41,7 @@
sh7372_resume_core_standby_sysc:
ldr pc, 1f
+ .align 2
.globl sh7372_cpu_resume
sh7372_cpu_resume:
1: .space 4
@@ -96,6 +97,7 @@ sh7372_do_idle_sysc:
1:
b 1b
+ .align 2
kernel_flush:
.word v7_flush_dcache_all
#endif
--
1.7.9.5
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel
2013-07-10 1:56 [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Tetsuyuki Kobayashi
` (2 preceding siblings ...)
2013-07-10 1:56 ` [PATCH 3/3] ARM: shmobile: Insert align directives before 4 bytes data Tetsuyuki Kobayashi
@ 2013-07-10 3:44 ` Magnus Damm
3 siblings, 0 replies; 9+ messages in thread
From: Magnus Damm @ 2013-07-10 3:44 UTC (permalink / raw)
To: linux-arm-kernel
Hi Kobayashi-san,
Your patch series looks fine to me. Thanks for your contribution.
Acked-by: Magnus Damm <damm@opensource.se>
On Wed, Jul 10, 2013 at 10:56 AM, Tetsuyuki Kobayashi <koba@kmckk.co.jp> wrote:
> Hello,
>
> I try to build SMP kernel for KZM-A9-GT board in CONFIG_THUMB2_KERNEL=y.
> After some modification it successully boots in Thumb2 kernel.
> In my case, Thumb2 kernel is 23% smaller than usual ARM kernel.
>
> text data bss dec hex filename
> 4763561 251580 196164 5211305 4f84a9 out.kzm9g/vmlinux
>
> text data bss dec hex filename
> 3595265 251668 196164 4043097 3db159 out.kzm9g_thumb/vmlinux
>
>
> Useful info for Thumb2 kernel
> https://wiki.linaro.org/WorkingGroups/KernelArchived/Thumb2Guide
>
> This patch set is based on arm-soc git repositry,
> remotes/origin/renesas/soc-cleanup branch
> 53332005bfde9d2e3c9a66030c0e8c2598eaa1d5 ARM: shmobile: Remove Bonito board support
>
> Tetsuyuki Kobayashi (3):
> ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y
> ARM: shmobile: Force ARM mode to compile reset vector for secondary
> CPUs
> ARM: shmobile: Insert align directives before 4 bytes data
>
> arch/arm/mach-shmobile/headsmp-scu.S | 4 +++-
> arch/arm/mach-shmobile/headsmp.S | 6 +++++-
> arch/arm/mach-shmobile/sleep-sh7372.S | 2 ++
> 3 files changed, 10 insertions(+), 2 deletions(-)
>
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y
2013-07-10 1:56 ` [PATCH 1/3] ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y Tetsuyuki Kobayashi
@ 2013-07-10 13:20 ` Simon Horman
0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2013-07-10 13:20 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 10, 2013 at 10:56:35AM +0900, Tetsuyuki Kobayashi wrote:
> On KZM-A9-GT board (SMP), when CONFIG_THUMB2_KERNEL=y it fails to compile
>
> AS arch/arm/mach-shmobile/headsmp-scu.o
> /proj/koba/kernel/arm-soc/arch/arm/mach-shmobile/headsmp-scu.S: Assembler messages:
> /proj/koba/kernel/arm-soc/arch/arm/mach-shmobile/headsmp-scu.S:41: Error: shift must be constant -- `bic r2,r2,r3,lsl r1'
> make[2]: *** [arch/arm/mach-shmobile/headsmp-scu.o] Error 1
> make[1]: *** [arch/arm/mach-shmobile] Error 2
> make: *** [sub-make] Error 2
>
> Instruction `bic r2,r2,r3,lsl r1' is not supported in thumb mode. This patch split it into 2 instructions.
>
> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> ---
> arch/arm/mach-shmobile/headsmp-scu.S | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Thanks, I have queued this up with Magnus's ack in the thumb-fixes
branch of my renesas tree on kernel.org. It should be
included in the renesas-next-20130710v2 tag.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] ARM: shmobile: Force ARM mode to compile reset vector for secondary CPUs
2013-07-10 1:56 ` [PATCH 2/3] ARM: shmobile: Force ARM mode to compile reset vector for secondary CPUs Tetsuyuki Kobayashi
@ 2013-07-10 13:20 ` Simon Horman
2013-07-11 1:21 ` Tetsuyuki Kobayashi
0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2013-07-10 13:20 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 10, 2013 at 10:56:36AM +0900, Tetsuyuki Kobayashi wrote:
> Instructions start from boot vector must be ARM mode.
> This patch specify ARM mode explicitly and use 'bx' instruction to be
> able to change to Thumb mode.
>
> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> ---
> arch/arm/mach-shmobile/headsmp.S | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Thanks, I have queued this up with Magnus's ack in the thumb-fixes
branch of my renesas tree on kernel.org. It should be
included in the renesas-next-20130710v2 tag.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] ARM: shmobile: Insert align directives before 4 bytes data
2013-07-10 1:56 ` [PATCH 3/3] ARM: shmobile: Insert align directives before 4 bytes data Tetsuyuki Kobayashi
@ 2013-07-10 13:21 ` Simon Horman
0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2013-07-10 13:21 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 10, 2013 at 10:56:37AM +0900, Tetsuyuki Kobayashi wrote:
> In thumb2 mode instructions are not align to 4 byte. This patch insert
> align directives before putting 4 byte data.
>
> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> ---
> arch/arm/mach-shmobile/headsmp-scu.S | 1 +
> arch/arm/mach-shmobile/headsmp.S | 1 +
> arch/arm/mach-shmobile/sleep-sh7372.S | 2 ++
> 3 files changed, 4 insertions(+)
Thanks, I have queued this up with Magnus's ack in the thumb-fixes
branch of my renesas tree on kernel.org. It should be
included in the renesas-next-20130710v2 tag.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] ARM: shmobile: Force ARM mode to compile reset vector for secondary CPUs
2013-07-10 13:20 ` Simon Horman
@ 2013-07-11 1:21 ` Tetsuyuki Kobayashi
0 siblings, 0 replies; 9+ messages in thread
From: Tetsuyuki Kobayashi @ 2013-07-11 1:21 UTC (permalink / raw)
To: linux-arm-kernel
Thank you, Simon-san.
I will post the backport patch to next LTSI kernel.
(2013/07/10 22:20), Simon Horman wrote:
> On Wed, Jul 10, 2013 at 10:56:36AM +0900, Tetsuyuki Kobayashi wrote:
>> Instructions start from boot vector must be ARM mode.
>> This patch specify ARM mode explicitly and use 'bx' instruction to be
>> able to change to Thumb mode.
>>
>> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
>> ---
>> arch/arm/mach-shmobile/headsmp.S | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> Thanks, I have queued this up with Magnus's ack in the thumb-fixes
> branch of my renesas tree on kernel.org. It should be
> included in the renesas-next-20130710v2 tag.
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-07-11 1:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 1:56 [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Tetsuyuki Kobayashi
2013-07-10 1:56 ` [PATCH 1/3] ARM: shmobile: fix compile error when CONFIG_THUMB2_KERNEL=y Tetsuyuki Kobayashi
2013-07-10 13:20 ` Simon Horman
2013-07-10 1:56 ` [PATCH 2/3] ARM: shmobile: Force ARM mode to compile reset vector for secondary CPUs Tetsuyuki Kobayashi
2013-07-10 13:20 ` Simon Horman
2013-07-11 1:21 ` Tetsuyuki Kobayashi
2013-07-10 1:56 ` [PATCH 3/3] ARM: shmobile: Insert align directives before 4 bytes data Tetsuyuki Kobayashi
2013-07-10 13:21 ` Simon Horman
2013-07-10 3:44 ` [PATCH 0/3] ARM: shmobile: enable SMP Thumb2 kernel Magnus Damm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).