This is an automated email from the ASF dual-hosted git repository.

davids5 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e7d48f4b0 arch: k210: Fix k210 timer on QEMU 6.1 or later
5e7d48f4b0 is described below

commit 5e7d48f4b0a40e8b067738f07fee96f299fb521c
Author: Masayuki Ishikawa <[email protected]>
AuthorDate: Thu Apr 6 08:31:48 2023 +0900

    arch: k210: Fix k210 timer on QEMU 6.1 or later
    
    Summary:
    - I noticed that 'sleep 1' on nsh took 10 seconds on QEMU-6.1,
      though the old version (e.g. QEMU-5.2) works correctly.
    - I think we should implement PLL for the QEMU environment.
      However, this fix works as a tentative solution.
    
    Impact:
    - K210 on QEMU only
    
    Tested
    - Tested with QEMU-7.1
    
    Signed-off-by: Masayuki Ishikawa <[email protected]>
---
 arch/risc-v/src/k210/k210_timerisr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/risc-v/src/k210/k210_timerisr.c 
b/arch/risc-v/src/k210/k210_timerisr.c
index 661873de54..7c40fc6d03 100644
--- a/arch/risc-v/src/k210/k210_timerisr.c
+++ b/arch/risc-v/src/k210/k210_timerisr.c
@@ -45,7 +45,7 @@
  ****************************************************************************/
 
 #ifdef CONFIG_K210_WITH_QEMU
-#define MTIMER_FREQ 10000000
+#define MTIMER_FREQ 1000000
 #else
 #define MTIMER_FREQ (k210_get_cpuclk() / 50)
 #endif

Reply via email to