All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Huang <wei@redhat.com>
To: Shannon Zhao <shannon.zhao@linaro.org>,
	qemu-devel@nongnu.org, peter.maydell@linaro.org, mst@redhat.com,
	imammedo@redhat.com
Cc: peter.huangpeng@huawei.com, zhaoshenglong@huawei.com
Subject: Re: [Qemu-devel] [PATCH v2 3/8] hw/arm/virt-acpi-build: Add power button device in ACPI DSDT table
Date: Tue, 10 Nov 2015 23:09:52 -0600	[thread overview]
Message-ID: <5642CDA0.8010102@redhat.com> (raw)
In-Reply-To: <1446128855-26637-4-git-send-email-shannon.zhao@linaro.org>



On 10/29/2015 09:27 AM, Shannon Zhao wrote:
> Add power button device in ACPI DSDT table.
> 
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> ---
>  hw/arm/virt-acpi-build.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index ffb9b91..80ce51c 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -339,6 +339,18 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap,
>      aml_append(scope, dev);
>  }
>  
> +static void acpi_dsdt_add_power_button(Aml *scope)
> +{
> +    Aml *dev = aml_device("PWRB");
> +    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C0C")));
> +    aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
> +    aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> +    Aml *method = aml_method("_STA", 0);
> +    aml_append(method, aml_return(aml_int(0x0F)));

_STA returns 0x0F means PWRB is a functional device; that is good for
OSPM. Plus I have tested the whole thing using ACPI-enabled guest VM;
that means PWRB was probed correctly. So,

Reviewed-by: Wei Huang <wei@redhat.com>

> +    aml_append(dev, method);
> +    aml_append(scope, dev);
> +}
> +
>  /* RSDP */
>  static GArray *
>  build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt)
> @@ -553,6 +565,7 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)
>                        guest_info->use_highmem);
>      acpi_dsdt_add_gpio(scope, &memmap[VIRT_GPIO],
>                         (irqmap[VIRT_GPIO] + ARM_SPI_BASE));
> +    acpi_dsdt_add_power_button(scope);
>  
>      aml_append(dsdt, scope);
>  
> 

  reply	other threads:[~2015-11-11  5:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 14:27 [Qemu-devel] [PATCH v2 0/8] Add system_powerdown support on ARM for ACPI and DT Shannon Zhao
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 1/8] hw/arm/virt: Add a GPIO controller Shannon Zhao
2015-11-10 22:42   ` Wei Huang
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 2/8] hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table Shannon Zhao
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 3/8] hw/arm/virt-acpi-build: Add power button device " Shannon Zhao
2015-11-11  5:09   ` Wei Huang [this message]
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 4/8] hw/acpi/aml-build: Add GPIO Connection Descriptor Shannon Zhao
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 5/8] hw/acpi/aml-build: Add a wrapper for GPIO Interrupt Connection Shannon Zhao
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 6/8] hw/arm/virt-acpi-build: Add _E03 for Power Button Shannon Zhao
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 7/8] hw/arm/virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3 Shannon Zhao
2015-11-11  6:57   ` Wei Huang
2015-11-11  8:52     ` Peter Maydell
2015-10-29 14:27 ` [Qemu-devel] [PATCH v2 8/8] hw/arm/virt: Add gpio-keys node for Poweroff using DT Shannon Zhao
2015-10-29 18:17 ` [Qemu-devel] [PATCH v2 0/8] Add system_powerdown support on ARM for ACPI and DT Wei Huang
2015-10-30  1:09   ` Shannon Zhao
2015-11-10 17:38 ` Wei Huang
2015-11-10 20:56   ` Wei Huang
2015-11-11  1:29     ` Shannon Zhao
2015-11-11  8:36       ` Peter Maydell
2015-11-11  8:53         ` Shannon Zhao
2015-11-27 17:18 ` Peter Maydell
2015-12-02 12:15   ` Igor Mammedov

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=5642CDA0.8010102@redhat.com \
    --to=wei@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhao@linaro.org \
    --cc=zhaoshenglong@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.