aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Camus <noamc@ezchip.com>2013-06-03 08:17:25 -0400
committerVineet Gupta <vgupta@synopsys.com>2016-05-09 00:02:33 -0400
commit86c25466f7414d6396f1aaa13e4b34f36ec272d5 (patch)
tree908b67ed82896362bcb7e438c8b6849ea3b2a2c7
parentb1f2f6f3cf5e37f0418f6cebf365cff7c3abf6d7 (diff)
ARC: [plat-eznps] Use dedicated identity auxiliary register.
With generic "identity" num of CPUs is limited to 256 (8 bit). We use our alternative AUX register GLOBAL_ID (12 bit). Now we can support up to 4096 CPUs. Signed-off-by: Noam Camus <noamc@ezchip.com>
-rw-r--r--arch/arc/include/asm/entry-compact.h6
-rw-r--r--arch/arc/kernel/ctx_sw.c13
-rw-r--r--arch/arc/plat-eznps/include/plat/ctop.h9
3 files changed, 28 insertions, 0 deletions
diff --git a/arch/arc/include/asm/entry-compact.h b/arch/arc/include/asm/entry-compact.h
index 1d8f57cd6057..e0e1faf03c50 100644
--- a/arch/arc/include/asm/entry-compact.h
+++ b/arch/arc/include/asm/entry-compact.h
@@ -36,6 +36,10 @@
36#include <asm/irqflags-compact.h> 36#include <asm/irqflags-compact.h>
37#include <asm/thread_info.h> /* For THREAD_SIZE */ 37#include <asm/thread_info.h> /* For THREAD_SIZE */
38 38
39#ifdef CONFIG_ARC_PLAT_EZNPS
40#include <plat/ctop.h>
41#endif
42
39/*-------------------------------------------------------------- 43/*--------------------------------------------------------------
40 * Switch to Kernel Mode stack if SP points to User Mode stack 44 * Switch to Kernel Mode stack if SP points to User Mode stack
41 * 45 *
@@ -296,11 +300,13 @@
296 bic \reg, sp, (THREAD_SIZE - 1) 300 bic \reg, sp, (THREAD_SIZE - 1)
297.endm 301.endm
298 302
303#ifndef CONFIG_ARC_PLAT_EZNPS
299/* Get CPU-ID of this core */ 304/* Get CPU-ID of this core */
300.macro GET_CPU_ID reg 305.macro GET_CPU_ID reg
301 lr \reg, [identity] 306 lr \reg, [identity]
302 lsr \reg, \reg, 8 307 lsr \reg, \reg, 8
303 bmsk \reg, \reg, 7 308 bmsk \reg, \reg, 7
304.endm 309.endm
310#endif
305 311
306#endif /* __ASM_ARC_ENTRY_COMPACT_H */ 312#endif /* __ASM_ARC_ENTRY_COMPACT_H */
diff --git a/arch/arc/kernel/ctx_sw.c b/arch/arc/kernel/ctx_sw.c
index 5d446df2c413..6f4cb0dab1b9 100644
--- a/arch/arc/kernel/ctx_sw.c
+++ b/arch/arc/kernel/ctx_sw.c
@@ -16,6 +16,9 @@
16 16
17#include <asm/asm-offsets.h> 17#include <asm/asm-offsets.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#ifdef CONFIG_ARC_PLAT_EZNPS
20#include <plat/ctop.h>
21#endif
19 22
20#define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4) 23#define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4)
21 24
@@ -67,9 +70,16 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
67#ifndef CONFIG_SMP 70#ifndef CONFIG_SMP
68 "st %2, [@_current_task] \n\t" 71 "st %2, [@_current_task] \n\t"
69#else 72#else
73#ifdef CONFIG_ARC_PLAT_EZNPS
74 "lr r24, [%4] \n\t"
75#ifndef CONFIG_EZNPS_MTM_EXT
76 "lsr r24, r24, 4 \n\t"
77#endif
78#else
70 "lr r24, [identity] \n\t" 79 "lr r24, [identity] \n\t"
71 "lsr r24, r24, 8 \n\t" 80 "lsr r24, r24, 8 \n\t"
72 "bmsk r24, r24, 7 \n\t" 81 "bmsk r24, r24, 7 \n\t"
82#endif
73 "add2 r24, @_current_task, r24 \n\t" 83 "add2 r24, @_current_task, r24 \n\t"
74 "st %2, [r24] \n\t" 84 "st %2, [r24] \n\t"
75#endif 85#endif
@@ -107,6 +117,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
107 117
108 : "=r"(tmp) 118 : "=r"(tmp)
109 : "n"(KSP_WORD_OFF), "r"(next), "r"(prev) 119 : "n"(KSP_WORD_OFF), "r"(next), "r"(prev)
120#ifdef CONFIG_ARC_PLAT_EZNPS
121 , "i"(CTOP_AUX_LOGIC_GLOBAL_ID)
122#endif
110 : "blink" 123 : "blink"
111 ); 124 );
112 125
diff --git a/arch/arc/plat-eznps/include/plat/ctop.h b/arch/arc/plat-eznps/include/plat/ctop.h
index 91b25f3dd39a..9d6718c1a199 100644
--- a/arch/arc/plat-eznps/include/plat/ctop.h
+++ b/arch/arc/plat-eznps/include/plat/ctop.h
@@ -195,6 +195,15 @@ struct nps_host_reg_aux_lpc {
195#define REG_GIM_P_INT_DST_25 nps_host_reg_non_cl(NPS_GIM_BLKID, 0x149) 195#define REG_GIM_P_INT_DST_25 nps_host_reg_non_cl(NPS_GIM_BLKID, 0x149)
196#define REG_GIM_P_INT_DST_26 nps_host_reg_non_cl(NPS_GIM_BLKID, 0x14A) 196#define REG_GIM_P_INT_DST_26 nps_host_reg_non_cl(NPS_GIM_BLKID, 0x14A)
197 197
198#else
199
200.macro GET_CPU_ID reg
201 lr \reg, [CTOP_AUX_LOGIC_GLOBAL_ID]
202#ifndef CONFIG_EZNPS_MTM_EXT
203 lsr \reg, \reg, 4
204#endif
205.endm
206
198#endif /* __ASSEMBLY__ */ 207#endif /* __ASSEMBLY__ */
199 208
200#endif /* _PLAT_EZNPS_CTOP_H */ 209#endif /* _PLAT_EZNPS_CTOP_H */