* [RFC PATCH] hw/riscv/virt: Add serial alias in DTB
@ 2025-01-16 8:46 Vasilis Liaskovitis
2025-01-16 9:23 ` Andrew Jones
0 siblings, 1 reply; 3+ messages in thread
From: Vasilis Liaskovitis @ 2025-01-16 8:46 UTC (permalink / raw)
To: qemu-devel, qemu-riscv
Cc: palmer, alistair.francis, jason.chien, zhiwei_liu, dbarboza,
ajones, bmeng.cn, liwei1518, philmd, Vasilis Liaskovitis
This patch adds an "aliases" node with a "serial0" entry for the
single UART in the riscv64 virt machine.
This was requested in Gitlab #2774. However, since the machine only
has one UART at the moment, it's not clear that this addition makes
sense.
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2774
Signed-off-by: Vasilis Liaskovitis <vliaskovitis@suse.com>
---
hw/riscv/virt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 2bc5a9dd98..67b80e9430 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -971,6 +971,8 @@ static void create_fdt_uart(RISCVVirtState *s, const MemMapEntry *memmap,
}
qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", name);
+ qemu_fdt_add_subnode(ms->fdt, "/aliases");
+ qemu_fdt_setprop_string(ms->fdt, "/aliases", "serial0", name);
}
static void create_fdt_rtc(RISCVVirtState *s, const MemMapEntry *memmap,
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [RFC PATCH] hw/riscv/virt: Add serial alias in DTB
2025-01-16 8:46 [RFC PATCH] hw/riscv/virt: Add serial alias in DTB Vasilis Liaskovitis
@ 2025-01-16 9:23 ` Andrew Jones
2025-01-16 13:38 ` Vasilis Liaskovitis
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Jones @ 2025-01-16 9:23 UTC (permalink / raw)
To: Vasilis Liaskovitis
Cc: qemu-devel, qemu-riscv, palmer, alistair.francis, jason.chien,
zhiwei_liu, dbarboza, bmeng.cn, liwei1518, philmd
On Thu, Jan 16, 2025 at 09:46:29AM +0100, Vasilis Liaskovitis wrote:
> This patch adds an "aliases" node with a "serial0" entry for the
> single UART in the riscv64 virt machine.
>
> This was requested in Gitlab #2774. However, since the machine only
> has one UART at the moment, it's not clear that this addition makes
> sense.
>
> Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2774
s/Fixes/Resolves/ (see docs/devel/submitting-a-patch.rst)
> Signed-off-by: Vasilis Liaskovitis <vliaskovitis@suse.com>
> ---
> hw/riscv/virt.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
> index 2bc5a9dd98..67b80e9430 100644
> --- a/hw/riscv/virt.c
> +++ b/hw/riscv/virt.c
> @@ -971,6 +971,8 @@ static void create_fdt_uart(RISCVVirtState *s, const MemMapEntry *memmap,
> }
>
> qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", name);
> + qemu_fdt_add_subnode(ms->fdt, "/aliases");
create_fdt_uart() is called at machine-done time, so we should create the
/aliases node in create_fdt() in case we ever have other uses for it.
> + qemu_fdt_setprop_string(ms->fdt, "/aliases", "serial0", name);
> }
>
> static void create_fdt_rtc(RISCVVirtState *s, const MemMapEntry *memmap,
> --
> 2.46.0
>
Thanks,
drew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] hw/riscv/virt: Add serial alias in DTB
2025-01-16 9:23 ` Andrew Jones
@ 2025-01-16 13:38 ` Vasilis Liaskovitis
0 siblings, 0 replies; 3+ messages in thread
From: Vasilis Liaskovitis @ 2025-01-16 13:38 UTC (permalink / raw)
To: Andrew Jones
Cc: Vasilis Liaskovitis, qemu-devel, qemu-riscv, palmer,
alistair.francis, jason.chien, zhiwei_liu, dbarboza, bmeng.cn,
liwei1518, philmd
On Thu, Jan 16, 2025 at 10:23:56AM +0100, Andrew Jones wrote:
>
> s/Fixes/Resolves/ (see docs/devel/submitting-a-patch.rst)
>
[..]
> > qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", name);
> > + qemu_fdt_add_subnode(ms->fdt, "/aliases");
>
> create_fdt_uart() is called at machine-done time, so we should create the
> /aliases node in create_fdt() in case we ever have other uses for it.
thanks for the review, I am sending a v2 with the changes.
- Vasilis
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-16 13:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 8:46 [RFC PATCH] hw/riscv/virt: Add serial alias in DTB Vasilis Liaskovitis
2025-01-16 9:23 ` Andrew Jones
2025-01-16 13:38 ` Vasilis Liaskovitis
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.