From: Wei Huang <wei@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>,
Shannon Zhao <zhaoshenglong@huawei.com>
Cc: peter.maydell@linaro.org, graeme.gregory@linaro.org,
mst@redhat.com, qemu-devel@nongnu.org,
peter.huangpeng@huawei.com, qemu-arm@nongnu.org,
shannon.zhao@linaro.org
Subject: Re: [Qemu-devel] [PATCH v4 2/8] ARM: ACPI: Add GPIO controller in ACPI DSDT table
Date: Thu, 10 Dec 2015 13:16:22 -0600 [thread overview]
Message-ID: <5669CF86.1080003@redhat.com> (raw)
In-Reply-To: <20151210142253.465ec214@igors-macbook-pro.local>
On 12/10/2015 07:22 AM, Igor Mammedov wrote:
> On Mon, 7 Dec 2015 15:39:46 +0800
> Shannon Zhao <zhaoshenglong@huawei.com> wrote:
>
>> From: Shannon Zhao <shannon.zhao@linaro.org>
>>
>> Add GPIO controller in ACPI DSDT table. It can be used for gpio event.
>>
>> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
>> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
>> Tested-by: Wei Huang <wei@redhat.com>
>> ---
>> hw/arm/virt-acpi-build.c | 19 +++++++++++++++++++
>> 1 file changed, 19 insertions(+)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 3c2c5d6..bf6b934 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -323,6 +323,23 @@ static void acpi_dsdt_add_pci(Aml *scope, const
>> MemMapEntry *memmap, int irq, aml_append(scope, dev);
>> }
>>
>> +static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry
>> *gpio_memmap,
>> + int gpio_irq)
> s/int/uint32_t/
>
>> +{
>> + Aml *dev = aml_device("GPO0");
>> + aml_append(dev, aml_name_decl("_HID", aml_string("ARMH0061")));
> What spec "ARMH0061" comes from?
> Probably it should be mentioned in comment.
I tried to find the official source for this definition several weeks
ago, but failed. Later, in private, Al Stone confirmed with me that
ARMH0061 is the right one. Maybe ARM or Linaro should push this
definition into ACPI spec or somewhere else in a formal way.
>
>> + aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
>> + aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>> +
>> + Aml *crs = aml_resource_template();
>> + aml_append(crs, aml_memory32_fixed(gpio_memmap->base,
>> gpio_memmap->size,
>> + AML_READ_WRITE));
>> + aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL,
>> AML_ACTIVE_HIGH,
>> + AML_EXCLUSIVE, gpio_irq));
> that conflicts with
> https://github.com/imammedo/qemu/commit/acb34e533bc31fdf3eb6230c93654b0b0ae4e76e
> perhaps you could include it in your series and redo this hunk
> to take array instead of int.
>
>
>> + aml_append(dev, aml_name_decl("_CRS", crs));
>> + aml_append(scope, dev);
>> +}
>> +
>> /* RSDP */
>> static GArray *
>> build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt)
>> @@ -539,6 +556,8 @@ build_dsdt(GArray *table_data, GArray *linker,
>> VirtGuestInfo *guest_info) (irqmap[VIRT_MMIO] + ARM_SPI_BASE),
>> NUM_VIRTIO_TRANSPORTS); acpi_dsdt_add_pci(scope, memmap,
>> (irqmap[VIRT_PCIE] + ARM_SPI_BASE), guest_info->use_highmem);
>> + acpi_dsdt_add_gpio(scope, &memmap[VIRT_GPIO],
>> + (irqmap[VIRT_GPIO] + ARM_SPI_BASE));
>>
>> aml_append(dsdt, scope);
>>
>
next prev parent reply other threads:[~2015-12-10 19:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-07 7:39 [Qemu-devel] [PATCH v4 0/8] Add system_powerdown support on ARM for ACPI and DT Shannon Zhao
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 1/8] ARM: Virt: Add a GPIO controller Shannon Zhao
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 2/8] ARM: ACPI: Add GPIO controller in ACPI DSDT table Shannon Zhao
2015-12-10 13:22 ` Igor Mammedov
2015-12-10 19:16 ` Wei Huang [this message]
2015-12-10 20:13 ` Igor Mammedov
2015-12-11 1:35 ` Shannon Zhao
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 3/8] ARM: ACPI: Add power button device " Shannon Zhao
2015-12-10 20:23 ` Igor Mammedov
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 4/8] ACPI: Add GPIO Connection Descriptor Shannon Zhao
2015-12-10 20:14 ` Igor Mammedov
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 5/8] ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection Shannon Zhao
2015-12-10 20:16 ` Igor Mammedov
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 6/8] ARM: ACPI: Add _E03 for Power Button Shannon Zhao
2015-12-10 20:09 ` Igor Mammedov
2015-12-11 1:52 ` Shannon Zhao
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 7/8] ARM: Virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3 Shannon Zhao
2015-12-07 7:39 ` [Qemu-devel] [PATCH v4 8/8] ARM: Virt: Add gpio-keys node for Poweroff using DT Shannon Zhao
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=5669CF86.1080003@redhat.com \
--to=wei@redhat.com \
--cc=graeme.gregory@linaro.org \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=peter.huangpeng@huawei.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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 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).