Skip to content

Commit 2b0a438

Browse files
paulusmackmaddy-kerneldev
authored andcommitted
powerpc/microwatt: Define an idle power-save function
This uses the 'wait' instruction to pause instruction execution when idle until an interrupt occurs. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/Z5xtl1m_Gqc-HLjY@thinks.paulus.ozlabs.org
1 parent 78099fe commit 2b0a438

File tree

1 file changed

+9
-0
lines changed
  • arch/powerpc/platforms/microwatt

1 file changed

+9
-0
lines changed

arch/powerpc/platforms/microwatt/setup.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,19 @@ static void __init microwatt_setup_arch(void)
3434
microwatt_rng_init();
3535
}
3636

37+
static void microwatt_idle(void)
38+
{
39+
if (!prep_irq_for_idle_irqsoff())
40+
return;
41+
42+
__asm__ __volatile__ ("wait");
43+
}
44+
3745
define_machine(microwatt) {
3846
.name = "microwatt",
3947
.compatible = "microwatt-soc",
4048
.init_IRQ = microwatt_init_IRQ,
4149
.setup_arch = microwatt_setup_arch,
4250
.progress = udbg_progress,
51+
.power_save = microwatt_idle,
4352
};

0 commit comments

Comments
 (0)