Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aarch64 powerdown: add support for GPIO power key #2076

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

francescolavra
Copy link
Member

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.

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.
Add parsing of GPIO key information from the device tree, and if
such information can be found, enable 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.
@francescolavra francescolavra merged commit 338d1d1 into master Nov 15, 2024
7 checks passed
@francescolavra francescolavra deleted the feature/gpio-keys branch November 15, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant