From patchwork Tue Apr 30 14:31:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: PeterYin X-Patchwork-Id: 13649435 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 E8BADC4345F for ; Tue, 30 Apr 2024 14:33: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=iSVyo346o44LN+G0wfiybkbyny0ZjJa97zdJ1hoxIJ4=; b=2LBaOdplhRvaDJ Okf+CjnHLt6FTitjenGj1FqGL0YgPVRt8dO0rm+xzz1m/7CefSbPPYu+cbvge0e6PlN/1IH1piAh2 ZgfF0DbHAMnvGKo18NacpI49Djggwc6sRF5lHBAPPHre4H7QVHXlOKsXjUqIpvGdV1c9n8wi6HP+4 VUA8CaU/WQRaXViDsvxr5pRoRhsLl9YMNk0iV8bsLMpUKxOkm4yFMN/A1EFe6ieaXhF2kRfMtPvNZ AJN3C09G6Wg0uHl6/4E1b9GSpe95UpWNEbGyF98efr3oVHLniQayCgg7uu8L9acrrKT24l8ITTIWJ Pteg8aCNITb7BcQVblsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1oYD-00000006r4L-0hZg; Tue, 30 Apr 2024 14:33:45 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1oXo-00000006quT-0PvQ for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 14:33:21 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1eab16c8d83so46018275ad.3 for ; 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=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=bbWyXy7tzUTKU9Yx8i3878cyT6cwUmzUpkwL6XCiHGA=; b=TQAmc7cKoja3/tma1y53JE2UEKxPlvBPUumOXhul2qDZIi9clrBhOCdKGmNwTpDa0u 8vFOtYRLV9t0wLgEwp4wPBWTVJmF5bEeVDwK105UyAdZcAXuDs+WcU9oiQ3wXc5pSg6o b8tubstla9TtSddQhlVZalnn9UGJJSbUoaCXcKNgM5Eys3xZ/I1uv8Oxwap/QuGOfL4F IzPihDoJgZ/gmaXEljD/49EwdyFpOYfc2AhiZEvY/XN4iJGMsNgNV50WvRX3kRzlxhXX ekTYkZOfhMOlD4UKnkvHOUbx3ZsAA89zUIVmubuw4gpJTT3lc5WFWpdLJXcWnKt9B6+2 3a8Q== 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=Jem0/88cVF4/jXcxIrm4N7jN59DCI23md1bSahYkt25eANJpfQ6KVNJQnMmABVHC+I Vge7z6GSMDHsxeFDDO39oR+4g+z/bYcPmFwF/2X3mJSHBBiFQLWMKXZizj2JzoSIgrl8 eyabfLWxfiHxRyO/tISSidE5gj9hw8ZbSPkF9IFCS9qAxKjDmUIRlfPgVCo914u2RyoG JLeZOm23ScefxiIy+vPZIeiDeaNyosafx5F1bH6T/PcQkH6baycVGp+a1evckfQja79T Vrt6Ty5vqr1vblWi5msfMXQn91rXuSLEr7/mmKB5A1jnH+3RqhvRITbgw0aUWMUqWp4c 54Kg== X-Forwarded-Encrypted: i=1; AJvYcCXkzGHSEDZgSAfOzt0t1JvE5Qq7+TqTe+J82pdDXCGqKQYj/ReHsm83gSDZlNyU5wfruimdZc/Zz6azwk7HStpieXWG39eMqgHLyTdw+ArJLxBuJFo= X-Gm-Message-State: AOJu0Yw0pUL6EjhcDQGz6o6rMCmSrDSRfXMXGMCqvm18r0XaegV5Y25H UIcrUTjR32h4Oa5urXE7tRSnQhpEwLlZHpK2hlYEmvjWvnIQZV+lDfK5dA== X-Google-Smtp-Source: AGHT+IF50zEbOnAs+x7qO5H4ytE8qglKw79WJLKnIPd4tguVAA/lYC9ixRtuKAvGTVIN3+mdp7kasQ== 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 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_073320_168074_054D8C3A X-CRM114-Status: GOOD ( 13.55 ) 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: 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(-)