From: Chao Liu <chao.liu.zevorn@gmail.com>
To: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org, qemu-riscv@nongnu.org,
alistair.francis@wdc.com, liwei1518@gmail.com,
zhiwei_liu@linux.alibaba.com,
Palmer Dabbelt <palmer@dabbelt.com>
Subject: Re: [PATCH 3/5] hw/riscv/sifive_u: add #address-cells in PLIC FDT
Date: Tue, 23 Jun 2026 12:14:59 +0800 [thread overview]
Message-ID: <ajoILibMuVebKwlH@ChaodeMacBook-Pro.local> (raw)
In-Reply-To: <20260616235939.1358663-4-daniel.barboza@oss.qualcomm.com>
On Tue, Jun 16, 2026 at 08:59:37PM +0800, Daniel Henrique Barboza wrote:
> By Linux FDT docs in [1] the "address-cells" property is mandatory. Set
> it to zero.
>
> While we're at it let's also put this new value and the interrupt-cells
> value in macros, like the 'virt' board is doing.
>
> [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/sifive%2Cplic-1.0.0.txt
>
> Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
Reviewed-by: Chao Liu <chao.liu.zevorn@gmail.com>
Thanks,
Chao
> ---
> hw/riscv/sifive_u.c | 5 ++++-
> include/hw/riscv/sifive_u.h | 2 ++
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
> index b3468254f5..7dfc18d3ec 100644
> --- a/hw/riscv/sifive_u.c
> +++ b/hw/riscv/sifive_u.c
> @@ -213,7 +213,10 @@ static void create_fdt(SiFiveUState *s, const MemMapEntry *memmap,
> nodename = g_strdup_printf("/soc/interrupt-controller@%lx",
> (long)memmap[SIFIVE_U_DEV_PLIC].base);
> qemu_fdt_add_subnode(fdt, nodename);
> - qemu_fdt_setprop_cell(fdt, nodename, "#interrupt-cells", 1);
> + qemu_fdt_setprop_cell(fdt, nodename, "#interrupt-cells",
> + SIFIVE_U_PLIC_INT_CELLS);
> + qemu_fdt_setprop_cell(fdt, nodename, "#address-cells",
> + SIFIVE_U_PLIC_ADDR_CELLS);
> qemu_fdt_setprop_string_array(fdt, nodename, "compatible",
> (char **)&plic_compat, ARRAY_SIZE(plic_compat));
> qemu_fdt_setprop(fdt, nodename, "interrupt-controller", NULL, 0);
> diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h
> index e4c9860d50..aed966a62d 100644
> --- a/include/hw/riscv/sifive_u.h
> +++ b/include/hw/riscv/sifive_u.h
> @@ -156,6 +156,8 @@ enum {
> #define SIFIVE_U_MANAGEMENT_CPU_COUNT 1
> #define SIFIVE_U_COMPUTE_CPU_COUNT 4
>
> +#define SIFIVE_U_PLIC_ADDR_CELLS 0
> +#define SIFIVE_U_PLIC_INT_CELLS 1
> #define SIFIVE_U_PLIC_NUM_SOURCES 54
> #define SIFIVE_U_PLIC_NUM_PRIORITIES 7
> #define SIFIVE_U_PLIC_PRIORITY_BASE 0x00
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-06-23 4:15 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 23:59 [PATCH 0/5] hw/riscv: more FDT cleanups (PLIC) Daniel Henrique Barboza
2026-06-16 23:59 ` [PATCH 1/5] hw/riscv/sifive_u.c: remove unneeded qemu_fdt_get_phandle() call Daniel Henrique Barboza
2026-06-22 4:56 ` Alistair Francis
2026-06-23 4:12 ` Chao Liu
2026-06-16 23:59 ` [PATCH 2/5] hw/riscv/sifive_u.c: use intc_phandle in plic creation Daniel Henrique Barboza
2026-06-22 4:57 ` Alistair Francis
2026-06-23 4:14 ` Chao Liu
2026-06-16 23:59 ` [PATCH 3/5] hw/riscv/sifive_u: add #address-cells in PLIC FDT Daniel Henrique Barboza
2026-06-22 4:59 ` Alistair Francis
2026-06-23 4:14 ` Chao Liu [this message]
2026-06-16 23:59 ` [PATCH 4/5] hw/riscv/virt.c: change 'plic' nodename to 'interrupt-controller' Daniel Henrique Barboza
2026-06-22 5:00 ` Alistair Francis
2026-06-23 4:15 ` Chao Liu
2026-06-16 23:59 ` [PATCH 5/5] hw/riscv: add create_fdt_plic() helper Daniel Henrique Barboza
2026-06-22 5:02 ` Alistair Francis
2026-06-23 4:16 ` Chao Liu
2026-06-22 23:09 ` [PATCH 0/5] hw/riscv: more FDT cleanups (PLIC) Alistair Francis
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=ajoILibMuVebKwlH@ChaodeMacBook-Pro.local \
--to=chao.liu.zevorn@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.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 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.