Skip to content

PPC: E500: Add power off GPIO

Alexander Graf qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3PPC: Add MPC8XXX gpio controllerhw/gpio/Makefile.objs hw/gpio/mpc8xxx.c+218 -00 replies
2/3PPC: E500: Instantiate MPC8XXX gpio controller on virt machinehw/ppc/e500.c hw/ppc/e500.h hw/ppc/e500plat.c+34 -00 replies
3/3PPC: E500: Hook up power off GPIO to GPIO controllerhw/ppc/e500.c+24 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] PPC: E500: Add power off GPIO

When running a virtual machine, you eventually want to shut it down and see it properly end the QEMU process. The magic that makes this work is the "power off" code path that a guest OS uses to indicate that it wants to power off the host machine.

This logic was missing from our e500 virt machine. The easiest way to implement this is to expose a GPIO to the guest that allows the virtual machine to indicate to QEMU that it wants to power down now.

To expose this GPIO to the guest, we need to add a GPIO controller, the GPIO hookup and some description in device tree. This is what this patch set does.

We only support this for the e500 virt machine though, as the mpc8544ds does not support power off from an OS.

To make use of this logic, you will also need patches to Linux that enable it to register the gpio-poweroff driver:

https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-October/121532.html

And you need to make sure that the following options are enabled in your guest kernel:

CONFIG_POWER_SUPPLY=y
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_GPIO=y

Alexander Graf (3):
PPC: Add MPC8XXX gpio controller
PPC: E500: Instantiate MPC8XXX gpio controller on virt machine
PPC: E500: Hook up power off GPIO to GPIO controller

 hw/gpio/Makefile.objs |   1 +
 hw/gpio/mpc8xxx.c     | 217 ++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/ppc/e500.c         |  56 +++++++++++++
 hw/ppc/e500.h         |   1 +
 hw/ppc/e500plat.c     |   1 +
 5 files changed, 276 insertions(+)
 create mode 100644 hw/gpio/mpc8xxx.c
Signature · 1 line
1.8.1.4