diff mbox

[3/3,RFC] ARM: prepare ARMv7-M for MULTIPLATFORM use

Message ID 1380534577-15076-4-git-send-email-u.kleine-koenig@pengutronix.de
State New
Headers show

Commit Message

Uwe Kleine-König Sept. 30, 2013, 9:49 a.m. UTC
v7-M is a third group that is incompatible with both v4/v5 and v6/v7.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
This behaves strange but I think is robust not to allow broken configs:

When v4/v5 is selected, v6/v7 and v7m are available for enabling, too.
When v6/v7 is selected the other choices are disabled
When v7m is selected only v6/v7 are available for enabling.
---
 arch/arm/Kconfig            | 11 ++++++++---
 arch/arm/kernel/entry-v7m.S |  6 ++++--
 2 files changed, 12 insertions(+), 5 deletions(-)

Comments

Arnd Bergmann Sept. 30, 2013, 10:34 a.m. UTC | #1
On Monday 30 September 2013, Uwe Kleine-König wrote:
> v7-M is a third group that is incompatible with both v4/v5 and v6/v7.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> This behaves strange but I think is robust not to allow broken configs:
> 
> When v4/v5 is selected, v6/v7 and v7m are available for enabling, too.
> When v6/v7 is selected the other choices are disabled
> When v7m is selected only v6/v7 are available for enabling.

The Kconfig stuff all looks good, 

Acked-by: Arnd Bergmann <arnd@arndb.de>


> diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S
> index 52b2643..f72ced6 100644
> --- a/arch/arm/kernel/entry-v7m.S
> +++ b/arch/arm/kernel/entry-v7m.S
> @@ -14,8 +14,6 @@
>  #include <asm/thread_notify.h>
>  #include <asm/v7m.h>
>  
> -#include <mach/entry-macro.S>
> -
>  #include "entry-header.S"
>  
>  #ifdef CONFIG_TRACE_IRQFLAGS
> @@ -141,3 +139,7 @@ ENTRY(vector_table)
>  	.rept	64 - 16
>  	.long	__irq_entry		@ 16..64 - External Interrupts
>  	.endr
> +
> +	.globl  handle_arch_irq
> +handle_arch_irq:
> +	.long	0
> -- 
> 1.8.4.rc3

I'm not sure about this part. I guess you should either make it
a separate patch, or describe what it's for in the patch description above.

Also, I'd put all of the text you have in the comment into the actual
changeset text, above the --- line, as others might find that useful
later.

	Arnd
Uwe Kleine-König Sept. 30, 2013, 4:02 p.m. UTC | #2
Hello Arnd,

On Mon, Sep 30, 2013 at 12:34:25PM +0200, Arnd Bergmann wrote:
> On Monday 30 September 2013, Uwe Kleine-König wrote:
> > v7-M is a third group that is incompatible with both v4/v5 and v6/v7.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > This behaves strange but I think is robust not to allow broken configs:
> > 
> > When v4/v5 is selected, v6/v7 and v7m are available for enabling, too.
> > When v6/v7 is selected the other choices are disabled
> > When v7m is selected only v6/v7 are available for enabling.
> 
> The Kconfig stuff all looks good, 
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Thanks

> > @@ -141,3 +139,7 @@ ENTRY(vector_table)
> >  	.rept	64 - 16
> >  	.long	__irq_entry		@ 16..64 - External Interrupts
> >  	.endr
> > +
> > +	.globl  handle_arch_irq
> > +handle_arch_irq:
> > +	.long	0
> > -- 
> > 1.8.4.rc3
> 
> I'm not sure about this part. I guess you should either make it
> a separate patch, or describe what it's for in the patch description above.
This is needed because ARCH_MULTIPLATFORM selects MULTI_IRQ_HANDLER
which v7-M didn't use up to now. I will wait for a while for more
feedback then respin with a better changelog.
 
> Also, I'd put all of the text you have in the comment into the actual
> changeset text, above the --- line, as others might find that useful
> later.
ok

Uwe
Uwe Kleine-König Oct. 3, 2013, 8:04 p.m. UTC | #3
On Mon, Sep 30, 2013 at 12:34:25PM +0200, Arnd Bergmann wrote:
> On Monday 30 September 2013, Uwe Kleine-König wrote:
> > v7-M is a third group that is incompatible with both v4/v5 and v6/v7.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > This behaves strange but I think is robust not to allow broken configs:
> > 
> > When v4/v5 is selected, v6/v7 and v7m are available for enabling, too.
> > When v6/v7 is selected the other choices are disabled
> > When v7m is selected only v6/v7 are available for enabling.
> 
> The Kconfig stuff all looks good, 
Actually this is a choice implemented using normal configs. Why not a
using a choice here:

choice
	prompt "CPU Core family selection"

config ARCH_MULTI_V4_V5
	bool "..."

config ARCH_MULTI_V6_V7
	bool "..."

config ARCH_MULTI_V7M
	bool "..."

endchoice

config ARCH_MULTI_V4T
	bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
	depends on ARCH_MULTI_V4_V5

config ARCH_MULTI_V5
	bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)" if ARCH_MULTI_V4T
	depends on ARCH_MULTI_V4_V5
	default y if !ARCH_MULTI_V4T

config ARCH_MULTI_V6
	...

config ARCH_MULTI_V7
	...

Best regards
Uwe
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d873a34..4d749fa 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -881,7 +881,7 @@  comment "CPU Core family selection"
 
 config ARCH_MULTI_V4T
 	bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
-	depends on !ARCH_MULTI_V6_V7
+	depends on !ARCH_MULTI_V6_V7 && !ARCH_MULTI_V7M
 	select ARCH_MULTI_V4_V5
 	select CPU_ARM920T if !(CPU_ARM7TDMI || CPU_ARM720T || \
 		CPU_ARM740T || CPU_ARM9TDMI || CPU_ARM922T || \
@@ -889,7 +889,7 @@  config ARCH_MULTI_V4T
 
 config ARCH_MULTI_V5
 	bool "ARMv5 based platforms (ARM926T, XSCALE, PJ1, ...)"
-	depends on !ARCH_MULTI_V6_V7
+	depends on !ARCH_MULTI_V6_V7 && !ARCH_MULTI_V7M
 	select ARCH_MULTI_V4_V5
 	select CPU_ARM926T if (!CPU_ARM946E || CPU_ARM1020 || \
 		CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || \
@@ -912,8 +912,13 @@  config ARCH_MULTI_V7
 config ARCH_MULTI_V6_V7
 	bool
 
+config ARCH_MULTI_V7M
+	bool "ARMv7-M based platforms (Cortex-M)"
+	depends on !ARCH_MULTI_V6_V7 && !MMU
+	select CPU_V7M
+
 config ARCH_MULTI_CPU_AUTO
-	def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7)
+	def_bool !(ARCH_MULTI_V4 || ARCH_MULTI_V4T || ARCH_MULTI_V6_V7 || ARCH_MULTI_V7M)
 	select ARCH_MULTI_V5
 
 endmenu
diff --git a/arch/arm/kernel/entry-v7m.S b/arch/arm/kernel/entry-v7m.S
index 52b2643..f72ced6 100644
--- a/arch/arm/kernel/entry-v7m.S
+++ b/arch/arm/kernel/entry-v7m.S
@@ -14,8 +14,6 @@ 
 #include <asm/thread_notify.h>
 #include <asm/v7m.h>
 
-#include <mach/entry-macro.S>
-
 #include "entry-header.S"
 
 #ifdef CONFIG_TRACE_IRQFLAGS
@@ -141,3 +139,7 @@  ENTRY(vector_table)
 	.rept	64 - 16
 	.long	__irq_entry		@ 16..64 - External Interrupts
 	.endr
+
+	.globl  handle_arch_irq
+handle_arch_irq:
+	.long	0