All of lore.kernel.org
 help / color / mirror / Atom feed
From: Noam Camus <noamc@ezchip.com>
To: <linux-snps-arc@lists.infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <cmetcalf@ezchip.com>,
	Noam Camus <noamc@ezchip.com>
Subject: [PATCH v3 15/18] ARC: [plat-eznps] Use dedicated identity auxiliary register.
Date: Tue, 1 Dec 2015 15:03:02 +0200	[thread overview]
Message-ID: <1448974985-11487-16-git-send-email-noamc@ezchip.com> (raw)
In-Reply-To: <1448974985-11487-1-git-send-email-noamc@ezchip.com>

From: Noam Camus <noamc@ezchip.com>

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>
---
 arch/arc/include/asm/entry-compact.h |    8 ++++++++
 arch/arc/kernel/ctx_sw.c             |   13 +++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arc/include/asm/entry-compact.h b/arch/arc/include/asm/entry-compact.h
index 1aff3be..bf9a6a1 100644
--- a/arch/arc/include/asm/entry-compact.h
+++ b/arch/arc/include/asm/entry-compact.h
@@ -35,6 +35,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/irqflags-compact.h>
 #include <asm/thread_info.h>	/* For THREAD_SIZE */
+#include <plat/ctop.h>
 
 /*--------------------------------------------------------------
  * Switch to Kernel Mode stack if SP points to User Mode stack
@@ -298,9 +299,16 @@
 
 /* Get CPU-ID of this core */
 .macro  GET_CPU_ID  reg
+#ifdef CONFIG_ARC_PLAT_EZNPS
+	lr  \reg, [CTOP_AUX_LOGIC_GLOBAL_ID]
+#ifndef CONFIG_EZNPS_MTM_EXT
+	lsr \reg, \reg, 4
+#endif
+#else
 	lr  \reg, [identity]
 	lsr \reg, \reg, 8
 	bmsk \reg, \reg, 7
+#endif
 .endm
 
 #endif  /* __ASM_ARC_ENTRY_COMPACT_H */
diff --git a/arch/arc/kernel/ctx_sw.c b/arch/arc/kernel/ctx_sw.c
index 5d446df..6f4cb0d 100644
--- a/arch/arc/kernel/ctx_sw.c
+++ b/arch/arc/kernel/ctx_sw.c
@@ -16,6 +16,9 @@
 
 #include <asm/asm-offsets.h>
 #include <linux/sched.h>
+#ifdef CONFIG_ARC_PLAT_EZNPS
+#include <plat/ctop.h>
+#endif
 
 #define KSP_WORD_OFF 	((TASK_THREAD + THREAD_KSP) / 4)
 
@@ -67,9 +70,16 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
 #ifndef CONFIG_SMP
 		"st  %2, [@_current_task]	\n\t"
 #else
+#ifdef CONFIG_ARC_PLAT_EZNPS
+		"lr   r24, [%4]		\n\t"
+#ifndef CONFIG_EZNPS_MTM_EXT
+		"lsr  r24, r24, 4		\n\t"
+#endif
+#else
 		"lr   r24, [identity]		\n\t"
 		"lsr  r24, r24, 8		\n\t"
 		"bmsk r24, r24, 7		\n\t"
+#endif
 		"add2 r24, @_current_task, r24	\n\t"
 		"st   %2,  [r24]		\n\t"
 #endif
@@ -107,6 +117,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
 
 		: "=r"(tmp)
 		: "n"(KSP_WORD_OFF), "r"(next), "r"(prev)
+#ifdef CONFIG_ARC_PLAT_EZNPS
+		, "i"(CTOP_AUX_LOGIC_GLOBAL_ID)
+#endif
 		: "blink"
 	);
 
-- 
1.7.1


WARNING: multiple messages have this Message-ID (diff)
From: noamc@ezchip.com (Noam Camus)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH v3 15/18] ARC: [plat-eznps] Use dedicated identity auxiliary register.
Date: Tue, 1 Dec 2015 15:03:02 +0200	[thread overview]
Message-ID: <1448974985-11487-16-git-send-email-noamc@ezchip.com> (raw)
In-Reply-To: <1448974985-11487-1-git-send-email-noamc@ezchip.com>

From: Noam Camus <noamc@ezchip.com>

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 at ezchip.com>
---
 arch/arc/include/asm/entry-compact.h |    8 ++++++++
 arch/arc/kernel/ctx_sw.c             |   13 +++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arc/include/asm/entry-compact.h b/arch/arc/include/asm/entry-compact.h
index 1aff3be..bf9a6a1 100644
--- a/arch/arc/include/asm/entry-compact.h
+++ b/arch/arc/include/asm/entry-compact.h
@@ -35,6 +35,7 @@
 #include <asm/asm-offsets.h>
 #include <asm/irqflags-compact.h>
 #include <asm/thread_info.h>	/* For THREAD_SIZE */
+#include <plat/ctop.h>
 
 /*--------------------------------------------------------------
  * Switch to Kernel Mode stack if SP points to User Mode stack
@@ -298,9 +299,16 @@
 
 /* Get CPU-ID of this core */
 .macro  GET_CPU_ID  reg
+#ifdef CONFIG_ARC_PLAT_EZNPS
+	lr  \reg, [CTOP_AUX_LOGIC_GLOBAL_ID]
+#ifndef CONFIG_EZNPS_MTM_EXT
+	lsr \reg, \reg, 4
+#endif
+#else
 	lr  \reg, [identity]
 	lsr \reg, \reg, 8
 	bmsk \reg, \reg, 7
+#endif
 .endm
 
 #endif  /* __ASM_ARC_ENTRY_COMPACT_H */
diff --git a/arch/arc/kernel/ctx_sw.c b/arch/arc/kernel/ctx_sw.c
index 5d446df..6f4cb0d 100644
--- a/arch/arc/kernel/ctx_sw.c
+++ b/arch/arc/kernel/ctx_sw.c
@@ -16,6 +16,9 @@
 
 #include <asm/asm-offsets.h>
 #include <linux/sched.h>
+#ifdef CONFIG_ARC_PLAT_EZNPS
+#include <plat/ctop.h>
+#endif
 
 #define KSP_WORD_OFF 	((TASK_THREAD + THREAD_KSP) / 4)
 
@@ -67,9 +70,16 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
 #ifndef CONFIG_SMP
 		"st  %2, [@_current_task]	\n\t"
 #else
+#ifdef CONFIG_ARC_PLAT_EZNPS
+		"lr   r24, [%4]		\n\t"
+#ifndef CONFIG_EZNPS_MTM_EXT
+		"lsr  r24, r24, 4		\n\t"
+#endif
+#else
 		"lr   r24, [identity]		\n\t"
 		"lsr  r24, r24, 8		\n\t"
 		"bmsk r24, r24, 7		\n\t"
+#endif
 		"add2 r24, @_current_task, r24	\n\t"
 		"st   %2,  [r24]		\n\t"
 #endif
@@ -107,6 +117,9 @@ __switch_to(struct task_struct *prev_task, struct task_struct *next_task)
 
 		: "=r"(tmp)
 		: "n"(KSP_WORD_OFF), "r"(next), "r"(prev)
+#ifdef CONFIG_ARC_PLAT_EZNPS
+		, "i"(CTOP_AUX_LOGIC_GLOBAL_ID)
+#endif
 		: "blink"
 	);
 
-- 
1.7.1

  parent reply	other threads:[~2015-12-01 13:09 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 13:02 [PATCH v3 00/18] *** SUBJECT HERE *** Noam Camus
2015-12-01 13:02 ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 01/18] Documentation: Add EZchip vendor to binding list Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-04  8:07   ` Daniel Lezcano
2015-12-04  8:07     ` Daniel Lezcano
2015-12-04 11:46     ` Noam Camus
2015-12-04 11:46       ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 02/18] ARC: [plat-eznps] define IPI_IRQ Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 03/18] clocksource: Add NPS400 timers driver Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-04  9:13   ` Daniel Lezcano
2015-12-04  9:13     ` Daniel Lezcano
2015-12-04 12:26     ` Noam Camus
2015-12-04 12:26       ` Noam Camus
2015-12-04 12:52       ` Daniel Lezcano
2015-12-04 12:52         ` Daniel Lezcano
2015-12-08 13:00     ` Noam Camus
2015-12-08 13:00       ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 04/18] irqchip: add nps Internal and external irqchips Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:29   ` Marc Zyngier
2015-12-01 13:29     ` Marc Zyngier
2015-12-02 15:08     ` Noam Camus
2015-12-02 15:08       ` Noam Camus
2015-12-03 18:33       ` Marc Zyngier
2015-12-03 18:33         ` Marc Zyngier
2015-12-07 11:19         ` Noam Camus
2015-12-07 11:19           ` Noam Camus
2015-12-11  7:58     ` Vineet Gupta
2015-12-11  7:58       ` Vineet Gupta
2015-12-01 13:02 ` [PATCH v3 05/18] ARC: Set vmalloc size from configuration Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 06/18] ARC: rwlock: disable interrupts in !LLSC variant Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 07/18] ARC: rename smp operation init_irq_cpu() to init_per_cpu() Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 08/18] ARC: Mark secondary cpu online only after all HW setup is done Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 09/18] ARC: add CONFIG_CLKSRC_OF support to time_init() Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 10/18] ARC: [plat-eznps] Add eznps board defconfig and dts Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 11/18] ARC: [plat-eznps] Add eznps platform Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:02 ` [PATCH v3 12/18] ARC: [plat-eznps] Use dedicated user stack top Noam Camus
2015-12-01 13:02   ` Noam Camus
2015-12-01 13:03 ` [PATCH v3 13/18] ARC: [plat-eznps] Use dedicated atomic/bitops/cmpxchg Noam Camus
2015-12-01 13:03   ` Noam Camus
2015-12-01 13:03 ` [PATCH v3 14/18] ARC: [plat-eznps] Use dedicated SMP barriers Noam Camus
2015-12-01 13:03   ` Noam Camus
2015-12-01 13:03 ` Noam Camus [this message]
2015-12-01 13:03   ` [PATCH v3 15/18] ARC: [plat-eznps] Use dedicated identity auxiliary register Noam Camus
2015-12-01 13:03 ` [PATCH v3 16/18] ARC: [plat-eznps] Use dedicated cpu_relax() Noam Camus
2015-12-01 13:03   ` Noam Camus
2015-12-01 13:03 ` [PATCH v3 17/18] ARC: [plat-eznps] Use dedicated COMMAND_LINE_SIZE Noam Camus
2015-12-01 13:03   ` Noam Camus
2015-12-01 13:03 ` [PATCH v3 18/18] ARC: Add eznps platform to Kconfig and Makefile Noam Camus
2015-12-01 13:03   ` Noam Camus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448974985-11487-16-git-send-email-noamc@ezchip.com \
    --to=noamc@ezchip.com \
    --cc=cmetcalf@ezchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.