Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1226953rdh; Fri, 27 Oct 2023 08:07:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQYaUih70ZlcGN8+sng16LSg4f5vKHr4LNzQr0v/jmQXbJgjribXeLQTLepAC4wcE3bBIe X-Received: by 2002:a05:6808:201d:b0:3a7:36f9:51aa with SMTP id q29-20020a056808201d00b003a736f951aamr3514887oiw.17.1698419252227; Fri, 27 Oct 2023 08:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698419252; cv=none; d=google.com; s=arc-20160816; b=jqY7niTJUEgGVEgrpPUJ+IS985a51aLVLQNJZ7zmWbmAvd1kslXlI40Oijh/nWBF08 Eyg82xhlitxMa5mBOTOPrkcYxhX/WEV5WwjgSJHlogXnOZSzWoYXDuMOwurAE0dwfot2 tRmcnaZ8T6QSgpHADUEDuOZ2RMYHTLhyo4fTi/zMq98M/5p+4mXVfoaDTHb1vR0sX6/E JrtwGYy/qOHHVJc/u0SMjkCSMHL16cQTqv7DV/N8qqWZ4YCVOiiNfll6kgfFTPaeZBC/ ibeIYMX1ZBLAevvbnS5aXgIoqDG6SiuMmxFdBZcKuUOebtOGOXDvp5W41reGub4CUdEN azOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=mo3O0p+CzwKWAWB1pfHPZ/CuSeHzf50SCiiPDlGgfRM=; fh=R6GnkTc34KA9qjMZ+3sxZp/pUdtqEYlzsYK/Md8YL8k=; b=sVLASaoapwRMgBwXNniWE9Dds9TWtzNLBknwT2FVrS3yqNni8+d4R9hmH3SOeozuC6 nAxQGv0nVPcVO6Gzwb0CZSB3lS7snZVL9SYAWBva0xSVVXMrISvcC/D0m3ov6ZyCQiym vHvd+OaRz+kA2Gvy+/lTAU+K9BXVsTwxQ+hPr2lBZJN4CIKJAnGbngvLkTkVql7j1hg4 anzL7i3HlyXaj68FciwuTiB3XJU7UHmAHQSgB9tal8Uf0PpSv5IZKNs3rtBakptmQcPO eiLqpw9ADTjrvMNF2qenRfkpEEFKVI9x1Yq0Vut/H5jJ1YLVopTWkhb8Yhc1bkAQrjgh irQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZPul4VaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id cp2-20020a056808358200b003ae4d2baa5bsi509264oib.161.2023.10.27.08.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:07:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZPul4VaL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0DBB48051B74; Fri, 27 Oct 2023 08:07:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231791AbjJ0PHJ (ORCPT + 99 others); Fri, 27 Oct 2023 11:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbjJ0PHI (ORCPT ); Fri, 27 Oct 2023 11:07:08 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFABD10E; Fri, 27 Oct 2023 08:07:04 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-5a7c95b8d14so16733867b3.3; Fri, 27 Oct 2023 08:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698419224; x=1699024024; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=mo3O0p+CzwKWAWB1pfHPZ/CuSeHzf50SCiiPDlGgfRM=; b=ZPul4VaLKoLQ3ZJmVGjPrmuuU2BupRz/YrvbZ5R/sUcDJOUV41/tTILqbEKkNBWf4R 7qYzUQBSs4R+gX0V+4H6Ge3r/hI2E8IBYVQU2puUX2gYw0ICxlKN1kfUNxJR+FB8DDYi nI23AY+mzlpWaPQkjxy0UaL6FyaVqVXYrj8T9H2HyaPs8DeXqWssnt8FZg9+pLr3pv0u 35cNh3YJ7LrTENfCaxZnYR7P3rajCYynkqYM48SRTX6+pVmXiW+bTEnZKIxKeaVtuTqO 7o2jDB28yYtjY3glafn7RjZkPh9yNo8fP5RT5plQrVKsgT4NwLQgrRAtAWLk3CG3EwyQ pw3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698419224; x=1699024024; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mo3O0p+CzwKWAWB1pfHPZ/CuSeHzf50SCiiPDlGgfRM=; b=qbpLnORwVh1AUhkCbafZQbawafeDLQsa2dLphUeG2xvxo/uc/PvkdW7HYka/l1920U aqQDKg79DCrZE+Ph5H7a9BcvQkSNOtjioQHizJvyKjbe0Zn4NbaoVgIpxpQd5zlkEEuY ms4NEY0kMzXTqeZIjlbjkh7SqC+kB/7M4zTaX0/JNHqTj9HhEki1ohU+7aJb8ngOyWR2 qWpu7f9ef/Mk3PLJtoXn+DS998lD6lA3bsyxkopDI4u1X6ed4SgqZOyeIm02Xk+Xe47W KpO9YFAGqmEneEfgRNzzJPqi6AahUKw9mIgKADhmxvunLJrZ+abDVT+RHJGEUQ+k3V3o 57Bw== X-Gm-Message-State: AOJu0YylKMuASQaNECjmzVvfWos1mXlgXCyf+3yPcq4R6KviqAl1CcEr 5puorlyLs+RQoiWANeQOFHg= X-Received: by 2002:a05:690c:f88:b0:593:47ff:bd7 with SMTP id df8-20020a05690c0f8800b0059347ff0bd7mr3474380ywb.46.1698419223770; Fri, 27 Oct 2023 08:07:03 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id u84-20020a818457000000b005af9da2225bsm753862ywf.20.2023.10.27.08.07.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Oct 2023 08:07:03 -0700 (PDT) Sender: Guenter Roeck Message-ID: <22b4d0d7-ee50-2b64-ef0a-745b166230ea@roeck-us.net> Date: Fri, 27 Oct 2023 08:07:01 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 2/2] watchdog: aspeed: Add support for aspeed,reset-mask DT property Content-Language: en-US To: Zev Weiss , Andrew Jeffery , 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: Eddie James , Ivan Mikhaylov , =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= References: <20230922104231.1434-4-zev@bewilderbeest.net> <20230922104231.1434-6-zev@bewilderbeest.net> From: Guenter Roeck In-Reply-To: <20230922104231.1434-6-zev@bewilderbeest.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Fri, 27 Oct 2023 08:07:16 -0700 (PDT) On 9/22/23 03:42, Zev Weiss wrote: > 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 Reviewed-by: Guenter Roeck > --- > 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)) {