[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.4 11/31] riscv: Fix SiFive E CLINT clock frequency
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.4 11/31] riscv: Fix SiFive E CLINT clock frequency |
Date: |
Tue, 12 Dec 2023 15:17:59 +0300 |
From: Román Cárdenas <rcardenas.rod@gmail.com>
If you check the manual of SiFive E310
(https://cdn.sparkfun.com/assets/7/f/0/2/7/fe310-g002-manual-v19p05.pdf),
you can see in Figure 1 that the CLINT is connected to the real time clock,
which also feeds the AON peripheral (they share the same clock).
In page 43, the docs also say that the timer registers of the CLINT count ticks
from the rtcclk.
I am currently playing with bare metal applications both in QEMU and a physical
SiFive E310 board and
I confirm that the CLINT clock in the physical board runs at 32.768 kHz.
In QEMU, the same app produces a completely different outcome, as sometimes a
new CLINT interrupt is triggered before finishing other tasks.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1978
Signed-off-by: Rom\ufffd\ufffdn C\ufffd\ufffdrdenas <rcardenas.rod@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20231117082840.55705-1-rcardenas.rod@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
(cherry picked from commit a7472560ca5f7a61ef3a46b52118f680de81058c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
index 0d37adc542..87d9602383 100644
--- a/hw/riscv/sifive_e.c
+++ b/hw/riscv/sifive_e.c
@@ -225,7 +225,7 @@ static void sifive_e_soc_realize(DeviceState *dev, Error
**errp)
RISCV_ACLINT_SWI_SIZE,
RISCV_ACLINT_DEFAULT_MTIMER_SIZE, 0, ms->smp.cpus,
RISCV_ACLINT_DEFAULT_MTIMECMP, RISCV_ACLINT_DEFAULT_MTIME,
- RISCV_ACLINT_DEFAULT_TIMEBASE_FREQ, false);
+ SIFIVE_E_LFCLK_DEFAULT_FREQ, false);
sifive_e_prci_create(memmap[SIFIVE_E_DEV_PRCI].base);
/* AON */
--
2.39.2
- [Stable-8.1.4 01/31] linux-user: xtensa: fix signal delivery in FDPIC, (continued)
- [Stable-8.1.4 01/31] linux-user: xtensa: fix signal delivery in FDPIC, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 02/31] target/arm: Fix SME FMOPA (16-bit), BFMOPA, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 03/31] hw/ide/ahci: fix legacy software reset, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 04/31] net: Provide MemReentrancyGuard * to qemu_new_nic(), Michael Tokarev, 2023/12/12
- [Stable-8.1.4 06/31] linux-user: Fix loaddr computation for some elf files, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 07/31] tests/avocado: Replace assertEquals() for Python 3.12 compatibility, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 08/31] tests/avocado: Replace assertRegexpMatches() for Python 3.12 compatibility, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 05/31] net: Update MemReentrancyGuard for NIC, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 09/31] linux-user/riscv: Add Zicboz block size to hwprobe, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 10/31] hw/riscv/virt.c: do create_fdt() earlier, add finalize_fdt(), Michael Tokarev, 2023/12/12
- [Stable-8.1.4 11/31] riscv: Fix SiFive E CLINT clock frequency,
Michael Tokarev <=
- [Stable-8.1.4 12/31] target/riscv/cpu_helper.c: Invalid exception on MMU translation stage, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 13/31] target/riscv/cpu_helper.c: Fix mxr bit behavior, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 14/31] vmdk: Don't corrupt desc file in vmdk_write_cid, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 15/31] target/arm: Set IL bit for pauth, SVE access, BTI trap syndromes, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 16/31] target/arm: Handle overflow in calculation of next timer tick, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 17/31] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize(), Michael Tokarev, 2023/12/12
- [Stable-8.1.4 18/31] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize(), Michael Tokarev, 2023/12/12
- [Stable-8.1.4 19/31] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize(), Michael Tokarev, 2023/12/12
- [Stable-8.1.4 22/31] hw/avr/atmega: Fix wrong initial value of stack pointer, Michael Tokarev, 2023/12/12
- [Stable-8.1.4 21/31] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field, Michael Tokarev, 2023/12/12