[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v5 00/10] Add system_powerdown support on ARM for ACPI
From: |
Shannon Zhao |
Subject: |
[Qemu-arm] [PATCH v5 00/10] Add system_powerdown support on ARM for ACPI and DT |
Date: |
Fri, 11 Dec 2015 11:21:16 +0800 |
From: Shannon Zhao <address@hidden>
ACPI SPEC 5.0 defines GPIO-signaled ACPI Events for Hardware-reduced
platforms(like ARM). It uses GPIO pin to trigger an event to the guest.
For QEMU, here we add PL061 GPIO controller and use PIN 3 for
system_powerdown, reserving PIN 0, 1, 2 for PCI hotplug, CPU hotplug and
memory hotplug.
This patchset adds system_powerdown support on ARM through both ACPI and
DT ways. It adds a GPIO controller(here is PL061) in machine virt and
uses GPIO-singled event for ACPI while gpio-keys for DT. It has been
tested for the guests starting by ACPI or DT while guests use systemd or
acpid.
a) ACPI way. Since Graeme send a patchset to make ACPI on ARM64 support
amba device[1], it could use PL061 directly without modification to its
kernel driver code. In addition, we should use ACPI to start VM,
referring to below script. QEMU_EFI.fd can be fetched from [2].
qemu-system-aarch64 \
-smp 1 -m 1024 -M virt \
-cpu cortex-a57 -nographic \
-monitor telnet::4444,server,nowait \
-bios QEMU_EFI.fd \
-kernel Image \
-initrd guestfs.cpio.gz \
-append "rdinit=/sbin/init console=ttyAMA0 mem=512M root=/dev/ram
earlycon=pl011,0x9000000 rw acpi=force"
b) DT way. Start vm as usual.
qemu-system-aarch64 \
-smp 1 -m 1024 -M virt \
-cpu cortex-a57 -nographic \
-monitor telnet::4444,server,nowait \
-kernel Image \
-initrd guestfs.cpio.gz \
-append "rdinit=/sbin/init console=ttyAMA0 mem=512M root=/dev/ram
earlycon=pl011,0x9000000 rw"
Guest internal setup:
If your guest FS uses systemd, you should check file
/lib/udev/rules.d/70-power-switch.rules and add the following line in it
if it doesn't exist.
SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="platform",
ATTRS{keys}=="116", TAG+="power-switch"
If your guest FS uses acpid, you should check it has
/etc/acpi/powerbtn.sh and /etc/acpi/events/powerbtn. Refer to [3] for
the setup of acpid.
Thanks,
Shannon
[1] https://lkml.org/lkml/2015/9/30/392
[2] http://people.linaro.org/~shannon.zhao/ACPI_ARM/QEMU_EFI.fd
[3] https://wiki.linaro.org/LEG/Engineering/Kernel/ACPI/GPIOPowerButton
Changes since v4:
* Include two ACPI AML API patches which change the use of those API,
rebase this patch set on top of them
* Use new aml_interrupt() in PATCH 4
* Use new aml_method() and AML_CONSUMER for aml_gpio_int() in PATCH 8
Changes since v3:
* address Igor's comments on ACPI part
* drop "autorepeat" for /gpio-keys
Changes since v2:
* rebased on upstream QEMU
* adjust irq signalling for PowerButton of PATCH 7/8 (Peter Maydell)
* Add several Reviewed-bys and Tested-bys from Wei Huang, thanks!
Changes since v1:
* rewrite GPIO Connection Descriptor (Michael)
Igor Mammedov (1):
acpi: extend aml_interrupt() to support multiple irqs
Shannon Zhao (8):
ARM: Virt: Add a GPIO controller
ARM: ACPI: Add GPIO controller in ACPI DSDT table
ARM: ACPI: Add power button device in ACPI DSDT table
ACPI: Add GPIO Connection Descriptor
ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection
ARM: ACPI: Add _E03 for Power Button
ARM: Virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3
ARM: Virt: Add gpio-keys node for Poweroff using DT
Xiao Guangrong (1):
acpi: support serialized method
hw/acpi/aml-build.c | 127 ++++++++++++++++++++++++++++++++++++++++----
hw/arm/virt-acpi-build.c | 77 +++++++++++++++++++++------
hw/arm/virt.c | 60 +++++++++++++++++++++
hw/i386/acpi-build.c | 41 +++++++-------
include/hw/acpi/aml-build.h | 37 ++++++++++++-
include/hw/arm/virt.h | 1 +
6 files changed, 294 insertions(+), 49 deletions(-)
--
2.0.4
- [Qemu-arm] [PATCH v5 00/10] Add system_powerdown support on ARM for ACPI and DT,
Shannon Zhao <=