diff options
author | Bin Meng | 2020-09-01 03:39:10 +0200 |
---|---|---|
committer | Alistair Francis | 2020-09-10 00:54:19 +0200 |
commit | a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b (patch) | |
tree | 00c66845ba4693643cd3bd41f190908b781543fd /hw/riscv/microchip_pfsoc.c | |
parent | hw/riscv: microchip_pfsoc: Hook GPIO controllers (diff) | |
download | qemu-a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b.tar.gz qemu-a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b.tar.xz qemu-a47ef6e93ab2ca1db8d5ecb61fda3c41f926a26b.zip |
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/microchip_pfsoc.c')
-rw-r--r-- | hw/riscv/microchip_pfsoc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index 11ebdd1aa8..da6bd295ce 100644 --- a/hw/riscv/microchip_pfsoc.c +++ b/hw/riscv/microchip_pfsoc.c @@ -60,6 +60,9 @@ #define BIOS_FILENAME "hss.bin" #define RESET_VECTOR 0x20220000 +/* CLINT timebase frequency */ +#define CLINT_TIMEBASE_FREQ 1000000 + /* GEM version */ #define GEM_REVISION 0x0107010c @@ -187,7 +190,8 @@ static void microchip_pfsoc_soc_realize(DeviceState *dev, Error **errp) /* CLINT */ sifive_clint_create(memmap[MICROCHIP_PFSOC_CLINT].base, memmap[MICROCHIP_PFSOC_CLINT].size, 0, ms->smp.cpus, - SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, false); + SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE, + CLINT_TIMEBASE_FREQ, false); /* L2 cache controller */ create_unimplemented_device("microchip.pfsoc.l2cc", |