From nobody Tue Feb 10 01:35:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1558797860; cv=none; d=zoho.com; s=zohoarc; b=RAki0AYxMkJibsS3v5CFg3HVn5of0hVhJhIdMzMudMZU651yE7kaddumFotAvGU+CKuZ52uPJ+bGFIL6bJR5oDkKVkEe47JPj4h7i6NbquxEU6WJHJeuzquft9Pb7QztAbogygKA/6y0wxur6Y3AR+nQ706s44v8WuqoNzffGZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558797860; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=ksgPWpPXvyV7PuXk87f72S+ZcVaiCTc6r06+d3A8ux0=; b=QADnZBItwJO/l09ePrLETUvIewDTSBSEG0jJU8RnURz3XFsz/TkFJPCsMP/QYXMzfOP74M6SCHR8FZasxPTLHYc9QVY4SfZC+ewq3K7WYUMtcPD+LF1ANwtSRWtg6jkrT55WrnIWIjjTepz5Uq7ufg7BKIx9hDevz9U4iUJBWgk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558797860489642.375759956544; Sat, 25 May 2019 08:24:20 -0700 (PDT) Received: from localhost ([127.0.0.1]:43316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUYWu-0005KP-IT for importer@patchew.org; Sat, 25 May 2019 11:24:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUYMy-00062S-32 for qemu-devel@nongnu.org; Sat, 25 May 2019 11:14:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUYMx-0001v3-5L for qemu-devel@nongnu.org; Sat, 25 May 2019 11:14:00 -0400 Received: from 12.mo6.mail-out.ovh.net ([178.32.125.228]:53222) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hUYMw-0001tb-W4 for qemu-devel@nongnu.org; Sat, 25 May 2019 11:13:59 -0400 Received: from player698.ha.ovh.net (unknown [10.108.35.223]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id C90611CC2EB for ; Sat, 25 May 2019 17:13:56 +0200 (CEST) Received: from kaod.org (lfbn-1-10649-41.w90-89.abo.wanadoo.fr [90.89.235.41]) (Authenticated sender: clg@kaod.org) by player698.ha.ovh.net (Postfix) with ESMTPSA id 7101D625A7C3; Sat, 25 May 2019 15:13:50 +0000 (UTC) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Date: Sat, 25 May 2019 17:12:31 +0200 Message-Id: <20190525151241.5017-10-clg@kaod.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190525151241.5017-1-clg@kaod.org> References: <20190525151241.5017-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 6607906556218608401 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddukedgkeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 178.32.125.228 Subject: [Qemu-devel] [PATCH 09/19] aspeed/timer: Status register contains reload for stopped timer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-arm@nongnu.org, qemu-devel@nongnu.org, Joel Stanley Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Andrew Jeffery 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 Signed-off-by: C=C3=A9dric Le Goater --- 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 9ffd8e09f670..2f8522a597d3 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) =20 switch (reg) { case TIMER_REG_STATUS: - value =3D calculate_ticks(t, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL)= ); + if (timer_enabled(t)) { + value =3D calculate_ticks(t, qemu_clock_get_ns(QEMU_CLOCK_VIRT= UAL)); + } else { + value =3D t->reload; + } break; case TIMER_REG_RELOAD: value =3D t->reload; --=20 2.20.1