Ver Fonte

ARC: [plat-eznps] use schd.wft instruction instead of sleep at idle task

When HW threads are active we want CPU to enter idle state only
for the calling HW thread and not to put on sleep all HW threads
sharing this core. For this need the NPS400 got dedicated instruction
so only calling thread is entring sleep and all other are still awake
and can execute instructions.

Signed-off-by: Noam Camus <noamca@mellanox.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[vgupta: reworked patch to not use inline ifdef but a new function itself]
Noam Camus há 8 anos atrás
pai
commit
644fa02b39
2 ficheiros alterados com 13 adições e 1 exclusões
  1. 12 1
      arch/arc/kernel/process.c
  2. 1 0
      arch/arc/plat-eznps/include/plat/ctop.h

+ 12 - 1
arch/arc/kernel/process.c

@@ -92,7 +92,18 @@ void arch_cpu_idle(void)
 		:"I"(arg)); /* can't be "r" has to be embedded const */
 		:"I"(arg)); /* can't be "r" has to be embedded const */
 }
 }
 
 
-#else
+#elif defined(CONFIG_EZNPS_MTM_EXT)	/* ARC700 variant in NPS */
+
+void arch_cpu_idle(void)
+{
+	/* only the calling HW thread needs to sleep */
+	__asm__ __volatile__(
+		".word %0	\n"
+		:
+		:"i"(CTOP_INST_HWSCHD_WFT_IE12));
+}
+
+#else	/* ARC700 */
 
 
 void arch_cpu_idle(void)
 void arch_cpu_idle(void)
 {
 {

+ 1 - 0
arch/arc/plat-eznps/include/plat/ctop.h

@@ -46,6 +46,7 @@
 #define CTOP_AUX_UDMC				(CTOP_AUX_BASE + 0x300)
 #define CTOP_AUX_UDMC				(CTOP_AUX_BASE + 0x300)
 
 
 /* EZchip core instructions */
 /* EZchip core instructions */
+#define CTOP_INST_HWSCHD_WFT_IE12		0x3E6F7344
 #define CTOP_INST_HWSCHD_OFF_R4			0x3C6F00BF
 #define CTOP_INST_HWSCHD_OFF_R4			0x3C6F00BF
 #define CTOP_INST_HWSCHD_RESTORE_R4		0x3E6F7103
 #define CTOP_INST_HWSCHD_RESTORE_R4		0x3E6F7103
 #define CTOP_INST_SCHD_RW			0x3E6F7004
 #define CTOP_INST_SCHD_RW			0x3E6F7004