Skip to content

Commit

Permalink
powerpc/microwatt: Define an idle power-save function
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Paul Mackerras authored and Madhavan Srinivasan committed Feb 26, 2025
1 parent 78099fe commit 2b0a438
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/powerpc/platforms/microwatt/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,19 @@ static void __init microwatt_setup_arch(void)
microwatt_rng_init();
}

static void microwatt_idle(void)
{
if (!prep_irq_for_idle_irqsoff())
return;

__asm__ __volatile__ ("wait");
}

define_machine(microwatt) {
.name = "microwatt",
.compatible = "microwatt-soc",
.init_IRQ = microwatt_init_IRQ,
.setup_arch = microwatt_setup_arch,
.progress = udbg_progress,
.power_save = microwatt_idle,
};

0 comments on commit 2b0a438

Please sign in to comment.