Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1426857pxb; Thu, 4 Nov 2021 02:01:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMOeI+WTS3RYC8hcKQdCx74VMwMypBsj3MD5VZ8TR7V/neb11dHyhVTx5/3HEY8hWgVilF X-Received: by 2002:a5d:9356:: with SMTP id i22mr1207646ioo.159.1636016502898; Thu, 04 Nov 2021 02:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636016502; cv=none; d=google.com; s=arc-20160816; b=W9KbcAzi+ygWTToV63SUhxNj4Pg9i6CUtam7rq7j13P3EVQqoMhn+cjO79o81MMCmx /KKJO3C7q3K7ZBGmKP25cqku0lB54NMfSstUG1Ubrg52Kqe1K6498kLnKKazRYYS6krc k66bco9J8mqekYnMXHLR0MBrIJklxTWIeXPaaPlL6yo+GcJlHzmRDjzTw5wSQciWi9QE a0V+1G0UOW+4+6hasVqvRlFTEaPXw30lYcY2sYyuIlh56UbWeE+6RyyH7o6M+DePwp3g IIBQGRkyEDZP1SlK8o2llZ1LPU02j2tq6Xao+qmg6aAS+OrDhfpl+h1o6grKZuriZf/+ xB4g== 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=aSVaAzJ3m5980KKgm3JRaFImGZ0s3xafSnre4Y/uNJU=; b=AkJ+hLfy+/rRZhkg7lPPFbHpLyMBeGagJ5YWxTJnMSSm3C7FlqPtXzLf8MioUDh/Bq lt07wgWi3jmGrs4vrnWTMTwvwsaRy31TwxepMJ7pdcmb/q4El3eqFiGnZj8Zjf3dp5v3 JaeI0cI+9CHkYUwzoIZBi7vqZWZmiXsgB1vw7/+XZli7bI1XR66fWF0F8HVGQp25ZLvQ iRLXIWHS2/rgYUnZtukO/k7Da2wvQDydRVS9bKbvx61l0cywVriCn6rrtCjpQeQ9VLNn SolMe7+DRuaDFWvI0ITSeVHawL5hg82Qg9J8NjQe4dHSlxD/V/EyzM5WTfBVIcipHWEw j6nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svanheule.net header.s=mail1707 header.b=UnK9Aj4w; 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 i11si1742561jaj.51.2021.11.04.02.01.28; Thu, 04 Nov 2021 02:01:42 -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=UnK9Aj4w; 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 S231132AbhKDJDB (ORCPT + 99 others); Thu, 4 Nov 2021 05:03:01 -0400 Received: from polaris.svanheule.net ([84.16.241.116]:37226 "EHLO polaris.svanheule.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230252AbhKDJCx (ORCPT ); Thu, 4 Nov 2021 05:02:53 -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 E6B8026C25B; Thu, 4 Nov 2021 10:00:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1636016413; 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=aSVaAzJ3m5980KKgm3JRaFImGZ0s3xafSnre4Y/uNJU=; b=UnK9Aj4wg7GMeEqd89bq+LKinLThwgLHmSxpS8+5EifF2rysoZidBPNmOQdpzBjsoPM3WG 4q5x4Mx+5WHhjSMc7dr0AWsIfFUZO9zJMM6fdOX7dq0J2jF3uIuIXaWa4cbdPySLW5lPe8 EIgjA1LbLlMODhAcBwGOIzRb9jqcJn1GQ6BDkAUfIdijC2MG/CKZeGvUjMHtbznRCSYMq5 BnnYYYcjeSmYmm1vAxK7OD94/pHHtQlEYpiTQIxZ9Vn3MClJUVKNp0FNdhpbeBSKfkYOjQ SrKh65A69VZpw7TSvWmfaf73Qh6uY5gsndFctCjaRdU0bUoXuu2s9wYNum8fQA== 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 v2 0/2] Add Realtek Otto WDT support Date: Thu, 4 Nov 2021 09:59:51 +0100 Message-Id: <20211104085952.13572-1-sander@svanheule.net> 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). 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 | 359 ++++++++++++++++++ 5 files changed, 471 insertions(+) create mode 100644 Documentation/devicetree/bindings/watchdog/realtek,otto-wdt.yaml create mode 100644 drivers/watchdog/realtek_otto_wdt.c -- 2.31.1