From nobody Wed Nov 27 14:24:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698495941; cv=none; d=zohomail.com; s=zohoarc; b=J4n3XY7uSUzCMnvekYVsOW9HzMdYH1F7VxDU4IJAzlBeNnV6Bk09UpOusD7VoltSOqFA1J+MCyh6IRTakA7juRAjcacbLE6qqISY2F7LWtNqT/MrcbbE16keWjCSveRE5Jd3ZUrWaiDDPtIYkSNDmH0PyZIqJ1ub8QULKjIz9/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698495941; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z+50/O4PNCKQH2UPmRwpwa8C3hjwmP+3AadueA5nS0w=; b=TmJtSrJMYUGsXYyIjx/B+98dxfDc+FFwkILa35BpuO0H5v8KeGoaF0AsK6NyewPI9pZ+OplHj39cKvOFXMtzWhG6LV6paU6Axz6TW2oE6qObI+zpMY5UlUGkAeC4Kl8EubUXlBYuVzj5oM3MRDjqcFtSkaQgQcnxr3VxqxLveu4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698495941495773.0779667837986; Sat, 28 Oct 2023 05:25:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwiMj-0006Kk-QO; Sat, 28 Oct 2023 08:24:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwiMi-0006Jw-2C; Sat, 28 Oct 2023 08:24:32 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwiMg-0006lP-CW; Sat, 28 Oct 2023 08:24:31 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5409bc907edso4520477a12.0; Sat, 28 Oct 2023 05:24:29 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-044-170.89.12.pool.telefonica.de. [89.12.44.170]) by smtp.gmail.com with ESMTPSA id a13-20020a170906190d00b009ae3d711fd9sm2706687eje.69.2023.10.28.05.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 05:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698495867; x=1699100667; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z+50/O4PNCKQH2UPmRwpwa8C3hjwmP+3AadueA5nS0w=; b=PapyUXBeuUVf0POH/6KHuqPs+IigD3SggaKDpbhME/1n8E+il45JauEHKciIhLvH1u tF0t7yA+1gwXmdv+cEM3E0UPoJVxRbiJQWZ88ZuxQQjoeRyWkunq3UGxtBNMqYcVkolk snfk2AdZxdy9E+NmYxH/TQ0hG2jqfJ2KVPlrwlyCC1+7xZuDzxVJsoOEHpNLeAD9fqEC lM5ZSZqqhGGvKBHe5BGt9KQWFzbXacITsr9lYC7BZ+Mcz00hDNHQPncWyge6DNkar91L W7+h+iU97G7SMAXeNeEKg+p1yZ/AlueQrT6Y8T3Vx7HYZj6FcL5EFSd1ifsKPxxdFiM4 DYUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698495867; x=1699100667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z+50/O4PNCKQH2UPmRwpwa8C3hjwmP+3AadueA5nS0w=; b=vw4T+S89qaLjWEZNg6pPUetl+HtZRhSlrLIO89DT2Yp7xAfHLG3HyB39nqr2ztxTPo 0yXsz3u7pbmxwUXhR7NDGX6B5EWJBLiDzP/FIQ02WawR7KZdl3dHioC4W1Z8cs3G0pZl TelOgX/qr4pnaZhPUfewMfSXy9SyAHnuP+u7Ueq+znQGq9Cq6lqBib/QmkD95qL6H+bm wVPz+BIUzeN0wXuymFtkvfciQZqn3GmrzhNu+AUVE17R4nqxcxARoqAImKmlAHYtXWGp SWtAhHVs15V9dWO0xQp2+pFp4H9cMACt7uV7k3axF1px5yvBxqqDu2rN32HnrcsXQLgA Ee/Q== X-Gm-Message-State: AOJu0Yy3c5S0YqO6fv3MTpu1EVDvNWD3j6N1xgC98lbTIW0R6JVkmfwZ efWyMh4JrIXpgFmJc9XbV19trtszWXI= X-Google-Smtp-Source: AGHT+IHIR2UQG2nOuLJaEjyq58WcbmQMiSnqzJ/4RIgRu0TcMxoS+um9nfeVHV5+dhhOmWHuwFYR6w== X-Received: by 2002:a17:907:1c25:b0:9ae:50e3:7e40 with SMTP id nc37-20020a1709071c2500b009ae50e37e40mr4172825ejc.52.1698495867279; Sat, 28 Oct 2023 05:24:27 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-trivial@nongnu.org, Stefan Hajnoczi , Jean-Christophe Dubois , qemu-arm@nongnu.org, Andrey Smirnov , Peter Xu , David Hildenbrand , "Michael S. Tsirkin" , Mads Ynddal , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 1/6] hw/watchdog/wdt_imx2: Trace MMIO access Date: Sat, 28 Oct 2023 14:24:10 +0200 Message-ID: <20231028122415.14869-2-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028122415.14869-1-shentey@gmail.com> References: <20231028122415.14869-1-shentey@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=shentey@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1698495942629100009 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 e776a2fbd4..885ebd3978 100644 --- a/hw/watchdog/wdt_imx2.c +++ b/hw/watchdog/wdt_imx2.c @@ -17,6 +17,7 @@ #include "hw/qdev-properties.h" =20 #include "hw/watchdog/wdt_imx2.h" +#include "trace.h" =20 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 =3D IMX2_WDT(opaque); + uint16_t value =3D 0; =20 switch (addr) { case IMX2_WDT_WCR: - return s->wcr; + value =3D s->wcr; + break; case IMX2_WDT_WSR: - return s->wsr; + value =3D s->wsr; + break; case IMX2_WDT_WRSR: - return s->wrsr; + value =3D s->wrsr; + break; case IMX2_WDT_WICR: - return s->wicr; + value =3D s->wicr; + break; case IMX2_WDT_WMCR: - return s->wmcr; + value =3D s->wmcr; + break; } - return 0; + + trace_imx2_wdt_read(addr, value); + + return value; } =20 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 =3D IMX2_WDT(opaque); =20 + 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 2739570652..874968cc06 100644 --- a/hw/watchdog/trace-events +++ b/hw/watchdog/trace-events @@ -17,6 +17,10 @@ cmsdk_apb_watchdog_lock(uint32_t lock) "CMSDK APB watchd= og: lock %" PRIu32 aspeed_wdt_read(uint64_t addr, uint32_t size) "@0x%" PRIx64 " size=3D%d" aspeed_wdt_write(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx6= 4 " size=3D%d value=3D0x%"PRIx64 =20 +# 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%" PRIx= 16 + # spapr_watchdog.c spapr_watchdog_start(uint64_t flags, uint64_t num, uint64_t timeout) "Flag= s 0x%" PRIx64 " num=3D%" PRId64 " %" PRIu64 "ms" spapr_watchdog_stop(uint64_t num, uint64_t ret) "num=3D%" PRIu64 " ret=3D%= " PRId64 --=20 2.42.0