Skip to content

Commit 644fa02

Browse files
Noam Camusvineetgarc
authored andcommitted
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]
1 parent 64f42ce commit 644fa02

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎arch/arc/kernel/process.c‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,18 @@ void arch_cpu_idle(void)
9292
:"I"(arg)); /* can't be "r" has to be embedded const */
9393
}
9494

95-
#else
95+
#elif defined(CONFIG_EZNPS_MTM_EXT) /* ARC700 variant in NPS */
96+
97+
void arch_cpu_idle(void)
98+
{
99+
/* only the calling HW thread needs to sleep */
100+
__asm__ __volatile__(
101+
".word %0 \n"
102+
:
103+
:"i"(CTOP_INST_HWSCHD_WFT_IE12));
104+
}
105+
106+
#else /* ARC700 */
96107

97108
void arch_cpu_idle(void)
98109
{

‎arch/arc/plat-eznps/include/plat/ctop.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#define CTOP_AUX_UDMC (CTOP_AUX_BASE + 0x300)
4747

4848
/* EZchip core instructions */
49+
#define CTOP_INST_HWSCHD_WFT_IE12 0x3E6F7344
4950
#define CTOP_INST_HWSCHD_OFF_R4 0x3C6F00BF
5051
#define CTOP_INST_HWSCHD_RESTORE_R4 0x3E6F7103
5152
#define CTOP_INST_SCHD_RW 0x3E6F7004

0 commit comments

Comments
 (0)