Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1454155pxb; Thu, 4 Nov 2021 02:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIcu8+5RrpVtH8B0WyehgJELYRIx1Q/FpMW8lw7hddzbhqWW5Q7/biXawtGkruhGgzAmL6 X-Received: by 2002:a17:906:1601:: with SMTP id m1mr62523016ejd.117.1636018467073; Thu, 04 Nov 2021 02:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636018467; cv=none; d=google.com; s=arc-20160816; b=hVHr8y7trhctOz+TWShPpkUg0FgRxPCZoyeazhrss4fdTgc00UVAm40ISjgnxsEayK 8mwEHqnK1KVdMuKHcuPgN9Dk8tJ+3XHvFx8D6flE2O9WKSbx8H33XvgrQoGAVEBZrqs+ Af+1p2n1NsB+htqjf1/iyKPKXwcvIuBT4nCTWxWiCd6FpAjQAo56F1QwXvo30q1n18NJ c6VNGduujXHptPFNGRUe+U+vWBQZISrik7hY9bNBSywqU/gdqIqxPptNXBUlwGVpYaDc YMSVGciTE6jqod6PXmcibBTkOk/+HXR3oeGbWZtzm9qZQvEqXCXZ29nHfLga3btXKAOc 5ahg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=pZ9EPizzeFSRkpDwLY7KKXOLEcwi0h5Q4Ss1gsnf82g=; b=XbUmHbfOQZXEiKBKN3BrWfD2s2oiVG6Yl/pqPp15E0lhzDPeqVYNDgIn2Cc2VPoO6/ JsFnuadvs+TV2wzSKpmpplFvdEOWnaPjhYg/YFoS4YSZmAw4LfyfaGbPrKXDYUqXrMxS SWDEX7PPKIVWgcT5kMAi1a6srWjSrw48eVIxyzGJUrPgn6otzD+fAvyqItXPSR1Ii/WX btiQGaYCaXArUxvINMRGYJ4sRSnSX0sju6fQkoXiHRchp1dMNidgCtgrPyFoXZzFO2f2 BJLoxSwgpxFWQysDP9HyL+rE4zZ8GUCcVeO1nWE0lW0b8zkN4hGC45lCODFVWRyA7CcU pxGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=eu4iXdZI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si6442611edb.494.2021.11.04.02.34.03; Thu, 04 Nov 2021 02:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=eu4iXdZI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svanheule.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbhKDJe6 (ORCPT + 99 others); Thu, 4 Nov 2021 05:34:58 -0400 Received: from polaris.svanheule.net ([84.16.241.116]:37904 "EHLO polaris.svanheule.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230410AbhKDJe5 (ORCPT ); Thu, 4 Nov 2021 05:34:57 -0400 Received: from terra.local.svanheule.net (unknown [IPv6:2a02:a03f:eafe:c901:bf08:f0c1:3ec1:1bfc]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 6134526C287; Thu, 4 Nov 2021 10:32:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1636018338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=pZ9EPizzeFSRkpDwLY7KKXOLEcwi0h5Q4Ss1gsnf82g=; b=eu4iXdZIECc3KclIIqRZazL25WAloEDARH0YZjjJllm/cHBWOTUQfmK/l8E6f8bVK01ClX QKG3X/6FaYiAyv9Nockdu78lS5U1+NtcwNvY0EzBAslf6l7fUqmF0ekdVCMKPn2bn/pmaq 8CuwWmVp++foRGTLzAiX1TMfzYYzSbzfziJfHihErdf1vj9sv4zsvJLZFJvmSmeJVr/rM/ KIFGmn1BmksOsdPXOYNn6l2FD0GChJj9XoJjV+MCx+FQowsd6I8f92KzqbCWGYPwhn3IMR VDV944rniuFr4czB7QK3Zad0tUYhMFAsVv2HfHjXuuhwiXJsOr+6VXApYeA3SA== From: Sander Vanheule To: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org Cc: Wim Van Sebroeck , Guenter Roeck , Rob Herring , linux-kernel@vger.kernel.org, Sander Vanheule Subject: [PATCH v3 0/2] Add Realtek Otto WDT support Date: Thu, 4 Nov 2021 10:32:11 +0100 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This watchdog timer is found on Realtek's Otto MIPS platforms, including the RTL838x, RTL839x, and RTL930x series of ethernet switch SoCs. It has a number of reset modes (SoC, CPU, software), and can provide pretimeout interrupts. The timer has two timeout phases. Both phases have a maximum duration of 32 prescaled clock ticks, which is ca. 43s with a clock of 200MHz: - Phase 1: During this phase, the WDT can be pinged to reset the timeout. - Phase 2: Starts after phase 1 has timed out, and only serves to give the system some time to clean up, or notify others that it's going to reset. During this phase, pinging the WDT has no effect, and a reset is unavoidable. The driver has been tested on a Zyxel GS1900-8 (RTL8380, mainline kernel and OpenWrt), a Zyxel GS1900-48 (RTL8393, mainline), a Netgear GS110TPPv1 (RTL8381, mainline), and a Zyxel XGS1250-12 (RTL9203B, Openwrt). Changes since v2: Link: https://lore.kernel.org/all/20211104085952.13572-1-sander@svanheule.net/ - Fix off-by-one error in prescale assignment Main changes since v1: Link: https://lore.kernel.org/all/cover.1634131707.git.sander@svanheule.net/ - Drop implementation of phase2 irq, since it is only triggered on system reset - Drop redundant value checks and lock - Add RTL930x compatibility Sander Vanheule (2): dt-bindings: watchdog: Realtek Otto WDT binding watchdog: Add Realtek Otto watchdog timer .../bindings/watchdog/realtek,otto-wdt.yaml | 91 +++++ MAINTAINERS | 7 + drivers/watchdog/Kconfig | 13 + drivers/watchdog/Makefile | 1 + drivers/watchdog/realtek_otto_wdt.c | 361 ++++++++++++++++++ 5 files changed, 473 insertions(+) create mode 100644 Documentation/devicetree/bindings/watchdog/realtek,otto-wdt.yaml create mode 100644 drivers/watchdog/realtek_otto_wdt.c -- 2.31.1