Skip to contentSkip to conversation

hw/timer/ibex: fix register addresses

PATCH New Andrew Zoghby 1 participant 1 message Jan 4, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/timer/ibex: fix register addresses

Change the register addresses to match
https://docs.opentitan.org/hw/ip/rv_timer/doc/#register-table.

---
 hw/timer/ibex_timer.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
hw/timer/ibex_timer.c +10 -11
index d8b8e4e1f6..a8a23b22d7 100644
@@ -38,20 +38,19 @@ REG32(ALERT_TEST, 0x00)
     FIELD(ALERT_TEST, FATAL_FAULT, 0, 1)
 REG32(CTRL, 0x04)
     FIELD(CTRL, ACTIVE, 0, 1)
-REG32(CFG0, 0x100)
-    FIELD(CFG0, PRESCALE, 0, 12)
-    FIELD(CFG0, STEP, 16, 8)
-REG32(LOWER0, 0x104)
-REG32(UPPER0, 0x108)
-REG32(COMPARE_LOWER0, 0x10C)
-REG32(COMPARE_UPPER0, 0x110)
-REG32(INTR_ENABLE, 0x114)
+REG32(INTR_ENABLE, 0x100)
     FIELD(INTR_ENABLE, IE_0, 0, 1)
-REG32(INTR_STATE, 0x118)
+REG32(INTR_STATE, 0x104)
     FIELD(INTR_STATE, IS_0, 0, 1)
-REG32(INTR_TEST, 0x11C)
+REG32(INTR_TEST, 0x108)
     FIELD(INTR_TEST, T_0, 0, 1)
-
+REG32(CFG0, 0x10c)
+    FIELD(CFG0, PRESCALE, 0, 12)
+    FIELD(CFG0, STEP, 16, 8)
+REG32(LOWER0, 0x110)
+REG32(UPPER0, 0x114)
+REG32(COMPARE_LOWER0, 0x118)
+REG32(COMPARE_UPPER0, 0x11c)
 static uint64_t cpu_riscv_read_rtc(uint32_t timebase_freq)
 {
     return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL),
Signature · 1 line
2.34.1