From patchwork Fri Jan 17 16:58:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1224900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RNdO6s+x; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47znNR1cBgz9s1x for ; Sat, 18 Jan 2020 03:59:35 +1100 (AEDT) Received: from localhost ([::1]:60314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isUy3-0000Th-IH for incoming@patchwork.ozlabs.org; Fri, 17 Jan 2020 11:59:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49455) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isUx0-0008Es-3D for qemu-devel@nongnu.org; Fri, 17 Jan 2020 11:58:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isUww-0007FL-7e for qemu-devel@nongnu.org; Fri, 17 Jan 2020 11:58:26 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:28654 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isUww-0007EU-4F for qemu-devel@nongnu.org; Fri, 17 Jan 2020 11:58:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579280301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QtlpF8hCqPWPuecJjcVs1Of/sWKhtu9gUlJyHqUkIoM=; b=RNdO6s+xH2HT01SJ326RYh9EENaXXpBooQAQqGKmyLx+S9mOMv9rrpwNUHzs/5m0K6GySK +zcK2ZZyiLNZDYfatWKHbfhusFNP4RQttdvvcme0OudW6sSwrhoJacfwmErSSLv44WaTb2 APE1+b94xkq0Vu1SuBuUSfpTbnXltCA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-307-al6e_ps3OnOL1XXjg1l0IQ-1; Fri, 17 Jan 2020 11:58:20 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E39F9800D50; Fri, 17 Jan 2020 16:58:18 +0000 (UTC) Received: from x1w.redhat.com (ovpn-206-6.brq.redhat.com [10.40.206.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D0415D9CD; Fri, 17 Jan 2020 16:58:17 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Subject: [PATCH v3 1/2] MAINTAINERS: Add missing m48t59 files to the PReP section Date: Fri, 17 Jan 2020 17:58:08 +0100 Message-Id: <20200117165809.31067-2-philmd@redhat.com> In-Reply-To: <20200117165809.31067-1-philmd@redhat.com> References: <20200117165809.31067-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: al6e_ps3OnOL1XXjg1l0IQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4b425d030d..c162145bd0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1084,6 +1084,8 @@ F: hw/pci-host/prep.[hc] F: hw/isa/i82378.c F: hw/isa/pc87312.c F: hw/dma/i82374.c +F: hw/rtc/m48t59.c +F: hw/rtc/m48t59-internal.h F: hw/rtc/m48t59-isa.c F: include/hw/isa/pc87312.h F: include/hw/rtc/m48t59.h From patchwork Fri Jan 17 16:58:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1224901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EzfTLJ3/; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47znNR5Xskz9sRd for ; Sat, 18 Jan 2020 03:59:35 +1100 (AEDT) Received: from localhost ([::1]:60316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isUy5-0000Vf-G1 for incoming@patchwork.ozlabs.org; Fri, 17 Jan 2020 11:59:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49495) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1isUx2-0008FF-Nl for qemu-devel@nongnu.org; Fri, 17 Jan 2020 11:58:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1isUwz-0007IC-3y for qemu-devel@nongnu.org; Fri, 17 Jan 2020 11:58:28 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:41212 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1isUwz-0007Hh-0d for qemu-devel@nongnu.org; Fri, 17 Jan 2020 11:58:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579280304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DR0w/zADhVqXf1WL7QQBc9ZUnFILA0c+2wzRWZv9rMo=; b=EzfTLJ3/32G/VP4IKgxvWpARraxtwG9LAUbQPkRuOolsR4C9524fmcHAOuxnTcws4SnOHU 3Ygd6vFuXkj3FPx2dIBqbU/w1Ra+zOT+PTonZhz/eeB5ewL5CBIIiVt1HbVCQRGUpndxhC 0N/DuZXJ7e90iuqmfh0FLkPA0vTVZXY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-23-NoYFqi05NsSTlAt-ga-LAg-1; Fri, 17 Jan 2020 11:58:23 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2DF68800D41; Fri, 17 Jan 2020 16:58:22 +0000 (UTC) Received: from x1w.redhat.com (ovpn-206-6.brq.redhat.com [10.40.206.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8A3E25D9CD; Fri, 17 Jan 2020 16:58:19 +0000 (UTC) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org Subject: [PATCH v3 2/2] hw/timer/m48t59: Convert debug printf()s to trace events Date: Fri, 17 Jan 2020 17:58:09 +0100 Message-Id: <20200117165809.31067-3-philmd@redhat.com> In-Reply-To: <20200117165809.31067-1-philmd@redhat.com> References: <20200117165809.31067-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: NoYFqi05NsSTlAt-ga-LAg-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Herv=C3=A9_Poussineau?= , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé --- hw/rtc/m48t59-internal.h | 5 ----- hw/rtc/m48t59.c | 11 +++++------ hw/rtc/trace-events | 6 ++++++ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/rtc/m48t59-internal.h b/hw/rtc/m48t59-internal.h index 4d4f2a6fed..cd648241e9 100644 --- a/hw/rtc/m48t59-internal.h +++ b/hw/rtc/m48t59-internal.h @@ -26,11 +26,6 @@ #ifndef HW_M48T59_INTERNAL_H #define HW_M48T59_INTERNAL_H -#define M48T59_DEBUG 0 - -#define NVRAM_PRINTF(fmt, ...) do { \ - if (M48T59_DEBUG) { printf(fmt , ## __VA_ARGS__); } } while (0) - /* * The M48T02, M48T08 and M48T59 chips are very similar. The newer '59 has * alarm and a watchdog timer and related control registers. In the diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index fc592b9fb1..ecc92ca476 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -35,6 +35,7 @@ #include "exec/address-spaces.h" #include "qemu/bcd.h" #include "qemu/module.h" +#include "trace.h" #include "m48t59-internal.h" #include "migration/vmstate.h" @@ -192,8 +193,7 @@ void m48t59_write(M48t59State *NVRAM, uint32_t addr, uint32_t val) struct tm tm; int tmp; - if (addr > 0x1FF8 && addr < 0x2000) - NVRAM_PRINTF("%s: 0x%08x => 0x%08x\n", __func__, addr, val); + trace_m48txx_nvram_mem_write(addr, val); /* check for NVRAM access */ if ((NVRAM->model == 2 && addr < 0x7f8) || @@ -450,8 +450,7 @@ uint32_t m48t59_read(M48t59State *NVRAM, uint32_t addr) } break; } - if (addr > 0x1FF9 && addr < 0x2000) - NVRAM_PRINTF("%s: 0x%08x <= 0x%08x\n", __func__, addr, retval); + trace_m48txx_nvram_mem_read(addr, retval); return retval; } @@ -462,7 +461,7 @@ static void NVRAM_writeb(void *opaque, hwaddr addr, uint64_t val, { M48t59State *NVRAM = opaque; - NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" => 0x%"PRIx64"\n", __func__, addr, val); + trace_m48txx_nvram_io_write(addr, val); switch (addr) { case 0: NVRAM->addr &= ~0x00FF; @@ -494,7 +493,7 @@ static uint64_t NVRAM_readb(void *opaque, hwaddr addr, unsigned size) retval = -1; break; } - NVRAM_PRINTF("%s: 0x%"HWADDR_PRIx" <= 0x%08x\n", __func__, addr, retval); + trace_m48txx_nvram_io_read(addr, retval); return retval; } diff --git a/hw/rtc/trace-events b/hw/rtc/trace-events index d6749f4616..52c1566198 100644 --- a/hw/rtc/trace-events +++ b/hw/rtc/trace-events @@ -17,3 +17,9 @@ pl031_set_alarm(uint32_t ticks) "alarm set for %u ticks" # aspeed-rtc.c aspeed_rtc_read(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64 aspeed_rtc_write(uint64_t addr, uint64_t value) "addr 0x%02" PRIx64 " value 0x%08" PRIx64 + +# m48t59.c +m48txx_nvram_io_read(uint64_t addr, uint64_t value) "io read addr:0x%04" PRIx64 " value:0x%02" PRIx64 +m48txx_nvram_io_write(uint64_t addr, uint64_t value) "io write addr:0x%04" PRIx64 " value:0x%02" PRIx64 +m48txx_nvram_mem_read(uint32_t addr, uint32_t value) "mem read addr:0x%04x value:0x%02x" +m48txx_nvram_mem_write(uint32_t addr, uint32_t value) "mem write addr:0x%04x value:0x%02x"