qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Alexander Graf
Subject: [Qemu-devel] [PATCH 0/3] PPC: E500: Add power off GPIO
Date: Wed, 1 Oct 2014 16:15:39 +0200

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

-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]