All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: Shannon Zhao <zhaoshenglong@huawei.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Andrea Bolognani <abologna@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] hw/arm/virt-acpi-build: Add second UART to ACPI tables
Date: Tue, 12 Dec 2017 16:09:12 +0100	[thread overview]
Message-ID: <20171212150912.b5oc4dz5hxcex22q@kamzik.brq.redhat.com> (raw)
In-Reply-To: <ac182406-8011-9f19-38e7-37328434095b@redhat.com>

On Tue, Dec 12, 2017 at 12:06:39PM +0100, Laszlo Ersek wrote:
> On 12/12/17 06:53, Shannon Zhao wrote:
> > 
> > 
> > On 2017/12/8 23:02, Peter Maydell wrote:
> >> Add the second UART to the ACPI tables.
> >>
> >> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> >> ---
> >> Pure guesswork, as I don't have a UEFI setup to hand and
> >> am not familiar with ACPI table formats either...
> >> ---
> >>  hw/arm/virt-acpi-build.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >>
> >> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> >> index 3d78ff6..a38287b 100644
> >> --- a/hw/arm/virt-acpi-build.c
> >> +++ b/hw/arm/virt-acpi-build.c
> >> @@ -689,6 +689,7 @@ static void build_fadt(GArray *table_data, BIOSLinker *linker,
> >>  static void
> >>  build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> >>  {
> >> +    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
> >>      Aml *scope, *dsdt;
> >>      const MemMapEntry *memmap = vms->memmap;
> >>      const int *irqmap = vms->irqmap;
> >> @@ -706,6 +707,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms)
> >>      acpi_dsdt_add_cpus(scope, vms->smp_cpus);
> >>      acpi_dsdt_add_uart(scope, &memmap[VIRT_UART],
> >>                         (irqmap[VIRT_UART] + ARM_SPI_BASE));
> >> +    if (!vmc->no_second_uart) {
> >> +        acpi_dsdt_add_uart(scope, &memmap[VIRT_UART_2],
> >> +                           (irqmap[VIRT_UART_2] + ARM_SPI_BASE));
> >> +    }
> >>      acpi_dsdt_add_flash(scope, &memmap[VIRT_FLASH]);
> >>      acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]);
> >>      acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO],
> >>
> > Reviewed-by: Shannon Zhao <zhaoshenglong@huawei.com>
> > 
> 
> (Responding here so I don't have to manually update Shannon's email
> address while replying to patch 3/3 directly.)
> 
> acpi_dsdt_add_uart() does:
> 
>     Aml *dev = aml_device("COM0");
>     aml_append(dev, aml_name_decl("_HID", aml_string("ARMH0011")));
>     aml_append(dev, aml_name_decl("_UID", aml_int(0)));
> 
> The device name should be unique. Plus, within the same _HID, the _UID
> should be unique as well. I suggest adding another unsigned parameter to
> acpi_dsdt_add_uart(), and hooking it into COMx and _UID.

Yes, I agree with Laszlo here (and confirmed with Igor). Also, if memory
serves me, the _ADR part of acpi_dsdt_add_uart() is only there to deal
with early Linux ACPI support not finding the console UART correctly.
I believe it does now, meaning the _ADR could even be removed for COM0,
and we certainly don't want it for COM1 because it's point is to find
COM0, so the new unsigned parameter should also be used as condition for
it. A later patch could remove it altogether.

Thanks,
drew

  parent reply	other threads:[~2017-12-12 15:09 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 15:02 [Qemu-devel] [PATCH 0/3] hw/arm/virt: Add another UART Peter Maydell
2017-12-08 15:02 ` [Qemu-devel] [PATCH 1/3] hw/arm/virt: Add virt-2.12 machine type Peter Maydell
2017-12-12 14:39   ` Andrew Jones
2018-01-15 12:00     ` Peter Maydell
2017-12-08 15:02 ` [Qemu-devel] [PATCH 2/3] hw/arm/virt: Add another UART to the virt board Peter Maydell
2017-12-12  5:55   ` Shannon Zhao
2017-12-12 10:45     ` Peter Maydell
2017-12-12 14:25       ` Jason A. Donenfeld
2017-12-12 14:45   ` Andrew Jones
2017-12-12 14:50     ` Peter Maydell
2017-12-12 15:16       ` Andrew Jones
2017-12-12 15:51         ` Peter Maydell
2018-05-31  2:12           ` Jason A. Donenfeld
2018-05-31  8:32             ` Peter Maydell
2018-05-31 11:48               ` Jason A. Donenfeld
2018-05-31 11:57                 ` Peter Maydell
2017-12-12 15:16   ` Andrew Jones
2017-12-08 15:02 ` [Qemu-devel] [PATCH 3/3] hw/arm/virt-acpi-build: Add second UART to ACPI tables Peter Maydell
2017-12-12  5:53   ` Shannon Zhao
2017-12-12 11:06     ` Laszlo Ersek
2017-12-12 11:11       ` Peter Maydell
2017-12-12 11:33         ` Laszlo Ersek
2017-12-12 11:44           ` Ard Biesheuvel
2017-12-12 11:59             ` Laszlo Ersek
2017-12-12 12:07               ` Peter Maydell
2017-12-12 12:41                 ` Laszlo Ersek
2017-12-12 12:47                   ` Peter Maydell
2017-12-12 13:28                     ` Laszlo Ersek
2017-12-12 13:56                       ` Ard Biesheuvel
2017-12-12 14:10                         ` Peter Maydell
2017-12-12 14:12                           ` Ard Biesheuvel
2017-12-12 14:13                             ` Peter Maydell
2017-12-12 14:16                               ` Ard Biesheuvel
2017-12-12 14:17                                 ` Peter Maydell
2017-12-12 14:31                                   ` Ard Biesheuvel
2017-12-12 14:51                                     ` Andrew Jones
2017-12-12 16:38                                       ` Laszlo Ersek
2017-12-12 14:18                         ` Andrew Jones
2017-12-12 14:10                       ` Andrew Jones
2017-12-12 15:09       ` Andrew Jones [this message]
2017-12-13 13:56       ` Peter Maydell
2017-12-13 16:01         ` Laszlo Ersek
2017-12-13 16:46           ` Ard Biesheuvel
2017-12-13 16:48             ` Peter Maydell
2017-12-08 15:10 ` [Qemu-devel] [Qemu-arm] [PATCH 0/3] hw/arm/virt: Add another UART Peter Maydell

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=20171212150912.b5oc4dz5hxcex22q@kamzik.brq.redhat.com \
    --to=drjones@redhat.com \
    --cc=Jason@zx2c4.com \
    --cc=abologna@redhat.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=lersek@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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.