qemu-devel
[Top][All Lists]
Advanced

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

[RFC PATCH] hw/riscv/virt: Add serial alias in DTB


From: Vasilis Liaskovitis
Subject: [RFC PATCH] hw/riscv/virt: Add serial alias in DTB
Date: Thu, 16 Jan 2025 09:46:29 +0100

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




reply via email to

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