diff options
author | Bin Meng <bin.meng@windriver.com> | 2020-09-01 09:39:10 +0800 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2020-09-09 15:54:19 -0700 |
commit | a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b (patch) | |
tree | 00c66845ba4693643cd3bd41f190908b781543fd /hw/riscv/virt.c | |
parent | ce908a2f6f6d6e1d8ede485ee3f9f7d36ee3533c (diff) | |
download | qemu-a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b.zip qemu-a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b.tar.gz qemu-a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b.tar.bz2 |
hw/riscv: clint: Avoid using hard-coded timebase frequency
At present the CLINT timestamp is using a hard-coded timebase
frequency value SIFIVE_CLINT_TIMEBASE_FREQ. This might not be
true for all boards.
Add a new 'timebase-freq' property to the CLINT device, and
update various functions to accept this as a parameter.
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <1598924352-89526-16-git-send-email-bmeng.cn@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'hw/riscv/virt.c')
-rw-r--r-- | hw/riscv/virt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 6fca513..c67a910 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -541,7 +541,8 @@ static void virt_machine_init(MachineState *machine) sifive_clint_create( memmap[VIRT_CLINT].base + i * memmap[VIRT_CLINT].size, memmap[VIRT_CLINT].size, base_hartid, hart_count, - SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, true); + SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, + SIFIVE_CLINT_TIMEBASE_FREQ, true); /* Per-socket PLIC hart topology configuration string */ plic_hart_config_len = |