Skip to contentSkip to conversation

ARM changes for ScorpionMP support

PATCH In review Jeff Ohlstein 3 participants 14 messages Jul 23, 2010 – Jul 30, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM changes for ScorpionMP support

These are low level changes needed to support targets based on Qualcomm's ScorpionMP architecture.

Jeff Ohlstein (1):
arm: Kconfig option for ARCH_MSM_SCORPIONMP

Steve Muckle (2):
arm: mm: do not set missing flags on ScorpionMP
arm: macros for wfe, sev instructions

 arch/arm/Kconfig                 |    5 +++--
 arch/arm/include/asm/processor.h |    5 +++++
 arch/arm/mach-msm/Kconfig        |    2 ++
 arch/arm/mm/proc-v7.S            |    2 +-
 4 files changed, 11 insertions(+), 3 deletions(-)

Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

#1 lore raw

PATCH 1/3 arm: Kconfig option for ARCH_MSM_SCORPIONMP

ScorpionMP is a configuration of Scorpion processors. It supports SMP and local timers.

---
 arch/arm/Kconfig          |    5 +++--
 arch/arm/mach-msm/Kconfig |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)
arch/arm/Kconfig +3 -2
index 98922f7..08518ae 100644
@@ -1100,7 +1100,7 @@ config SMP
 	bool "Symmetric Multi-Processing (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP ||\
 		 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 ||\
-		 ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
+		 ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_MSM_SCORPIONMP)
 	depends on GENERIC_CLOCKEVENTS
 	select USE_GENERIC_SMP_HELPERS
 	select HAVE_ARM_SCU if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4)
@@ -1172,7 +1172,8 @@ config HOTPLUG_CPU
 config LOCAL_TIMERS
 	bool "Use local timer interrupts"
 	depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || \
-		REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500)
+		REALVIEW_EB_A9MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || ARCH_U8500 || \
+		ARCH_MSM_SCORPIONMP)
 	default y
 	select HAVE_ARM_TWD if (ARCH_REALVIEW || ARCH_OMAP4 || ARCH_U8500)
 	help
arch/arm/mach-msm/Kconfig +2 -0
index 47264a7..cc59b0c 100644
@@ -35,6 +35,8 @@ config  ARCH_MSM_ARM11
 	bool
 config  ARCH_MSM_SCORPION
 	bool
+config  ARCH_MSM_SCORPIONMP
+	bool
 
 config  MSM_VIC
 	bool
Signature · 1 line
1.7.1.1
#2 lore raw

PATCH 2/3 arm: mm: do not set missing flags on ScorpionMP

In reply to Jeff Ohlstein

From: Steve Muckle <[email protected]>

ScorpionMP does not have the SMP/nAMP mode and TLB ops broadcasting bits in the ACTLR.

---
 arch/arm/mm/proc-v7.S |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mm/proc-v7.S +1 -1
index 7aaf88a..6bddf5d 100644
@@ -190,7 +190,7 @@ cpu_v7_name:
  *	- cache type register is implemented
  */
 __v7_setup:
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && !defined(CONFIG_ARCH_MSM_SCORPIONMP)
 	mrc	p15, 0, r0, c1, c0, 1
 	tst	r0, #(1 << 6)			@ SMP/nAMP mode enabled?
 	orreq	r0, r0, #(1 << 6) | (1 << 0)	@ Enable SMP/nAMP mode and
Signature · 1 line
1.7.1.1
#3 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 4 lines · Jeff Ohlstein

From: Steve Muckle <[email protected]>

ScorpionMP does not have the SMP/nAMP mode and TLB ops broadcasting bits in the ACTLR.

Please provide a separate instance of __v7_proc_info for your processor and direct it to jump into the __v7_setup code after this setup instead.

#4 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 8 lines · Russell King - ARM Linux
Quoted 4 lines · Jeff Ohlstein

From: Steve Muckle <[email protected]>

ScorpionMP does not have the SMP/nAMP mode and TLB ops broadcasting bits in the ACTLR.

Please provide a separate instance of __v7_proc_info for your processor and direct it to jump into the __v7_setup code after this setup instead.

You mean add another label into __v7_setup along with a proc-msm.S to jump over this code?

Daniel

Signature · 2 lines
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#5 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 7 lines · Daniel Walker
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Jeff Ohlstein

From: Steve Muckle <[email protected]>

ScorpionMP does not have the SMP/nAMP mode and TLB ops broadcasting bits in the ACTLR.

Quoted 6 lines
Quoted 2 lines

Please provide a separate instance of __v7_proc_info for your processor and direct it to jump into the __v7_setup code after this setup instead.

You mean add another label into __v7_setup along with a proc-msm.S to jump over this code?

Yes to the first, no to the second.

__v7_setup:
#ifdef CONFIG_SMP

        mrc     p15, 0, r0, c1, c0, 1
        tst     r0, #(1 << 6)                   @ SMP/nAMP mode enabled?
        orreq   r0, r0, #(1 << 6) | (1 << 0)    @ Enable SMP/nAMP mode and
        mcreq   p15, 0, r0, c1, c0, 1           @ TLB ops broadcasting
#endif
__v7_msm_setup:
	...

        .section ".proc.info.init", #alloc, #execinstr

	.type	__v7_msm_proc_info, #object
__v7_msm_proc_info:
	.long	...
	.long	...
	...
	b	__v7_msm_setup
	...

        /*
         * Match any ARMv7 processor core.
         */
        .type   __v7_proc_info, #object
__v7_proc_info:
	...
#6 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 8 lines · Russell King - ARM Linux
Quoted 7 lines · Daniel Walker
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Jeff Ohlstein

From: Steve Muckle <[email protected]>

ScorpionMP does not have the SMP/nAMP mode and TLB ops broadcasting bits in the ACTLR.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Please provide a separate instance of __v7_proc_info for your processor and direct it to jump into the __v7_setup code after this setup instead.

You mean add another label into __v7_setup along with a proc-msm.S to jump over this code?

Yes to the first, no to the second.

Like so? I haven't tested this.

arch/arm/mm/proc-v7.S +24 -0
index 6bddf5d..167bedb 100644
@@ -196,6 +196,7 @@ __v7_setup:
 	orreq	r0, r0, #(1 << 6) | (1 << 0)	@ Enable SMP/nAMP mode and
 	mcreq	p15, 0, r0, c1, c0, 1		@ TLB ops broadcasting
 #endif
+__v7_msm_setup:
 	adr	r12, __v7_setup_stack		@ the local stack
 	stmia	r12, {r0-r5, r7, r9, r11, lr}
 	bl	v7_flush_dcache_all
@@ -326,6 +327,29 @@ cpu_elf_name:
 
 	.section ".proc.info.init", #alloc, #execinstr
 
+	.type   __v7_msm_proc_info, #object
+__v7_msm_proc_info:
+	.long	0x000f0000		@ Required ID value
+	.long	0x000f0000		@ Mask for ID
+	.long   PMD_TYPE_SECT | \
+		PMD_SECT_AP_WRITE | \
+		PMD_SECT_AP_READ | \
+		PMD_FLAGS
+	.long   PMD_TYPE_SECT | \
+		PMD_SECT_XN | \
+		PMD_SECT_AP_WRITE | \
+		PMD_SECT_AP_READ
+	b	__v7_msm_setup
+	.long	cpu_arch_name
+	.long	cpu_elf_name
+	.long	HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
+	.long	cpu_v7_name
+	.long	v7_processor_functions
+	.long	v7wbi_tlb_fns
+	.long	v6_user_fns
+	.long	v7_cache_fns
+	.size	__v7_msm_proc_info, . - __v7_msm_proc_info
+
 	/*
 	 * Match any ARMv7 processor core.
 	 */
Signature · 2 lines
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#7 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

arch/arm/mm/proc-v7.S cpu_elf_name: · line 333

Quoted 8 lines · Daniel Walker
arch/arm/mm/proc-v7.S +4 -0
@@ -326,6 +327,29 @@ cpu_elf_name:
 
 	.section ".proc.info.init", #alloc, #execinstr
 
+	.type   __v7_msm_proc_info, #object
+__v7_msm_proc_info:
+	.long	0x000f0000		@ Required ID value
+	.long	0x000f0000		@ Mask for ID

Almost - is there no more specific ID value for your CPU?

#8 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 11 lines · Russell King - ARM Linux

Review cpu_elf_name: · line 333

Quoted 8 lines · Daniel Walker
(quoted diff) +4 -0
@@ -326,6 +327,29 @@ cpu_elf_name:
 
 	.section ".proc.info.init", #alloc, #execinstr
 
+	.type   __v7_msm_proc_info, #object
+__v7_msm_proc_info:
+	.long	0x000f0000		@ Required ID value
+	.long	0x000f0000		@ Mask for ID

Almost - is there no more specific ID value for your CPU?

Here's one with a more specific cpu id. Would you be willing to take this for 2.6.36 or are you pretty much done taking pull requests?

Daniel

arch/arm/mm/proc-v7.S +24 -0
index 6bddf5d..a5b613d 100644
@@ -196,6 +196,7 @@ __v7_setup:
 	orreq	r0, r0, #(1 << 6) | (1 << 0)	@ Enable SMP/nAMP mode and
 	mcreq	p15, 0, r0, c1, c0, 1		@ TLB ops broadcasting
 #endif
+__v7_msm_setup:
 	adr	r12, __v7_setup_stack		@ the local stack
 	stmia	r12, {r0-r5, r7, r9, r11, lr}
 	bl	v7_flush_dcache_all
@@ -326,6 +327,29 @@ cpu_elf_name:
 
 	.section ".proc.info.init", #alloc, #execinstr
 
+	.type   __v7_msm_proc_info, #object
+__v7_msm_proc_info:
+	.long	0x510f0000		@ Required ID value
+	.long	0xff0f0000		@ Mask for ID
+	.long   PMD_TYPE_SECT | \
+		PMD_SECT_AP_WRITE | \
+		PMD_SECT_AP_READ | \
+		PMD_FLAGS
+	.long   PMD_TYPE_SECT | \
+		PMD_SECT_XN | \
+		PMD_SECT_AP_WRITE | \
+		PMD_SECT_AP_READ
+	b	__v7_msm_setup
+	.long	cpu_arch_name
+	.long	cpu_elf_name
+	.long	HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
+	.long	cpu_v7_name
+	.long	v7_processor_functions
+	.long	v7wbi_tlb_fns
+	.long	v6_user_fns
+	.long	v7_cache_fns
+	.size	__v7_msm_proc_info, . - __v7_msm_proc_info
+
 	/*
 	 * Match any ARMv7 processor core.
 	 */
Signature · 2 lines
Sent by an consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#9 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 13 lines · Daniel Walker
Quoted 11 lines · Russell King - ARM Linux

arch/arm/mm/proc-v7.S cpu_elf_name: · line 333

Quoted 8 lines · Daniel Walker
arch/arm/mm/proc-v7.S +4 -0
@@ -326,6 +327,29 @@ cpu_elf_name:
 
 	.section ".proc.info.init", #alloc, #execinstr
 
+	.type   __v7_msm_proc_info, #object
+__v7_msm_proc_info:
+	.long	0x000f0000		@ Required ID value
+	.long	0x000f0000		@ Mask for ID

Almost - is there no more specific ID value for your CPU?

Quoted 2 lines

Here's one with a more specific cpu id. Would you be willing to take this for 2.6.36 or are you pretty much done taking pull requests?

Yes, but if its just for this patch, is there much point to a pull request?

#10 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 14 lines · Russell King - ARM Linux
Quoted 13 lines · Daniel Walker
Quoted 11 lines · Russell King - ARM Linux

arch/arm/mm/proc-v7.S cpu_elf_name: · line 333

Quoted 8 lines · Daniel Walker
arch/arm/mm/proc-v7.S +4 -0
@@ -326,6 +327,29 @@ cpu_elf_name:
 
 	.section ".proc.info.init", #alloc, #execinstr
 
+	.type   __v7_msm_proc_info, #object
+__v7_msm_proc_info:
+	.long	0x000f0000		@ Required ID value
+	.long	0x000f0000		@ Mask for ID

Almost - is there no more specific ID value for your CPU?

Quoted 5 lines
Quoted 2 lines

Here's one with a more specific cpu id. Would you be willing to take this for 2.6.36 or are you pretty much done taking pull requests?

Yes, but if its just for this patch, is there much point to a pull request?

I've got some other stuff too .. Jeff Ohlstein sent several patches (one of which started this discussion), which are needed for an SMP board we've been working on.

Daniel

#11 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 7 lines · Daniel Walker
Quoted 2 lines · Russell King - ARM Linux

Yes, but if its just for this patch, is there much point to a pull request?

I've got some other stuff too .. Jeff Ohlstein sent several patches (one of which started this discussion), which are needed for an SMP board we've been working on.

Has it been seen on the mailing list?

#12 lore raw

Re: [PATCH 2/3] arm: mm: do not set missing flags on ScorpionMP

Quoted 10 lines · Russell King - ARM Linux
Quoted 7 lines · Daniel Walker
Quoted 2 lines · Russell King - ARM Linux

Yes, but if its just for this patch, is there much point to a pull request?

I've got some other stuff too .. Jeff Ohlstein sent several patches (one of which started this discussion), which are needed for an SMP board we've been working on.

Has it been seen on the mailing list?

Yes, this series

http://www.acetylcholine.com/node/92578

except the 3/3 patch .. There was also a GIC fix patch,

http://www.gossamer-threads.com/lists/linux/kernel/1254644

Daniel

#13 lore raw

PATCH 3/3 arm: macros for wfe, sev instructions

In reply to Jeff Ohlstein

From: Steve Muckle <[email protected]>

The wait for event and send event instructions may be called from C code such as boot or power management routines.

---
 arch/arm/include/asm/processor.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/include/asm/processor.h +5 -0
index 7bed3da..4262664 100644
@@ -97,6 +97,11 @@ unsigned long get_wchan(struct task_struct *p);
 #define cpu_relax()			barrier()
 #endif
 
+#if defined(CONFIG_CPU_32v6K) || __LINUX_ARM_ARCH__ >= 7
+#define sev() __asm__("sev")
+#define wfe() __asm__("wfe")
+#endif
+
 /*
  * Create a new kernel thread
  */
Signature · 1 line
1.7.1.1