[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/33] hw/watchdog/wdt_imx2: Trace MMIO access
From: |
Peter Maydell |
Subject: |
[PULL 18/33] hw/watchdog/wdt_imx2: Trace MMIO access |
Date: |
Thu, 2 Nov 2023 17:38:20 +0000 |
From: Bernhard Beschow <shentey@gmail.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20231028122415.14869-2-shentey@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/watchdog/wdt_imx2.c | 24 ++++++++++++++++++------
hw/watchdog/trace-events | 4 ++++
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/hw/watchdog/wdt_imx2.c b/hw/watchdog/wdt_imx2.c
index e776a2fbd40..885ebd39787 100644
--- a/hw/watchdog/wdt_imx2.c
+++ b/hw/watchdog/wdt_imx2.c
@@ -17,6 +17,7 @@
#include "hw/qdev-properties.h"
#include "hw/watchdog/wdt_imx2.h"
+#include "trace.h"
static void imx2_wdt_interrupt(void *opaque)
{
@@ -67,20 +68,29 @@ static void imx2_wdt_reset(DeviceState *dev)
static uint64_t imx2_wdt_read(void *opaque, hwaddr addr, unsigned int size)
{
IMX2WdtState *s = IMX2_WDT(opaque);
+ uint16_t value = 0;
switch (addr) {
case IMX2_WDT_WCR:
- return s->wcr;
+ value = s->wcr;
+ break;
case IMX2_WDT_WSR:
- return s->wsr;
+ value = s->wsr;
+ break;
case IMX2_WDT_WRSR:
- return s->wrsr;
+ value = s->wrsr;
+ break;
case IMX2_WDT_WICR:
- return s->wicr;
+ value = s->wicr;
+ break;
case IMX2_WDT_WMCR:
- return s->wmcr;
+ value = s->wmcr;
+ break;
}
- return 0;
+
+ trace_imx2_wdt_read(addr, value);
+
+ return value;
}
static void imx_wdt2_update_itimer(IMX2WdtState *s, bool start)
@@ -137,6 +147,8 @@ static void imx2_wdt_write(void *opaque, hwaddr addr,
{
IMX2WdtState *s = IMX2_WDT(opaque);
+ trace_imx2_wdt_write(addr, value);
+
switch (addr) {
case IMX2_WDT_WCR:
if (s->wcr_locked) {
diff --git a/hw/watchdog/trace-events b/hw/watchdog/trace-events
index 2739570652b..874968cc06a 100644
--- a/hw/watchdog/trace-events
+++ b/hw/watchdog/trace-events
@@ -17,6 +17,10 @@ cmsdk_apb_watchdog_lock(uint32_t lock) "CMSDK APB watchdog:
lock %" PRIu32
aspeed_wdt_read(uint64_t addr, uint32_t size) "@0x%" PRIx64 " size=%d"
aspeed_wdt_write(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx64 "
size=%d value=0x%"PRIx64
+# wdt_imx2.c
+imx2_wdt_read(uint32_t addr, uint16_t data) "[0x%" PRIx32 "] -> 0x%" PRIx16
+imx2_wdt_write(uint32_t addr, uint16_t data) "[0x%" PRIx32 "] <- 0x%" PRIx16
+
# spapr_watchdog.c
spapr_watchdog_start(uint64_t flags, uint64_t num, uint64_t timeout) "Flags
0x%" PRIx64 " num=%" PRId64 " %" PRIu64 "ms"
spapr_watchdog_stop(uint64_t num, uint64_t ret) "num=%" PRIu64 " ret=%" PRId64
--
2.34.1
- [PULL 00/33] target-arm queue, Peter Maydell, 2023/11/02
- [PULL 01/33] linux-user/elfload: Add missing arm64 hwcap values, Peter Maydell, 2023/11/02
- [PULL 07/33] hw/input/stellaris_gamepad: Convert to qemu_input_handler_register(), Peter Maydell, 2023/11/02
- [PULL 03/33] hw/input/stellaris_gamepad: Rename structs to our usual convention, Peter Maydell, 2023/11/02
- [PULL 06/33] hw/input/stellaris_input: Convert to qdev, Peter Maydell, 2023/11/02
- [PULL 05/33] hw/input/stellaris_gamepad: Remove StellarisGamepadButton struct, Peter Maydell, 2023/11/02
- [PULL 09/33] docs/specs/edu: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 15/33] docs/specs/vmgenid: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 11/33] docs/specs/pvpanic: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 17/33] hw/arm/pxa2xx_gpio: Pass CPU using QOM link property, Peter Maydell, 2023/11/02
- [PULL 18/33] hw/watchdog/wdt_imx2: Trace MMIO access,
Peter Maydell <=
- [PULL 08/33] docs/specs/vmw_pvscsi-spec: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 10/33] docs/specs/ivshmem-spec: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 14/33] docs/specs/vmcoreinfo: Convert to rST, Peter Maydell, 2023/11/02
- [PULL 19/33] hw/watchdog/wdt_imx2: Trace timer activity, Peter Maydell, 2023/11/02
- [PULL 24/33] linux-user: Report AArch64 hwcap2 fields above bit 31, Peter Maydell, 2023/11/02
- [PULL 30/33] target/arm: Correctly propagate stage 1 BTI guarded bit in a two-stage walk, Peter Maydell, 2023/11/02
- [PULL 28/33] hw/char/stm32f2xx_usart: Update IRQ when DR is written, Peter Maydell, 2023/11/02
- [PULL 31/33] hw/misc: Introduce AMD/Xilix Versal TRNG device, Peter Maydell, 2023/11/02
- [PULL 32/33] hw/arm: xlnx-versal-virt: Add AMD/Xilinx TRNG device, Peter Maydell, 2023/11/02
- [PULL 12/33] docs/specs/standard-vga: Convert to rST, Peter Maydell, 2023/11/02