qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <ajones@ventanamicro.com>
To: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
	alistair.francis@wdc.com,  bmeng@tinylab.org,
	liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com,
	 palmer@rivosinc.com, Anup Patel <apatel@ventanamicro.com>,
	conor@kernel.org
Subject: Re: [PATCH] hw/riscv/virt.c: add address-cells in create_fdt_one_aplic()
Date: Thu, 30 May 2024 13:06:52 +0200	[thread overview]
Message-ID: <20240530-2a3bc2792856d6c4bcf18269@orel> (raw)
In-Reply-To: <20240530-45111cf8b1ee719f055d234f@orel>

On Thu, May 30, 2024 at 01:05:41PM GMT, Andrew Jones wrote:
> On Thu, May 30, 2024 at 05:49:49AM GMT, Daniel Henrique Barboza wrote:
> > We need #address-cells properties in all interrupt controllers that are
> > referred by an interrupt-map [1]. For the RISC-V machine, both PLIC and
> > APLIC controllers must have this property.
> > 
> > PLIC already sets it in create_fdt_socket_plic(). Set the property for
> > APLIC in create_fdt_one_aplic().
> > 
> > [1] https://lore.kernel.org/linux-arm-kernel/CAL_JsqJE15D-xXxmELsmuD+JQHZzxGzdXvikChn6KFWqk6NzPw@mail.gmail.com/
> 
> There are other issues[2] with the DT nodes that we should address at the
> same time.
> 
> [2] https://lore.kernel.org/all/20240529-rust-tile-a05517a6260f@spud/

I meant to CC Conor. Doing that now.

> 
> Thanks,
> drew
> 
> > 
> > Suggested-by: Anup Patel <apatel@ventanamicro.com>
> > Fixes: e6faee65855b ("hw/riscv: virt: Add optional AIA APLIC support to virt machine")
> > Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> > ---
> >  hw/riscv/virt.c         | 2 ++
> >  include/hw/riscv/virt.h | 1 +
> >  2 files changed, 3 insertions(+)
> > 
> > diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> > index 4fdb660525..1a7e1e73c5 100644
> > --- a/hw/riscv/virt.c
> > +++ b/hw/riscv/virt.c
> > @@ -609,6 +609,8 @@ static void create_fdt_one_aplic(RISCVVirtState *s, int socket,
> >      aplic_name = g_strdup_printf("/soc/aplic@%lx", aplic_addr);
> >      qemu_fdt_add_subnode(ms->fdt, aplic_name);
> >      qemu_fdt_setprop_string(ms->fdt, aplic_name, "compatible", "riscv,aplic");
> > +    qemu_fdt_setprop_cell(ms->fdt, aplic_name, "#address-cells",
> > +                          FDT_APLIC_ADDR_CELLS);
> >      qemu_fdt_setprop_cell(ms->fdt, aplic_name,
> >                            "#interrupt-cells", FDT_APLIC_INT_CELLS);
> >      qemu_fdt_setprop(ms->fdt, aplic_name, "interrupt-controller", NULL, 0);
> > diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h
> > index 3db839160f..c0dc41ff9a 100644
> > --- a/include/hw/riscv/virt.h
> > +++ b/include/hw/riscv/virt.h
> > @@ -118,6 +118,7 @@ enum {
> >  #define FDT_PLIC_ADDR_CELLS   0
> >  #define FDT_PLIC_INT_CELLS    1
> >  #define FDT_APLIC_INT_CELLS   2
> > +#define FDT_APLIC_ADDR_CELLS  0
> >  #define FDT_IMSIC_INT_CELLS   0
> >  #define FDT_MAX_INT_CELLS     2
> >  #define FDT_MAX_INT_MAP_WIDTH (FDT_PCI_ADDR_CELLS + FDT_PCI_INT_CELLS + \
> > -- 
> > 2.45.1
> > 
> > 


  reply	other threads:[~2024-05-30 11:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30  8:49 [PATCH] hw/riscv/virt.c: add address-cells in create_fdt_one_aplic() Daniel Henrique Barboza
2024-05-30 11:05 ` Andrew Jones
2024-05-30 11:06   ` Andrew Jones [this message]
2024-05-30 12:26     ` Daniel Henrique Barboza
2024-05-30 15:35       ` Conor Dooley

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=20240530-2a3bc2792856d6c4bcf18269@orel \
    --to=ajones@ventanamicro.com \
    --cc=alistair.francis@wdc.com \
    --cc=apatel@ventanamicro.com \
    --cc=bmeng@tinylab.org \
    --cc=conor@kernel.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=liwei1518@gmail.com \
    --cc=palmer@rivosinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=zhiwei_liu@linux.alibaba.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).