Aarch64 powerdown: add support for GPIO power key #2076
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If ACPI tables are not present in a given Qemu aarch64 instance (e.g. when running an instance with the "virt" machine type and without a UEFI firmware), upon reception of the "system_powerdown" command (which is used to gracefully shut down the instance), Qemu toggles the "poweroff" GPIO instead of generating an ACPI event.
This change set adds parsing of GPIO key information from the device tree, and if such information can be found, enables interrupt generation on the PL061 GPIO controller when the poweroff GPIO is toggled, so that the kernel can be shut down by the interrupt handler.
This allows a graceful shutdown to be performed when an on-prem instance launched with
ops run --arch=arm64
is terminated with CTRL-C.