Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp204952lqk; Wed, 13 Mar 2024 23:58:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVfwbe5peY2PDs21edD0PI9lnoqQut8A41SimXM6S4ne8uol+PIJGGiqRpxKXE3kPDpn8jwOvauRown6ISpjY2TzBaqiuKqz1z7PtHoyQ== X-Google-Smtp-Source: AGHT+IGA+UE/KWF5YYC4SdkTVHz6RxOcA6SAK4pTo0zgl91FRCX2TqaktWk92/5JRyQ/GqQd6Spr X-Received: by 2002:a05:6871:2b13:b0:220:8c16:fe1b with SMTP id dr19-20020a0568712b1300b002208c16fe1bmr993167oac.40.1710399509362; Wed, 13 Mar 2024 23:58:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710399509; cv=pass; d=google.com; s=arc-20160816; b=MSiUvGe6sZasyB1FQB4f3abtLqe5b59fVE8NE6rIVyBL59IQZqtzegmYEBnsrGH7mn 8aefD7QwUehOPB2s32+KEg13feiMiRxSF9GRdQvxaegDji/X4VqqFoMgWGLEByG+s/rT iyWo84v+zB7Z3tzz8HTWYuwMFDpVmvTe9YcTBWQku0b/AoRUaWCo8elsvbN9pVTYSTel Wom3i/VrR3+farwMAEy8pfj0o9yzv/4AyHE3lMjnGBZtoF21wviQk4zXyTDtZQyVNEUF 3wTMfp19NifFOdwwomEQ2YDiS6oB2V/RSk0vBvXGheP5n5PDWcY6KdYby3/DkeGMzuxG h1sg== 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=W3XCzn158oeVoQis+pbpqZUpajHhpzGWGyFPRII2fyI=; fh=RKRjVYn8B1ar1Vj4bp2X7jhX7+09dJRCIiD/CE1iH60=; b=Ov+e61n5d4ijyrM/ckJdNwRjaGrGOs9YatuY2dXjsLqSjG+OL3wz+g/rTXHLoLw2B5 YGCbdeaubL4tFY1GA4kBgZGNeqDhQlzwdk2FqdH+6ocY55Oa3LaIWP0qf6rrD0Tt6edT CkgPqaqfP6SI1uaAbbsHSvJYWr/8/JEDyKzGaZzrXUjLSvUqDPgxw4zrUfzt+LVM5syB 15eglMDC/waG6dRsg2f6/S1RG/O9anY+iI2I/jrt6GQa59EBCR6dfgnXTunR7TrTuQ8O kAcOdqwfxzEVFYX717I6XGtnP7Wq97kfdrP5KfejKbLPGhbId7+iR3mo8EhJtIKaZCFc fEag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XNaDKHll; 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-102897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u9-20020a63ef09000000b005dc229b6778si16904pgh.14.2024.03.13.23.58.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 23:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XNaDKHll; 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-102897-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102897-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D82E62871DD for ; Thu, 14 Mar 2024 06:58:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CA2C8BF7; Thu, 14 Mar 2024 06:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XNaDKHll" Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 0345E5664; Thu, 14 Mar 2024 06:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710399471; cv=none; b=c4R4Xackmn4bO6sMws/zQUVg4AtY24wWF4jKqG4kI1tC6rB/iFjZgOrk8ZToqQjPPADjDwrqmtx1nl0J7huo7zxHcNysMarW+axasfsJIAbGJm+4tce8ea5c8yX+bpERVi940GcZvvqre6Igkpnw2rKLOxzEShmjh+J1RKeWloc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710399471; c=relaxed/simple; bh=9EK0hK9Yh8f/gaoc5EL6LuxNpHEYEbWGrAthaoXzOb0=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=JHGSkyVHByP1GKkYId9rjs66K75MwgI9/OjTYRzlJqxnMvuQ0jPR9sl/OX/s9dAs6gOYP/eah+gb4BcqpsoHclagR/wQruCiJZLBnPuKxnpVr5BXRQB4fPSb/1Vy9an5act0qF+1LxobheaVSdTZeR/kkRMXQ3SkxJYsdlQKMLY= 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=XNaDKHll; arc=none smtp.client-ip=209.85.167.172 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-oi1-f172.google.com with SMTP id 5614622812f47-3c35c4d8878so132317b6e.1; Wed, 13 Mar 2024 23:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710399469; x=1711004269; 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=W3XCzn158oeVoQis+pbpqZUpajHhpzGWGyFPRII2fyI=; b=XNaDKHlldv/sJhyVOKxlgm2HPaTqBD1ikEB35o23UYzE9EltaI1lhpgw4fpLNX2j6e MAbOQckiYJDY1e5FLitpchu3QVsfLTX8sEaE9p4PxGNK2X5/1BpAWUZopqrebOB8dVAt jwyTi7zxzcm1qFtZ9bx1xmdgKqtCBbmauM9NwvoLqxeayyxShIKS6eWt6za0NH/0vpba nSkz83e4/Dik4DpxQRCHuRlyDGZYv6OiDSRGv+HaAMMfu78rp6ui9oEYp4YUEbWiBJhR MD254mAFCO4vRjY+nMMJcjkX6tLYZ0iB+2QDR8cLCoVJiTwpfKQNt/NfhDow6jotUUma xQpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710399469; x=1711004269; 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=W3XCzn158oeVoQis+pbpqZUpajHhpzGWGyFPRII2fyI=; b=ZAs5Of1QwoxphjxNYEHd8jVa4WPo2XCua3pe8EcRScyzDv/XXKrS4oxROQz7rtKN4E yuuTynTWY6YthxVvaY4sPhmeUa/z/qOKDfzcxq4czoUWMuqWgTAsC+SBfrj1jDQ/6vwj 6C5Za3IHhwv0kf8Bu7bWsUI2P6Uho+wVtohie2AqkU5xPmuS5Vs9lv+Tul0kK3lN8rRp 6spaSyLHQ+OFB96XfgP5+/SIMfy47ATNnXsgZZPs4DcyIS+rpUroiemEU+vxTzCbXe9H lyj7UOTPZVtGajmT4s5QTHH31fVDmsRHUP14BVBEVx7V21owmZD2kpiFzGKamPJmwCRH rSeQ== X-Forwarded-Encrypted: i=1; AJvYcCUWfbnT6zpTGGTHHIrHDc311IlMuKZppoIfzDmy14CVW7Z3naimNPARv4O1Zhs7p1b7WuiJW9pVwHyoLUo2gYEAjMvDQzFA7WCsa41F9hpmpfKq2FRk1eZBBCOT6A6AFSquyBf/swzNdb12NgM= X-Gm-Message-State: AOJu0YwLsejiJGStV/KPCSMK6joJB0oWEkSqrwF3tauweOa+iGLQfiyy B6kfhYl9rBksuCiMsVhWs301oqyy6DmEG2P7jqKl7SBvvD/WTZzt X-Received: by 2002:a05:6808:399b:b0:3c2:36dd:a368 with SMTP id gq27-20020a056808399b00b003c236dda368mr980223oib.10.1710399468981; Wed, 13 Mar 2024 23:57:48 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e359-9e59-9ebb-2f4b-4781-fe3b.emome-ip6.hinet.net. [2001:b400:e359:9e59:9ebb:2f4b:4781:fe3b]) by smtp.gmail.com with ESMTPSA id a5-20020aa78e85000000b006e6857da474sm733847pfr.178.2024.03.13.23.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 23:57:48 -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 v1] drivers: watchdog: ast2600 support bootstatus Date: Thu, 14 Mar 2024 14:57:44 +0800 Message-Id: <20240314065744.1182701-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 Add WDIOF_EXTERN1 bootstatus in ast2600 Signed-off-by: Peter Yin --- Change log: v1 - Patch 0001 - Add WDIOF_EXTERN1 bootstatus --- drivers/watchdog/aspeed_wdt.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c index b4773a6aaf8c..8adadd394be6 100644 --- a/drivers/watchdog/aspeed_wdt.c +++ b/drivers/watchdog/aspeed_wdt.c @@ -81,6 +81,7 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table); #define WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION BIT(0) #define WDT_RESET_MASK1 0x1c #define WDT_RESET_MASK2 0x20 +#define WDT_EVENT_COUNTER_MASK (0xFFF << 8) /* * WDT_RESET_WIDTH controls the characteristics of the external pulse (if @@ -459,8 +460,17 @@ static int aspeed_wdt_probe(struct platform_device *pdev) } status = readl(wdt->base + WDT_TIMEOUT_STATUS); - if (status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY) { - wdt->wdd.bootstatus = WDIOF_CARDRESET; + + if (of_device_is_compatible(np, "aspeed,ast2600-wdt")) { + if (status & WDT_EVENT_COUNTER_MASK) { + /* + * Reset cause by WatchDog + */ + wdt->wdd.bootstatus |= WDIOF_EXTERN1; + } + } else { + if (status & WDT_TIMEOUT_STATUS_BOOT_SECONDARY) + wdt->wdd.bootstatus = WDIOF_CARDRESET; if (of_device_is_compatible(np, "aspeed,ast2400-wdt") || of_device_is_compatible(np, "aspeed,ast2500-wdt")) -- 2.25.1