]> git.proxmox.com Git - mirror_qemu.git/commit - target/openrisc/machine.c
target/openrisc: Support non-busy idle state using PMR SPR
authorStafford Horne <shorne@gmail.com>
Sun, 23 Apr 2017 21:07:42 +0000 (06:07 +0900)
committerStafford Horne <shorne@gmail.com>
Thu, 4 May 2017 00:39:14 +0000 (09:39 +0900)
commitf4d1414a9385e3375d9107b29eeb75d27daf2147
tree91182987a6331fc44772a6179e170163b9635706
parent48a1b62baaf45e4d8d5ffac77647f7e898d7f7f1
target/openrisc: Support non-busy idle state using PMR SPR

The OpenRISC architecture has the Power Management Register (PMR)
special purpose register to manage cpu power states.  The interesting
modes are:

 * Doze Mode (DME) - Stop cpu except timer & pic - wake on interrupt
 * Sleep Mode (SME) - Stop cpu and all units - wake on interrupt
 * Suspend Model (SUME) - Stop cpu and all units - wake on reset

The linux kernel will set DME when idle.

This patch implements the PMR SPR and halts the qemu cpu when there is a
change to DME or SME.  This means that openrisc qemu in no longer peggs
a host cpu at 100%.

In order for this to work we need to kick the CPU when timers are
expired.  Update the cpu timer to kick the cpu upon each timer event.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stafford Horne <shorne@gmail.com>
hw/openrisc/cputimer.c
target/openrisc/cpu.c
target/openrisc/cpu.h
target/openrisc/interrupt.c
target/openrisc/machine.c
target/openrisc/sys_helper.c