Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Noam Camus and committed by
Vineet Gupta
86c25466 b1f2f6f3

+28
+6
arch/arc/include/asm/entry-compact.h
··· 36 36 #include <asm/irqflags-compact.h> 37 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 44 * Switch to Kernel Mode stack if SP points to User Mode stack 41 45 * ··· 300 296 bic \reg, sp, (THREAD_SIZE - 1) 301 297 .endm 302 298 299 + #ifndef CONFIG_ARC_PLAT_EZNPS 303 300 /* Get CPU-ID of this core */ 304 301 .macro GET_CPU_ID reg 305 302 lr \reg, [identity] 306 303 lsr \reg, \reg, 8 307 304 bmsk \reg, \reg, 7 308 305 .endm 306 + #endif 309 307 310 308 #endif /* __ASM_ARC_ENTRY_COMPACT_H */
+13
arch/arc/kernel/ctx_sw.c
··· 16 16 17 17 #include <asm/asm-offsets.h> 18 18 #include <linux/sched.h> 19 + #ifdef CONFIG_ARC_PLAT_EZNPS 20 + #include <plat/ctop.h> 21 + #endif 19 22 20 23 #define KSP_WORD_OFF ((TASK_THREAD + THREAD_KSP) / 4) 21 24 ··· 70 67 #ifndef CONFIG_SMP 71 68 "st %2, [@_current_task] \n\t" 72 69 #else 70 + #ifdef CONFIG_ARC_PLAT_EZNPS 71 + "lr r24, [%4] \n\t" 72 + #ifndef CONFIG_EZNPS_MTM_EXT 73 + "lsr r24, r24, 4 \n\t" 74 + #endif 75 + #else 73 76 "lr r24, [identity] \n\t" 74 77 "lsr r24, r24, 8 \n\t" 75 78 "bmsk r24, r24, 7 \n\t" 79 + #endif 76 80 "add2 r24, @_current_task, r24 \n\t" 77 81 "st %2, [r24] \n\t" 78 82 #endif ··· 117 107 118 108 : "=r"(tmp) 119 109 : "n"(KSP_WORD_OFF), "r"(next), "r"(prev) 110 + #ifdef CONFIG_ARC_PLAT_EZNPS 111 + , "i"(CTOP_AUX_LOGIC_GLOBAL_ID) 112 + #endif 120 113 : "blink" 121 114 ); 122 115
+9
arch/arc/plat-eznps/include/plat/ctop.h
··· 195 195 #define REG_GIM_P_INT_DST_25 nps_host_reg_non_cl(NPS_GIM_BLKID, 0x149) 196 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 207 #endif /* __ASSEMBLY__ */ 199 208 200 209 #endif /* _PLAT_EZNPS_CTOP_H */