[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH v2 08/21] aspeed/timer: Status register contains reloa
From: |
Cédric Le Goater |
Subject: |
[Qemu-arm] [PATCH v2 08/21] aspeed/timer: Status register contains reload for stopped timer |
Date: |
Tue, 18 Jun 2019 18:52:58 +0200 |
From: Andrew Jeffery <address@hidden>
>From the datasheet:
This register stores the current status of counter #N. When timer
enable bit TMC30[N * b] is disabled, the reload register will be
loaded into this counter. When timer bit TMC30[N * b] is set, the
counter will start to decrement. CPU can update this register value
when enable bit is set.
Signed-off-by: Andrew Jeffery <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/timer/aspeed_timer.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c
index 537f072cf87f..8d6266b0fd81 100644
--- a/hw/timer/aspeed_timer.c
+++ b/hw/timer/aspeed_timer.c
@@ -187,7 +187,11 @@ static uint64_t aspeed_timer_get_value(AspeedTimer *t, int
reg)
switch (reg) {
case TIMER_REG_STATUS:
- value = calculate_ticks(t, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
+ if (timer_enabled(t)) {
+ value = calculate_ticks(t, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
+ } else {
+ value = t->reload;
+ }
break;
case TIMER_REG_RELOAD:
value = t->reload;
--
2.21.0
- [Qemu-arm] [PATCH v2 00/21] aspeed: machine extensions and fixes, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 02/21] aspeed: add a per SoC mapping for the memory space, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 01/21] aspeed: add a per SoC mapping for the interrupt space, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 03/21] hw: timer: Add ASPEED RTC device, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 04/21] hw/arm/aspeed: Add RTC to SoC, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 05/21] aspeed: introduce a configurable number of CPU per machine, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 06/21] aspeed: add support for multiple NICs, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 07/21] aspeed/timer: Fix behaviour running Linux, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 08/21] aspeed/timer: Status register contains reload for stopped timer,
Cédric Le Goater <=
- [Qemu-arm] [PATCH v2 09/21] aspeed/timer: Fix match calculations, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 10/21] aspeed/timer: Provide back-pressure information for short periods, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 11/21] aspeed/timer: Ensure positive muldiv delta, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 12/21] aspeed: remove the "ram" link, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 13/21] aspeed: add a RAM memory region container, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 14/21] aspeed/smc: add a 'sdram_base' property, Cédric Le Goater, 2019/06/18
- [Qemu-arm] [PATCH v2 15/21] aspeed/smc: add support for DMAs, Cédric Le Goater, 2019/06/18