[PATCH 3/3] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART

Sunil V L posted 3 patches 1 year, 5 months ago
Maintainers: Sunil V L <sunilvl@ventanamicro.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Bin Meng <bmeng.cn@gmail.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>
There is a newer version of this series
[PATCH 3/3] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
Posted by Sunil V L 1 year, 5 months ago
RISC-V is going to use new HID RSCV0003 for generi UART. So, update the
HID.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
---
 hw/riscv/virt-acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
index 47ec78e432..7f80368415 100644
--- a/hw/riscv/virt-acpi-build.c
+++ b/hw/riscv/virt-acpi-build.c
@@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap,
                     uint32_t uart_irq)
 {
     Aml *dev = aml_device("COM0");
-    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0501")));
+    aml_append(dev, aml_name_decl("_HID", aml_string("RSCV0003")));
     aml_append(dev, aml_name_decl("_UID", aml_int(0)));
 
     Aml *crs = aml_resource_template();
-- 
2.40.1
Re: [PATCH 3/3] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
Posted by Igor Mammedov 1 year, 5 months ago
On Tue, 28 May 2024 13:01:03 +0530
Sunil V L <sunilvl@ventanamicro.com> wrote:

> RISC-V is going to use new HID RSCV0003 for generi UART. So, update the
> HID.

where does it come from?

> 
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> ---
>  hw/riscv/virt-acpi-build.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
> index 47ec78e432..7f80368415 100644
> --- a/hw/riscv/virt-acpi-build.c
> +++ b/hw/riscv/virt-acpi-build.c
> @@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap,
>                      uint32_t uart_irq)
>  {
>      Aml *dev = aml_device("COM0");
> -    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0501")));
> +    aml_append(dev, aml_name_decl("_HID", aml_string("RSCV0003")));

the only place I've found (that could serve as justification)
  https://github.com/riscv-non-isa/riscv-brs/blame/main/acpi.adoc

which mentions _CID and not _HID as it is in this patch

>      aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>  
>      Aml *crs = aml_resource_template();
Re: [PATCH 3/3] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
Posted by Sunil V L 1 year, 5 months ago
Hi Igor,
On Wed, Jun 05, 2024 at 04:48:14PM +0200, Igor Mammedov wrote:
> On Tue, 28 May 2024 13:01:03 +0530
> Sunil V L <sunilvl@ventanamicro.com> wrote:
> 
> > RISC-V is going to use new HID RSCV0003 for generi UART. So, update the
> > HID.
> 
> where does it come from?
> 
> > 
> > Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> > ---
> >  hw/riscv/virt-acpi-build.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
> > index 47ec78e432..7f80368415 100644
> > --- a/hw/riscv/virt-acpi-build.c
> > +++ b/hw/riscv/virt-acpi-build.c
> > @@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap,
> >                      uint32_t uart_irq)
> >  {
> >      Aml *dev = aml_device("COM0");
> > -    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0501")));
> > +    aml_append(dev, aml_name_decl("_HID", aml_string("RSCV0003")));
> 
> the only place I've found (that could serve as justification)
>   https://github.com/riscv-non-isa/riscv-brs/blame/main/acpi.adoc
> 
> which mentions _CID and not _HID as it is in this patch
> 
Right, this is the requirement.

Yes, _CID says device is compatible. But different vendors may have
different _HID. For qemu, _CID value is used as _HID since it is not
vendor specific. This is something similar to how ARMH0011 is used (qemu
vs RPi) in ARM world.

I am checking with Andrei to see if we can relax to make it either _HID
or _CID.

Thanks,
Sunil
Re: [PATCH 3/3] hw/riscv/virt-acpi-build.c: Update the HID of RISC-V UART
Posted by Alistair Francis 1 year, 5 months ago
On Tue, May 28, 2024 at 5:32 PM Sunil V L <sunilvl@ventanamicro.com> wrote:
>
> RISC-V is going to use new HID RSCV0003 for generi UART. So, update the
> HID.
>
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>

Acked-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/riscv/virt-acpi-build.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/riscv/virt-acpi-build.c b/hw/riscv/virt-acpi-build.c
> index 47ec78e432..7f80368415 100644
> --- a/hw/riscv/virt-acpi-build.c
> +++ b/hw/riscv/virt-acpi-build.c
> @@ -192,7 +192,7 @@ acpi_dsdt_add_uart(Aml *scope, const MemMapEntry *uart_memmap,
>                      uint32_t uart_irq)
>  {
>      Aml *dev = aml_device("COM0");
> -    aml_append(dev, aml_name_decl("_HID", aml_string("PNP0501")));
> +    aml_append(dev, aml_name_decl("_HID", aml_string("RSCV0003")));
>      aml_append(dev, aml_name_decl("_UID", aml_int(0)));
>
>      Aml *crs = aml_resource_template();
> --
> 2.40.1
>
>