From: Alexander Graf <agraf@suse.de>
To: qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 0/3] PPC: E500: Add power off GPIO
Date: Wed, 1 Oct 2014 16:15:39 +0200 [thread overview]
Message-ID: <1412172942-63151-1-git-send-email-agraf@suse.de> (raw)
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
next reply other threads:[~2014-10-01 14:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 14:15 Alexander Graf [this message]
2014-10-01 14:15 ` [Qemu-devel] [PATCH 1/3] PPC: Add MPC8XXX gpio controller Alexander Graf
2014-10-01 14:15 ` [Qemu-devel] [PATCH 2/3] PPC: E500: Instantiate MPC8XXX gpio controller on virt machine Alexander Graf
2014-10-01 14:15 ` [Qemu-devel] [PATCH 3/3] PPC: E500: Hook up power off GPIO to GPIO controller Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1412172942-63151-1-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).