From patchwork Thu Apr 25 09:07:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PeterYin X-Patchwork-Id: 13642993 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37679C4345F for ; Thu, 25 Apr 2024 09:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4Ncv3RIn8ldtCwD4xwmicPL4xZX5JI3wsen/A0XN8zI=; b=jiomAH1spEmOSw BMwmKeUSZQ3KbxoHteqPtDATl6P/eIHl58RMuoDHRXf512xAuuprG/KgGRnOVvvCWJ2rXlyREZ1ER Krg7QrtfnN1vxIntQgg7zk+21d6Q/FPWquL54wrkXmMFjreZegWiZmgU9kndSFCLG6oa2Ja3T0Dzo xjZY8TBOOPm/+6gr9nyuNKDXxomJ8fC/ot6yJ4ZuaG3zkgzHGaZJdwQ+iMiINLcenK8aAqnTN7i4B HKXmit7yjhJyxu+22lo1jxEEKCQf8i8b9HiadFbunCkDopfqv/jGJoa2PnzAL7Z0+H7BOiTfwMyKH iwKRSf9TIz6UJRMNEnmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzv4r-00000007XeT-1C8u; Thu, 25 Apr 2024 09:07:37 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rzv4o-00000007Xda-1wbb for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2024 09:07:35 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1e2c725e234so14712345ad.1 for ; Thu, 25 Apr 2024 02:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714036053; x=1714640853; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=aF09Zg4sIkL9gC6ySi6dYbvMyiOsYCbmHeTeGavPjPQ=; b=YB9OLPyeQjTAyu/fItB78bwyI+6Imax6d6rnp+n4ofLU7GuIW7oAeX2SmUFu/Ki7mA 91qS2yeSmAF3kskzKyd7rMiiDeEnQQx5EMrQHxN+tN2WMSmpBVLYZAYdBNDHHCyhAEmn abQ/kxt5uqp8v0AlKI0atGm+LZjd5NReZCMrtwgHnLYvSZHKwUMDkzywZqM9AJMelblW isAXt1Bkj0TbKAW/7wTSV6wcx0Kr391z5xnihAe/hA/6F1EXKDRPg/lFzqqEODmKN+3D crF4b4I8ustQHImnALvlNxvXe7XT9OZ7zi68U9uj9Oa3gz8YxlJ+INmYMHVs4BOIZqok SazQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714036053; x=1714640853; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aF09Zg4sIkL9gC6ySi6dYbvMyiOsYCbmHeTeGavPjPQ=; b=KMnIKinMj87cpVU9kBL/Op6IheWPBJq3o12Mrnkj9MmIhGRubhl0a6v5fpqQH2yXei EMGtJEi0+eL0UmKxCMm5XBheDcn4QqQyIZ0KsmPeE9thBpC5pzrLkUN8wlyXobijpmTJ /DmkQl6rpndXNLe75JQTbSZIf4MfGlocdVW036A7Yme5qsvbZP4WQQXEDeZlxuge560C 6f1UgKkrq0xrWhJACS7w7eh1xhLsGX4DVkAM51IibTAjWCKAbW6RC6MFgpO05NTtl4p/ 8IG380lDraHCp44fehTHim+32XjbLlznxpNPAPLo3oafZeSZQL9azoPn5zul4La/ce9U 15Yw== X-Forwarded-Encrypted: i=1; AJvYcCXDJmksTmsTbWJbZB7uiD7kI0wX1dw15QIgLwVskJJKePLoSZqzg26TQOWVMIskf9GzpB4F7dqR0zqxCioQAgDJZNBwY94x0PG1+Pl4KpbaOjmg0hg= X-Gm-Message-State: AOJu0YwjBHh5GcHDDdJv8hAZdP/2R2ldu95mbnDVYJ+JpMev6gFr7aAR 6AqXcOwV/s1EKFj/vkqUxe1e4HoPSj6+m6nlfsqOjD1IyGnbFQBJ X-Google-Smtp-Source: AGHT+IFD21qLbGfQ21jitVv21MhnQqqwNte/oiTmCZXGuAW6E9cGj+omlxd/uQgm3osJKLLf/+qgeQ== X-Received: by 2002:a17:90b:4d8d:b0:2af:c3ea:8122 with SMTP id oj13-20020a17090b4d8d00b002afc3ea8122mr2283601pjb.7.1714036052036; Thu, 25 Apr 2024 02:07:32 -0700 (PDT) Received: from peter-bmc.dhcpserver.bu9bmc.local (2001-b400-e339-24b8-1743-5d70-cc45-1c02.emome-ip6.hinet.net. [2001:b400:e339:24b8:1743:5d70:cc45:1c02]) by smtp.gmail.com with ESMTPSA id g21-20020a17090a7d1500b002a574ab7f5esm12489938pjl.53.2024.04.25.02.07.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 02:07:31 -0700 (PDT) From: Peter Yin To: patrick@stwcx.xyz, Wim Van Sebroeck , Guenter Roeck , Joel Stanley , Andrew Jeffery , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 0/1] drivers: watchdog: revise watchdog bootstatus Date: Thu, 25 Apr 2024 17:07:25 +0800 Message-Id: <20240425090727.3787160-1-peteryin.openbmc@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240425_020734_521655_DD0331A4 X-CRM114-Status: GOOD ( 13.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Regarding the AST2600 specification, the WDTn Timeout Status Register (WDT10) has bit 1 reserved. Bit 1 of the status register indicates on ast2500 if the boot was from the second boot source. It does not indicate that the most recent reset was triggered by the watchdog. The code should just be changed to set WDIOF_CARDRESET if bit 0 of the status register is set. However, this bit can be clear when watchdog register 0x0c bit1(Reset System after timeout) is enabled. Thereforce include SCU register to veriy WDIOF_EXTERN1 and WDIOF_CARDRESET in ast2600 SCU74 or ast2400/ast2500 SCU3C. Change Log: v6 -> v7 - To use syscon_regmap_lookup_by_compatibleys to get scu base - Power on reset is set when triggered by AC or SRSRST. Thereforce, we clear flag to ensure next boot cause is a real watchdog case. We use the external reset flag to determine if it is an external reset or card reset. v5 -> v6 - Fixed missing WDT_TIMEOUT_STATUS_EVENT. v4 -> v5 - Revert indentation. v3 -> v4 - Add error handling for syscon_regmap_lookup_by_phandle and regmap_read. v2 -> v3 - Fixed WDIOF_CARDRESET status bit check and added support for WDIOF_EXTERN1 on ast2500 and ast2600. v1 -> v2 - Add comment and support WDIOF_CARDRESET in ast2600 v1 - Patch 0001 - Add WDIOF_EXTERN1 bootstatus --- drivers/watchdog/aspeed_wdt.c | 109 ++++++++++++++++++++++++++++++++-- 1 file changed, 103 insertions(+), 6 deletions(-)