From nobody Sun Feb 8 12:37:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164878517338393.68353090586379; Thu, 31 Mar 2022 20:52:53 -0700 (PDT) Received: from localhost ([::1]:42498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1na8LE-0003fL-85 for importer@patchew.org; Thu, 31 Mar 2022 23:52:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na8GQ-0001iG-C2; Thu, 31 Mar 2022 23:47:54 -0400 Received: from twspam01.aspeedtech.com ([211.20.114.71]:31406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na8GO-0000pm-A2; Thu, 31 Mar 2022 23:47:54 -0400 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2313Zqov095945; Fri, 1 Apr 2022 11:35:53 +0800 (GMT-8) (envelope-from jamin_lin@aspeedtech.com) Received: from localhost.localdomain (192.168.70.87) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 1 Apr 2022 11:46:53 +0800 From: Jamin Lin To: Alistair Francis , Peter Maydell , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Andrew Jeffery , Joel Stanley , Cleber Rosa , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Wainer dos Santos Moschetta" , Beraldo Leal , "open list:STM32F205" , "open list:All patches CC here" Subject: [PATCH v4 3/9] aspeed/wdt: Fix ast2500/ast2600 default reload value. Date: Fri, 1 Apr 2022 11:46:45 +0800 Message-ID: <20220401034651.9066-4-jamin_lin@aspeedtech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220401034651.9066-1-jamin_lin@aspeedtech.com> References: <20220401034651.9066-1-jamin_lin@aspeedtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [192.168.70.87] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2313Zqov095945 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=211.20.114.71; envelope-from=jamin_lin@aspeedtech.com; helo=twspam01.aspeedtech.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: jamin_lin@aspeedtech.com, troy_lee@aspeedtech.com, steven_lee@aspeedtech.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1648785175575100001 From: Steven Lee Per ast2500_2520_datasheet_v1.8 and ast2600v11.pdf, the default value of WDT00 and WDT04 is 0x014FB180 for ast2500/ast2600. Add default_status and default_reload_value attributes for storing counter status and reload value as they are different from ast2400. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee Reviewed-by: C=C3=A9dric Le Goater --- hw/watchdog/wdt_aspeed.c | 10 ++++++++-- include/hw/watchdog/wdt_aspeed.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c index 6aa6f90b66..386928e9c0 100644 --- a/hw/watchdog/wdt_aspeed.c +++ b/hw/watchdog/wdt_aspeed.c @@ -232,8 +232,8 @@ static void aspeed_wdt_reset(DeviceState *dev) AspeedWDTState *s =3D ASPEED_WDT(dev); AspeedWDTClass *awc =3D ASPEED_WDT_GET_CLASS(s); =20 - s->regs[WDT_STATUS] =3D 0x3EF1480; - s->regs[WDT_RELOAD_VALUE] =3D 0x03EF1480; + s->regs[WDT_STATUS] =3D awc->default_status; + s->regs[WDT_RELOAD_VALUE] =3D awc->default_reload_value; s->regs[WDT_RESTART] =3D 0; s->regs[WDT_CTRL] =3D awc->sanitize_ctrl(0); s->regs[WDT_RESET_WIDTH] =3D 0xFF; @@ -319,6 +319,8 @@ static void aspeed_2400_wdt_class_init(ObjectClass *kla= ss, void *data) awc->reset_ctrl_reg =3D SCU_RESET_CONTROL1; awc->wdt_reload =3D aspeed_wdt_reload; awc->sanitize_ctrl =3D aspeed_2400_sanitize_ctrl; + awc->default_status =3D 0x03EF1480; + awc->default_reload_value =3D 0x03EF1480; } =20 static const TypeInfo aspeed_2400_wdt_info =3D { @@ -355,6 +357,8 @@ static void aspeed_2500_wdt_class_init(ObjectClass *kla= ss, void *data) awc->reset_pulse =3D aspeed_2500_wdt_reset_pulse; awc->wdt_reload =3D aspeed_wdt_reload_1mhz; awc->sanitize_ctrl =3D aspeed_2500_sanitize_ctrl; + awc->default_status =3D 0x014FB180; + awc->default_reload_value =3D 0x014FB180; } =20 static const TypeInfo aspeed_2500_wdt_info =3D { @@ -376,6 +380,8 @@ static void aspeed_2600_wdt_class_init(ObjectClass *kla= ss, void *data) awc->reset_pulse =3D aspeed_2500_wdt_reset_pulse; awc->wdt_reload =3D aspeed_wdt_reload_1mhz; awc->sanitize_ctrl =3D aspeed_2600_sanitize_ctrl; + awc->default_status =3D 0x014FB180; + awc->default_reload_value =3D 0x014FB180; } =20 static const TypeInfo aspeed_2600_wdt_info =3D { diff --git a/include/hw/watchdog/wdt_aspeed.h b/include/hw/watchdog/wdt_asp= eed.h index f945cd6c58..0e37f39f38 100644 --- a/include/hw/watchdog/wdt_aspeed.h +++ b/include/hw/watchdog/wdt_aspeed.h @@ -45,6 +45,8 @@ struct AspeedWDTClass { void (*reset_pulse)(AspeedWDTState *s, uint32_t property); void (*wdt_reload)(AspeedWDTState *s); uint64_t (*sanitize_ctrl)(uint64_t data); + uint32_t default_status; + uint32_t default_reload_value; }; =20 #endif /* WDT_ASPEED_H */ --=20 2.17.1