[PATCH 2/8] RISC-V: virt: riscvemu: set better hostname/model

Ahmad Fatoum a.fatoum at barebox.org
Thu Aug 14 13:27:59 PDT 2025


The hostname and model currently come from the device tree:
"riscvemu-bar_dev" and "ucbbar,riscvemu-bare", respectively.

The former is now warned about, because it contains an underscore and
the latter is not that descriptive.

As the device tree is supplied by the emulator, add an override to board
code. We differntiate between riscv32 and riscv64 in the hostname string
as that information can be relevant for choosing the correct kernel.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 arch/riscv/boards/riscvemu/board.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/riscv/boards/riscvemu/board.c b/arch/riscv/boards/riscvemu/board.c
index bf5a05dd6a4d..be1d0c162961 100644
--- a/arch/riscv/boards/riscvemu/board.c
+++ b/arch/riscv/boards/riscvemu/board.c
@@ -42,6 +42,13 @@ static int riscvemu_probe(struct device *dev)
 	struct riscvemu_priv *priv;
 	u64 start;
 
+	if (IS_ENABLED(CONFIG_ARCH_RV32I))
+		barebox_set_hostname("riscvemu32");
+	else
+		barebox_set_hostname("riscvemu64");
+
+	barebox_set_model("RISC-V Emulator");
+
 	of_overlay_apply_dtbo(dev->of_node, __dtbo_riscvemu_sram_start);
 	/* of_probe() will happen later at of_populate_initcall */
 
-- 
2.39.5




More information about the barebox mailing list