From 0faa34a4a7960fd0a9537a805c9b6c6624f34176 Mon Sep 17 00:00:00 2001 From: Akash Kollipara Date: Sat, 29 Jun 2024 00:14:24 +0530 Subject: [PATCH] Address fix in clint --- src/platform/ibex/simple_system/hal/clint/clint_private.h | 4 ++-- src/platform/ibex/simple_system/platform/plat_timer.c | 4 ++-- src/platform/ibex/simple_system/resources/dp.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/platform/ibex/simple_system/hal/clint/clint_private.h b/src/platform/ibex/simple_system/hal/clint/clint_private.h index 010a15c6..6f5731d8 100644 --- a/src/platform/ibex/simple_system/hal/clint/clint_private.h +++ b/src/platform/ibex/simple_system/hal/clint/clint_private.h @@ -11,8 +11,8 @@ #pragma once -#define MTCMP_OFFSET (0x0) -#define MTIME_OFFSET (0x8) +#define MTCMP_OFFSET (0x8) +#define MTIME_OFFSET (0x0) typedef struct clint_port { diff --git a/src/platform/ibex/simple_system/platform/plat_timer.c b/src/platform/ibex/simple_system/platform/plat_timer.c index a0d38252..40bbc91d 100644 --- a/src/platform/ibex/simple_system/platform/plat_timer.c +++ b/src/platform/ibex/simple_system/platform/plat_timer.c @@ -108,7 +108,7 @@ static status_t plat_get_timer_prop(void) static uint64_t plat_get_timer_ticks_msec(uint64_t freq) { /* Compute ticks needed for 1 msec */ - return (uint64_t)(freq); + return (uint64_t)(freq/1000); } /** @@ -133,7 +133,7 @@ static void plat_timer_set_period(unsigned int p) syslog(fail, "Failed to configure timer, Err = %p\n", ret); plat_panic_handler(); } - //arch_ei_mtime(); + arch_ei_mtime(); } /** diff --git a/src/platform/ibex/simple_system/resources/dp.c b/src/platform/ibex/simple_system/resources/dp.c index 573781cd..cc2c814c 100644 --- a/src/platform/ibex/simple_system/resources/dp.c +++ b/src/platform/ibex/simple_system/resources/dp.c @@ -25,7 +25,7 @@ create_memory(mem, RAM_START, RAM_LENGTH); create_module(uart0, (uart | 0), 0x20000, 0x1, 0, 0); -create_module(timer_core0, (timer | 0), 0, 0, 10000000, 0, +create_module(timer_core0, (timer | 0), 0, 0, 2000000, 0, add_irq(0, int_local, 7, int_level)); create_module(clint0, clint, 0x30000, 16, 0, 0);