Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2094874lqa; Tue, 30 Apr 2024 08:04:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTWo9CGkXd+PkjnvSt+vUSEj3+8BM15KWJjMw++1S24YaOmBmHLFrVBc8CtTQtLA83unylgCPvz9MI9fUS65MgM/1OP+rIknjHM5NiRQ== X-Google-Smtp-Source: AGHT+IFrq2cbT9EkZq7ZLSuNeHLshfu6EQGQhcgPBri6zJm4RDgCrxztDP7DMtoxLDmtgqJf9L+0 X-Received: by 2002:a17:902:ced1:b0:1e0:c567:bb42 with SMTP id d17-20020a170902ced100b001e0c567bb42mr17604856plg.59.1714489482596; Tue, 30 Apr 2024 08:04:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714489482; cv=pass; d=google.com; s=arc-20160816; b=Qd/Phv/zoj80zG/zRhNomHiF7fp1IzUwMiJRrvR0ZzaAkkdgPTky29v/Usk2dbB1ec MpEpHP0knvW85Ij36G54vemJaHsKjL6cSGoJWacpiq57/jUK4xgCQTOd/HvhMr/vL4vT 7g1AeUXXiQd0c+CKmnyatccXbLq7sYbRWnF8eVG34+0qUsb4kMlfBXNlMdNpD545OcGn DhTQqAWjhra5VErHXdaJzkkrB+Y4VHrvrAbqB+2hH39Efe91e5R7CAwcBDFT9OTKCFpY foCDeXK72gJQVyuKNveEPExymItu2caW2++9Urf5Vyy/xuRue27kosSfxtHU4nUbzyc2 SIZw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=bbWyXy7tzUTKU9Yx8i3878cyT6cwUmzUpkwL6XCiHGA=; fh=v9dGTxxKfQ247E4O1ZTI8sofGOkU1xBMuwsV3wB+1cE=; b=Do+y9DvXoIlCRM4ffHtez68YSZMu+ZvsCZfsZl53+ipFHfMR4LTXDiBWsiTOLqp9jX KYc09e47OSHZl7Bmb0hyFmRGk8Dzm//vLymJeEDXMVTUCrd5ifOfIiSV55y4hp9r03HV FFnjlYLrIyNzcZxUTXpyJKNOJQwbuLXHatqkGMBOx5trNkjwtsz+OvpOmlL44vyhp6R0 9W2QcYV5qMh/h2iiVFbah7NRYiXr/JKznpC1PdVvVM4XenQM4tv9TvEEGkQO1BmxNTF4 25D+LHPgCrzkgYLY520LKulVZ5cd8kULv577UGXWI1qou0lFUr0efxx4rSYw+dF55NYZ R+BQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lpYjzEUz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164171-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lw6-20020a1709032ac600b001ec5dc29f55si753339plb.393.2024.04.30.08.04.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 08:04:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164171-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lpYjzEUz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-164171-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164171-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A332BB273B2 for ; Tue, 30 Apr 2024 14:41:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2957A17F392; Tue, 30 Apr 2024 14:33:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lpYjzEUz" Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6DDD770EB; Tue, 30 Apr 2024 14:33:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714487600; cv=none; b=EF6o8O2kkvLSh1JXAfySwvdzv3+JqsYAGywGJ7/6DGREr3cvb8ooDQt0sPYCAt6hk9QlAqWufsZonAjtXNDMuHM5JiFO7k2OhXY9V2lqWS8c+0jNExNXeMgcxYRFxcTihqzicDmTtfduuikCRVy1uCvT5LMN3/1pElvZHK1Htak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714487600; c=relaxed/simple; bh=hHDKALZBtDaK1XJGZDjr7mtvwr3Wa562sY8T8hfckD8=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=byc+2SDkcVJa5ztPl+4OwpADm9Yes9FPU9Geb12g17h4xp7QtHo7YwDPlgziPFfAmXNjQOJ2cjQs4BYw+lDV42GZSbKsxu5ppedoMWDVU5FHyBVQsUIXdzNorVpaZkVavix9CZ5hiVNVZYUp8xiB0ymHvKjQny4b/QQwKH2XIWQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lpYjzEUz; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1eab16c8d83so46018285ad.3; Tue, 30 Apr 2024 07:33:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714487598; x=1715092398; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=bbWyXy7tzUTKU9Yx8i3878cyT6cwUmzUpkwL6XCiHGA=; b=lpYjzEUzHBSh7KiTmalCi6XVh9n+SaNrSm0lDnK9FYQw8r2UXK5A3IEYV0OwkiLjor 6vVQVHi1ZCCGyuMy0uQF+/ENdlEW+Oc/grhNSRzctKo9X1M0T6foWjLlMlqSnRVG5w6N tLgCw/EzlooiKwczqV6URwUujHjgmx9Bmoo3fouo/QpQN6mJPGNIHc3au1Nh2QA0kjAe TckN/b48scT6i+hhEalYPJkSeS8wtwkz+/sGuF5lBMKtVvhRiH9sF+QmG9I1+0dfT8wm A7xhASAdnppGHwvTUasC3G2Pv4KBsZmabF+p190IoxxV0q1CGlXnrbbxryLb+qi507fn PE+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714487598; x=1715092398; 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=bbWyXy7tzUTKU9Yx8i3878cyT6cwUmzUpkwL6XCiHGA=; b=QIMVpLjB7yuidbu8Fsd+GRV8gmPC4f50NorAlKFm6LrMf+/FhYmLV8x+Vni2rndaaq gv+YYcMmCbsMP8+sfGtJy3CO/m83GaN2+vKGr+mGQgUYcBF218jiZdfCz8uFLMsubs22 CK/PFfhN+RquVnC4arEXGAf2ndw7FOqva1j7r2HB6s/g7opgciDRE4TCA9xpe1E1pwUQ oFybDsyYNum/N8Xu56oKTTmCrRjn6HyAE1Y2+bL2YGaKQVNpn0jy0FcedjgglSKRkWhf /r65RaD2Jv/BI7tnNMTZOn07wKNELjDZSZPovdX1ZgVySH+XPKb4asQusD8uHYc4IPcP 0sow== X-Forwarded-Encrypted: i=1; AJvYcCVx9xC3Rl7ke/ZENB9wiyzWzkcPBPXzvP5kBDVdj0Vk58Jdepjami8LblupeRsZY1+J9g+r2E8J6zjtZ4DIDDboAmdxrWeFMVsc/734s6sszVdtCvq1KDFVs2PmnF1lCs7mB6HXiMIG5XAtpII= X-Gm-Message-State: AOJu0YyEMjNenOakZ4t0Kmpyfrj7SsmTY4NNzHdvlawHfibqOze7L9pG J0q3QsIY+MgbfX0Q63tjmgJrfObPE8y4D3rPopiRCWZokNWONGE1 X-Received: by 2002:a17:902:d648:b0:1e7:89af:f267 with SMTP id y8-20020a170902d64800b001e789aff267mr12052976plh.37.1714487598039; Tue, 30 Apr 2024 07:33:18 -0700 (PDT) Received: from peter-bmc.dhcpserver.bu9bmc.local (1-34-21-66.hinet-ip.hinet.net. [1.34.21.66]) by smtp.gmail.com with ESMTPSA id m1-20020a170902db0100b001e47972a2casm1682431plx.96.2024.04.30.07.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 07:33:17 -0700 (PDT) From: Peter Yin To: patrick@stwcx.xyz, Wim Van Sebroeck , Guenter Roeck , Joel Stanley , Andrew Jeffery , Eddie James , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 0/1] watchdog: aspeed: Revise handling of bootstatus Date: Tue, 30 Apr 2024 22:31:13 +0800 Message-Id: <20240430143114.1323686-1-peteryin.openbmc@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: v8 -> v9 - Rename and restructure the SCU. v7 -> v8 - Simplify the code. 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 | 90 +++++++++++++++++++++++++++++++---- 1 file changed, 82 insertions(+), 8 deletions(-) -- 2.25.1