[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 9/9] hw/riscv: virt: Set the clock-frequency
From: |
Alistair Francis |
Subject: |
[PATCH v2 9/9] hw/riscv: virt: Set the clock-frequency |
Date: |
Thu, 16 Dec 2021 14:54:27 +1000 |
From: Alistair Francis <alistair.francis@wdc.com>
As per the device tree specification let's set the clock-frequency for
the virt CPUs.
QEMU doesn't really have an exact clock, so let's just 1000000 as it's a
nice round number and matches the sifive_u CLINT_TIMEBASE_FREQ.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/472 (RISC-V virt)
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
hw/riscv/virt.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 3af074148e..41a85cfc60 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -202,6 +202,7 @@ static void create_fdt_socket_cpus(RISCVVirtState *s, int
socket,
qemu_fdt_setprop_cell(mc->fdt, cpu_name, "reg",
s->soc[socket].hartid_base + cpu);
qemu_fdt_setprop_string(mc->fdt, cpu_name, "device_type", "cpu");
+ qemu_fdt_setprop_cell(mc->fdt, cpu_name, "clock-frequency", 1000000);
riscv_socket_fdt_write_id(mc, mc->fdt, cpu_name, socket);
qemu_fdt_setprop_cell(mc->fdt, cpu_name, "phandle", cpu_phandle);
--
2.31.1
- [PATCH v2 6/9] target/riscv: Enable the Hypervisor extension by default, (continued)
- [PATCH v2 9/9] hw/riscv: virt: Set the clock-frequency,
Alistair Francis <=