qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Shannon Zhao <zhaoshenglong@huawei.com>
Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, mst@redhat.com,
	a.spyridakis@virtualopensystems.com, claudio.fontana@huawei.com,
	qemu-devel@nongnu.org, peter.huangpeng@huawei.com,
	alex.bennee@linaro.org, hanjun.guo@linaro.org,
	pbonzini@redhat.com, lersek@redhat.com,
	christoffer.dall@linaro.org, shannon.zhao@linaro.org
Subject: Re: [Qemu-devel] [PATCH v8 06/24] hw/acpi/aml-build: Add aml_interrupt() term
Date: Thu, 21 May 2015 10:17:06 +0200	[thread overview]
Message-ID: <20150521101706.4345fe65@nial.brq.redhat.com> (raw)
In-Reply-To: <1432175331-12548-7-git-send-email-zhaoshenglong@huawei.com>

On Thu, 21 May 2015 10:28:33 +0800
Shannon Zhao <zhaoshenglong@huawei.com> wrote:

> From: Shannon Zhao <shannon.zhao@linaro.org>
> 
> Add aml_interrupt() for describing device interrupt in resource template.
> These can be used to generating DSDT table for ACPI on ARM.
> 
> Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
> Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/acpi/aml-build.c         | 27 +++++++++++++++++++++++++++
>  include/hw/acpi/aml-build.h | 42 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 69 insertions(+)
> 
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index ad4d7ea..0d99941 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -533,6 +533,33 @@ Aml *aml_memory32_fixed(uint32_t addr, uint32_t size,
>      return var;
>  }
>  
> +/*
> + * ACPI 5.0: 6.4.3.6 Extended Interrupt Descriptor
> + * Type 1, Large Item Name 0x9
> + */
> +Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro,
> +                   AmlLevelAndEdge level_and_edge,
> +                   AmlActiveHighAndLow high_and_low, AmlShared shared,
> +                   uint32_t irq)
> +{
> +    Aml *var = aml_alloc();
> +    uint8_t irq_flags = con_and_pro | (level_and_edge << 1)
> +                        | (high_and_low << 2) | (shared << 3);
> +
> +    build_append_byte(var->buf, 0x89); /* Extended irq descriptor */
> +    build_append_byte(var->buf, 6); /* Length, bits[7:0] minimum value = 6 */
> +    build_append_byte(var->buf, 0); /* Length, bits[15:8] minimum value = 0 */
> +    build_append_byte(var->buf, irq_flags); /* Interrupt Vector Information. */
> +    build_append_byte(var->buf, 0x01);      /* Interrupt table length = 1 */
> +
> +    /* Interrupt Number */
> +    build_append_byte(var->buf, extract32(irq, 0, 8));  /* bits[7:0] */
> +    build_append_byte(var->buf, extract32(irq, 8, 8));  /* bits[15:8] */
> +    build_append_byte(var->buf, extract32(irq, 16, 8)); /* bits[23:16] */
> +    build_append_byte(var->buf, extract32(irq, 24, 8)); /* bits[31:24] */
> +    return var;
> +}
> +
>  /* ACPI 1.0b: 6.4.2.5 I/O Port Descriptor */
>  Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
>              uint8_t aln, uint8_t len)
> diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
> index bd0d9e7..df23479 100644
> --- a/include/hw/acpi/aml-build.h
> +++ b/include/hw/acpi/aml-build.h
> @@ -111,6 +111,44 @@ typedef enum {
>      AML_READ_WRITE = 1,
>  } AmlReadAndWrite;
>  
> +/*
> + * ACPI 5.0: Table 6-187 Extended Interrupt Descriptor Definition
> + * Interrupt Vector Flags Bits[0] Consumer/Producer
> + */
> +typedef enum {
> +    AML_CONSUMER_PRODUCER = 0,
> +    AML_CONSUMER = 1,
> +} AmlConsumerAndProducer;
> +
> +/*
> + * ACPI 5.0: Table 6-187 Extended Interrupt Descriptor Definition
> + * _HE field definition
> + */
> +typedef enum {
> +    AML_LEVEL = 0,
> +    AML_EDGE = 1,
> +} AmlLevelAndEdge;
> +
> +/*
> + * ACPI 5.0: Table 6-187 Extended Interrupt Descriptor Definition
> + * _LL field definition
> + */
> +typedef enum {
> +    AML_ACTIVE_HIGH = 0,
> +    AML_ACTIVE_LOW = 1,
> +} AmlActiveHighAndLow;
> +
> +/*
> + * ACPI 5.0: Table 6-187 Extended Interrupt Descriptor Definition
> + * _SHR field definition
> + */
> +typedef enum {
> +    AML_EXCLUSIVE = 0,
> +    AML_SHARED = 1,
> +    AML_EXCLUSIVE_AND_WAKE = 2,
> +    AML_SHARED_AND_WAKE = 3,
> +} AmlShared;
> +
>  typedef
>  struct AcpiBuildTables {
>      GArray *table_data;
> @@ -170,6 +208,10 @@ Aml *aml_call3(const char *method, Aml *arg1, Aml *arg2, Aml *arg3);
>  Aml *aml_call4(const char *method, Aml *arg1, Aml *arg2, Aml *arg3, Aml *arg4);
>  Aml *aml_memory32_fixed(uint32_t addr, uint32_t size,
>                          AmlReadAndWrite read_and_write);
> +Aml *aml_interrupt(AmlConsumerAndProducer con_and_pro,
> +                   AmlLevelAndEdge level_and_edge,
> +                   AmlActiveHighAndLow high_and_low, AmlShared shared,
> +                   uint32_t irq);
>  Aml *aml_io(AmlIODecode dec, uint16_t min_base, uint16_t max_base,
>              uint8_t aln, uint8_t len);
>  Aml *aml_operation_region(const char *name, AmlRegionSpace rs,

  reply	other threads:[~2015-05-21  8:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-21  2:28 [Qemu-devel] [PATCH v8 00/24] Generate ACPI v5.1 tables and expose them to guest over fw_cfg on ARM Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 01/24] hw/acpi/aml-build: Make enum values to be upper case to match coding style Shannon Zhao
2015-05-21  8:12   ` Igor Mammedov
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 02/24] hw/arm/virt: Move common definitions to virt.h Shannon Zhao
2015-05-21  8:25   ` Igor Mammedov
2015-05-21  9:19     ` Peter Maydell
2015-05-21  9:42     ` Laszlo Ersek
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 03/24] hw/arm/virt: Record PCIe ranges in MemMapEntry array Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 04/24] hw/arm/virt-acpi-build: Basic framework for building ACPI tables on ARM Shannon Zhao
2015-05-21  8:32   ` Igor Mammedov
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 05/24] hw/acpi/aml-build: Add aml_memory32_fixed() term Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 06/24] hw/acpi/aml-build: Add aml_interrupt() term Shannon Zhao
2015-05-21  8:17   ` Igor Mammedov [this message]
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 07/24] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices Shannon Zhao
2015-05-21  8:42   ` Igor Mammedov
2015-05-21  9:10     ` Shannon Zhao
2015-05-21  9:22       ` Igor Mammedov
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 08/24] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 09/24] hw/arm/virt-acpi-build: Generate MADT table Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 10/24] hw/arm/virt-acpi-build: Generate GTDT table Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 11/24] hw/arm/virt-acpi-build: Generate RSDT table Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 12/24] hw/arm/virt-acpi-build: Generate RSDP table Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 13/24] hw/arm/virt-acpi-build: Generate MCFG table Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 14/24] hw/acpi/aml-build: Make aml_buffer() definition consistent with the spec Shannon Zhao
2015-05-21  8:19   ` Igor Mammedov
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 15/24] hw/acpi/aml-build: Add ToUUID macro Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 16/24] hw/acpi/aml-build: Add aml_or() term Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 17/24] hw/acpi/aml-build: Add aml_lnot() term Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 18/24] hw/acpi/aml-build: Add aml_else() term Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 19/24] hw/acpi/aml-build: Add aml_create_dword_field() term Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 20/24] hw/acpi/aml-build: Add aml_dword_io() term Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 21/24] hw/acpi/aml-build: Add Unicode macro Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 22/24] hw/arm/virt-acpi-build: Add PCIe controller in ACPI DSDT table Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 23/24] ACPI: split CONFIG_ACPI into 4 pieces Shannon Zhao
2015-05-21  2:28 ` [Qemu-devel] [PATCH v8 24/24] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables 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=20150521101706.4345fe65@nial.brq.redhat.com \
    --to=imammedo@redhat.com \
    --cc=a.spyridakis@virtualopensystems.com \
    --cc=alex.bennee@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=claudio.fontana@huawei.com \
    --cc=hangaohuai@huawei.com \
    --cc=hanjun.guo@linaro.org \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@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 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).