summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiaojuan Yang2022-11-10 07:14:40 +0100
committerSong Gao2022-11-22 13:56:47 +0100
commit0208ba74c59cc9d4508689c9642efb010989eea8 (patch)
treeb703d77d86625f9504c476462a457cc01c55cbc2
parentrtl8139: honor large send MSS value (diff)
downloadqemu-0208ba74c59cc9d4508689c9642efb010989eea8.tar.gz
qemu-0208ba74c59cc9d4508689c9642efb010989eea8.tar.xz
qemu-0208ba74c59cc9d4508689c9642efb010989eea8.zip
hw/loongarch: Add default stdout uart in fdt
Add "chosen" subnode into LoongArch fdt, and set it's "stdout-path" prop to uart node. Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn> Reviewed-by: Song Gao <gaosong@loongson.cn> Message-Id: <20221115114923.3372414-1-yangxiaojuan@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
-rw-r--r--hw/loongarch/virt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 5136940b0b..b9c18ee517 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -69,6 +69,7 @@ static void fdt_add_uart_node(LoongArchMachineState *lams)
qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "ns16550a");
qemu_fdt_setprop_cells(ms->fdt, nodename, "reg", 0x0, base, 0x0, size);
qemu_fdt_setprop_cell(ms->fdt, nodename, "clock-frequency", 100000000);
+ qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename);
g_free(nodename);
}
@@ -87,6 +88,7 @@ static void create_fdt(LoongArchMachineState *lams)
"linux,dummy-loongson3");
qemu_fdt_setprop_cell(ms->fdt, "/", "#address-cells", 0x2);
qemu_fdt_setprop_cell(ms->fdt, "/", "#size-cells", 0x2);
+ qemu_fdt_add_subnode(ms->fdt, "/chosen");
}
static void fdt_add_cpu_nodes(const LoongArchMachineState *lams)