From d645f00d5be9d6c4e3396b555a8db4cc60d03118 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Mon, 30 Jan 2023 21:58:47 +0800 Subject: [PATCH] emulation: timer0: adapt timer0 to custom precursor Precursor has a custom TIMER0 module that is different from other LiteX timers. Adapt the Renode model to match the hardware. Signed-off-by: Sean Cross --- emulation/peripherals/LiteX_Timer_32.cs | 28 +++---------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/emulation/peripherals/LiteX_Timer_32.cs b/emulation/peripherals/LiteX_Timer_32.cs index 59fcb9b73..d458cb2d6 100644 --- a/emulation/peripherals/LiteX_Timer_32.cs +++ b/emulation/peripherals/LiteX_Timer_32.cs @@ -90,25 +90,6 @@ namespace Antmicro.Renode.Peripherals.Timers.Betrusted }) ; - Registers.TimerUpdateValue.Define32(this) - .WithFlag(0, FieldMode.WriteOneToClear, name: "UPDATE_VALUE", writeCallback: (_, val) => - { - if(val) - { - latchedValue = (uint)innerTimer.Value; - } - }); - ; - - // VALUE0 contains most significant 8 bits - // VALUE3 contains least significant 8 bits - Registers.Value.Define32(this) - .WithValueField(0, 32, FieldMode.Read, name: "VALUE", valueProviderCallback: _ => - { - return latchedValue; - }); - ; - Registers.EventStatus.Define32(this) .WithFlag(0, FieldMode.Read, name: "EV_STATUS", valueProviderCallback: _ => innerTimer.Value == 0) ; @@ -144,13 +125,10 @@ namespace Antmicro.Renode.Peripherals.Timers.Betrusted Reload = 0x04, TimerEnable = 0x08, - TimerUpdateValue = 0x0C, - Value = 0x10, - - EventStatus = 0x14, - EventPending = 0x18, - EventEnable = 0x1C + EventStatus = 0x0c, + EventPending = 0x10, + EventEnable = 0x14 } } }