Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp971267lqd; Thu, 25 Apr 2024 02:08:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpwixRb1LC/NyW+H1qWxGJi5eoGdc7ZkgmTqw4D27lwaQUPc3c6bMD5vu8EOFt0ULsc2eCUbRHw30iK1DsbVdkxrteqtED/hINcJiksQ== X-Google-Smtp-Source: AGHT+IFPQxbaYNRk8vYqvOqZjFjn+Af3tAtIZBzyswRqK/e7MgL26tMRkgnT7xhDm8m+bAp9s0IJ X-Received: by 2002:a05:622a:1316:b0:437:9f6e:8296 with SMTP id v22-20020a05622a131600b004379f6e8296mr2862858qtk.12.1714036096390; Thu, 25 Apr 2024 02:08:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714036096; cv=pass; d=google.com; s=arc-20160816; b=JlqqQ8Nwg6g0ikFOHIR7OvPy422LWtjLp1GR78OR19hjysaX/B36wlDYx8+AqZ59lz QJmQx4LaaOatySVKsixEBRIrWt6G6ViuCKsn8WexR0TGQp8aO6nAdnn360ByNEc/A5up 1dQeGQ9Y8wCVE+KJAcpN+M+H0IBAGlmQGz5cwwjYhnLVO+VD/gXfLqR8yxgwYEEKB6bX RhxwtrgObrlNS8BzbJwylXKB6i6eOJcyt5agcNWc3I+4P5cfdSHwykNptZcQEcV9MivY qkZRjQ0s3buDEMYlLkVhZZJqlKFgs8FMTjV9wm4gh9iE8KDGatgD/NHLXO3GVuDh928c lrhg== 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=aF09Zg4sIkL9gC6ySi6dYbvMyiOsYCbmHeTeGavPjPQ=; fh=h7+Lkp5ocH1Rs7KmYh8116FWZBzHAlAhe1mwCcAlPi8=; b=CEC/7G5OhKbyic3nrFtmtDTQ41RjxN0dpq/RR2PJuhujFR9w43pW6s6gnErqwJIsic Lg0LD8OmsrgNv7Y1HnEk1YCPmVUAQ3Htn2zMdZ5mbQSZj7K9R2K9TJPze3AeXEzvtW1z SlkC8oMe1MdiX7RH9O1yh8EthTKzWISzJ9IWLIkXuj3aefbRVgKJTxq5c2Fxhnd9/emp swnI+k7ijkQd29lb8Uw6WU5pLV61Z6MnomZWr3gJ+6OsqDQjgASGRNtqL4ZgiwCiTLdX K6VdbbOMrdWF1M116jl5oXuI0G1QhFpaRZoNRbMmmBnXBzNJ6j5+FfQS/LZmURDi3x6A IlwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B9Ve72q6; 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-158246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158246-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f20-20020a05622a1a1400b0043a353f1165si2281250qtb.41.2024.04.25.02.08.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 02:08:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=B9Ve72q6; 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-158246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158246-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EC44D1C21E2C for ; Thu, 25 Apr 2024 09:08:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73A4F84D3B; Thu, 25 Apr 2024 09:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B9Ve72q6" Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.177]) (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 6256D7FBB0; Thu, 25 Apr 2024 09:07:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714036054; cv=none; b=oNx2g6II/2jQ6DjfA3EaV1+PgFo6GvLPpYPdogox07f0dMUMYECHqen8XBpDpmHuguvYKZBRyfnm9pZK54eYC8cNqKss8vkrvJBmPPSGnkk/hXjfP/TqAk/uHI/DiJSavtL8cETkrJsEkgPoC0/5aLCd9muOxz5VbHXLwcS1w9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714036054; c=relaxed/simple; bh=vOkJCuf6obwG2EXnrFVqIavQOTRQCN2Q0BgWA/eiDsA=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=hja68wJs6R14swoNgAd4qQCvBO0BQWt7E3x+xcNnyaQXPpSpWlJHPVx4yRtu7PLQiXiEyHzkTYwbr2b2UWXn7BBkHNGvI2Crj27txcAToCU2jrSZSpPLRL8/t3Zc2GxfhRtOjEGaub8+ttwfdBKvxp3YKWhHTpg66BSRG2OKE3k= 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=B9Ve72q6; arc=none smtp.client-ip=209.85.215.177 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-pg1-f177.google.com with SMTP id 41be03b00d2f7-5c66b093b86so1418650a12.0; 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=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=aF09Zg4sIkL9gC6ySi6dYbvMyiOsYCbmHeTeGavPjPQ=; b=B9Ve72q68+csV+Itg++57rAkCZD46qq2QBYFNWDo604Aws5NtSFbdasJxbetU8/zS6 vIOePRhZhP+l3XDVCMyyTxn+zAMEIwg3pqhlob/FAr/3bA34phtAsCuHtkrLq1tzCDqd jzxtZe0L/OqnU4u/kQIJANonnWPGD7pL0SVTRukyS/ec7Fjr51rujn7hV4K/r36FKrdo ZdZiqfwBUWRcRhCa95HMXEPD9KiiYPvJfN9cxyWFVFRN8bkdIXziaV6Jc+CuU4lUTaF1 pypgxGASINz1yRuJqWEIzDeV8L67mJxaijO1cUg0KMm4puzteNOeKsOfIk5s6ljpMaBp M19w== 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=AcZrnLht8elaLfT2Q3hP+cn5laW3Lbdpx5EgXs2C5MZIZXCu7+0qYsiFEMdKqSg50M iEkXAIUeQrgUN7+CZrn6tXWMDI+aic2Pyr+MY4P72O2jBMQj8+9Ih23mjPHe8pKmFNvU xXn13/GvbvOMwqQPcJW6s0cMyK81YFa0rKOzgoUAUDJQR/vWHTKZJSXFPoR0pt9z6pVi 7UH0x2C4G4qoDH3ziPE3EPDGMyytf5qdHLEThdiQXQJtDZ08xwNRdnF3b/aIfidfcqEz mGNQsr51h3qlI/JzOV7MHADj0Wwjg4kztfhFtuoovV1Q8C6TCdXiUWWr5595s9Renvm4 8TMg== X-Forwarded-Encrypted: i=1; AJvYcCV75ZlT+YMKQkDDbA9aNgaFXlPNKll++y/wZb1zSL3UoIw8Grngq1T+Rl+hR3LCUs8UJXMWeWeMaTxQ4BG6gb3NDXgskYpMH4CNw/RQvuYYwn+JOdSLVdqZfJvS+WodLOpyZXg6sc1rbOiwx3U= X-Gm-Message-State: AOJu0YyFjK45Xx9K5BfGLPa1j7Kw5r3x52rapiiN7LR94qFm84R+klHu bHZ7MzTDEeJa/12yke/NO4fnpUVt/h06Z3+TY5pF9OzNzDdaLDl7 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 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: 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(-) -- 2.25.1