qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] hw/riscv: virt: Use AIA INTC compatible string when avai


From: Alistair Francis
Subject: Re: [PATCH 4/4] hw/riscv: virt: Use AIA INTC compatible string when available
Date: Fri, 11 Jun 2021 09:20:28 +1000

On Sat, May 15, 2021 at 12:36 AM Anup Patel <anup.patel@wdc.com> wrote:
>
> We should use the AIA INTC compatible string in the CPU INTC
> DT nodes when the CPUs support AIA feature. This will allow
> Linux INTC driver to use AIA local interrupt CSRs.
>
> Signed-off-by: Anup Patel <anup.patel@wdc.com>

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

Alistair

> ---
>  hw/riscv/virt.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index c0dc69ff33..981a3a06d5 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -262,8 +262,15 @@ static void create_fdt(RISCVVirtState *s, const 
> MemMapEntry *memmap,
>              qemu_fdt_add_subnode(fdt, intc_name);
>              intc_phandle = phandle++;
>              qemu_fdt_setprop_cell(fdt, intc_name, "phandle", intc_phandle);
> -            qemu_fdt_setprop_string(fdt, intc_name, "compatible",
> -                "riscv,cpu-intc");
> +            if (riscv_feature(&s->soc[socket].harts[cpu].env,
> +                              RISCV_FEATURE_AIA)) {
> +                const char intcomp[] = "riscv,cpu-intc-aia\0riscv,cpu-intc";
> +                qemu_fdt_setprop(fdt, name, "compatible",
> +                    intcomp, sizeof(intcomp));
> +            } else {
> +                qemu_fdt_setprop_string(fdt, intc_name, "compatible",
> +                    "riscv,cpu-intc");
> +            }
>              qemu_fdt_setprop(fdt, intc_name, "interrupt-controller", NULL, 
> 0);
>              qemu_fdt_setprop_cell(fdt, intc_name, "#interrupt-cells", 1);
>
> --
> 2.25.1
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]