Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2845713rdb; Fri, 22 Sep 2023 09:50:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE3LEqPV6fRYdXRDyIVbXAgnYLF+3zOp+6rAiThDIsp1xDGcEz+q6qr53L+WfgUjt3OBDAM X-Received: by 2002:a17:902:d503:b0:1c3:92de:1b23 with SMTP id b3-20020a170902d50300b001c392de1b23mr9447817plg.59.1695401435876; Fri, 22 Sep 2023 09:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695401435; cv=none; d=google.com; s=arc-20160816; b=NVXy5vNnx0fdWYb+TdSGuMw4xQC+XbPDtQ0MBQs+m/OFwaWpdSGhSwOE4DgCbS3L/5 Xr9w/ZHYI8JJUVB72FEsObtSv9XhGxDoxzywDP4GIC8IIB1NG2g+ogEIo8CJclehszE1 YP8w2AePjIXEfInIAHH0WSKJBdRchJWdK0P06EHZbkleqw4tGBV/WXeeUuwlZIC3RuLY rjgG7qHFgP49Ox9hwaLLvrZsPtx13QvgevQsaZfXT+2guDRo3o5Izsdu8o9ZKKHmE//n 7iXabQj1+Dtb1ICDoOJ3jwY4KzibSDF1U9GDzYtXGjCgEifmH5vIRPuRCAQdpj950OMi 4IhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JYm8BcM9/KAma3UN/bNDkHDqNyw66K9b6awe2AtcQjo=; fh=03mojjjcpYAEVKyA+Jp31wsPehjl3+Ok7IdQwPWxeTQ=; b=dxFZ9vA8PrjdTpCB2yUGq5e3azIKc5ukFKcvVxibC+uvPyea4Hrv5rV4n9EjuWg0Ub fxvxbEML+6/yPHHW8Q3tBBStpQei0rJJM9jA7hYwQ3OCp4cnUDyv9msnc23ObdAbDEgK 2IVPCitrzhLpq5KLaZ4V3jjrp1dmjW4JmzMX53xpzyQQ+T5PnZ1PmYWWQ3h2b9fKhdaB w7c9qPsmmxxMzfDuT9HZTJKMXyE8UZwlcJbCbLqksC0oixF5hw4H8IlVtPdchZQgSZhj QBADOsCCzTXSTT8JvQKlrulcgUN8Fr7DmhBRbyYeoK6R6Xt6AzXb8+k3XS4s+14YHdQT 3mng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b=UGHTXYEs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id t17-20020a170902d29100b001bdfb3c4e0asi3918964plc.326.2023.09.22.09.50.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 09:50:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b=UGHTXYEs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=bewilderbeest.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EFF3C83BAC82; Fri, 22 Sep 2023 03:43:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233488AbjIVKnX (ORCPT + 99 others); Fri, 22 Sep 2023 06:43:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233483AbjIVKm7 (ORCPT ); Fri, 22 Sep 2023 06:42:59 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [71.19.156.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4608FCDA; Fri, 22 Sep 2023 03:42:52 -0700 (PDT) Received: from hatter.bewilderbeest.net (unknown [IPv6:2602:61:7e5d:5300::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 81BE0E07; Fri, 22 Sep 2023 03:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1695379371; bh=JYm8BcM9/KAma3UN/bNDkHDqNyw66K9b6awe2AtcQjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UGHTXYEs8gbpqvzfMndMgkQ9wWOq1AhrAGJjzFZ0nswSX1vxNIOrQqDM1Vb9BQAV7 MTKYrynqAphAyL8XxfMfG3k+QtGytjBuU0AiBw0KNvJKlAjG7JsJo0yPKTRaqTinIp 735t2vjgusXhwz8uTOUzCTZzv+jdsLrYmOpUo9BI= From: Zev Weiss To: Andrew Jeffery , Guenter Roeck , Joel Stanley , "Milton D. Miller II" , Wim Van Sebroeck , linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org, openbmc@lists.ozlabs.org Cc: Zev Weiss , Eddie James , Ivan Mikhaylov , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Subject: [PATCH 2/2] watchdog: aspeed: Add support for aspeed,reset-mask DT property Date: Fri, 22 Sep 2023 03:42:34 -0700 Message-ID: <20230922104231.1434-6-zev@bewilderbeest.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230922104231.1434-4-zev@bewilderbeest.net> References: <20230922104231.1434-4-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 22 Sep 2023 03:43:33 -0700 (PDT) This property allows the device-tree to specify how the Aspeed watchdog timer's reset mask register(s) should be set, so that peripherals can be individually exempted from (or opted in to) being reset when the watchdog timer expires. Signed-off-by: Zev Weiss --- drivers/watchdog/aspeed_wdt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c index b72a858bbac7..b4773a6aaf8c 100644 --- a/drivers/watchdog/aspeed_wdt.c +++ b/drivers/watchdog/aspeed_wdt.c @@ -79,6 +79,8 @@ MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table); #define WDT_TIMEOUT_STATUS_BOOT_SECONDARY BIT(1) #define WDT_CLEAR_TIMEOUT_STATUS 0x14 #define WDT_CLEAR_TIMEOUT_AND_BOOT_CODE_SELECTION BIT(0) +#define WDT_RESET_MASK1 0x1c +#define WDT_RESET_MASK2 0x20 /* * WDT_RESET_WIDTH controls the characteristics of the external pulse (if @@ -402,6 +404,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev) if ((of_device_is_compatible(np, "aspeed,ast2500-wdt")) || (of_device_is_compatible(np, "aspeed,ast2600-wdt"))) { + u32 reset_mask[2]; + size_t nrstmask = of_device_is_compatible(np, "aspeed,ast2600-wdt") ? 2 : 1; u32 reg = readl(wdt->base + WDT_RESET_WIDTH); reg &= wdt->cfg->ext_pulse_width_mask; @@ -419,6 +423,13 @@ static int aspeed_wdt_probe(struct platform_device *pdev) reg |= WDT_OPEN_DRAIN_MAGIC; writel(reg, wdt->base + WDT_RESET_WIDTH); + + ret = of_property_read_u32_array(np, "aspeed,reset-mask", reset_mask, nrstmask); + if (!ret) { + writel(reset_mask[0], wdt->base + WDT_RESET_MASK1); + if (nrstmask > 1) + writel(reset_mask[1], wdt->base + WDT_RESET_MASK2); + } } if (!of_property_read_u32(np, "aspeed,ext-pulse-duration", &duration)) { -- 2.40.0.5.gf6e3b97ba6d2.dirty