From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 212CBC2B9F4 for ; Tue, 22 Jun 2021 13:34:18 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AEC760C41 for ; Tue, 22 Jun 2021 13:34:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AEC760C41 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7750C82C01; Tue, 22 Jun 2021 15:33:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ju99UxcT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5A07082C01; Tue, 22 Jun 2021 15:33:06 +0200 (CEST) Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E0A5182BE7 for ; Tue, 22 Jun 2021 15:33:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-oi1-x233.google.com with SMTP id d19so23760707oic.7 for ; Tue, 22 Jun 2021 06:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6UUnQAuC9DrB7WINHfnj9Fov95oeSkw3i0xVPKjzdjQ=; b=ju99UxcTVzwG1xCQ9+q9gW0UvjIaKQTlLS/DmQrC7souJv01YOQqzNXUwp7HakgGtb EAOma3Jx+q9TPXGe0BnRjRXn6hqe2Ap4JdO1N9NSZlmhKdpAk2EQ2c6qJnBAGFtDsk4J 19q+nH8XKM6n36KkghGetJUWolB3v7bl0KRRM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6UUnQAuC9DrB7WINHfnj9Fov95oeSkw3i0xVPKjzdjQ=; b=ODzPtJQ9W/qfI1UM5YqJzE3Qb1N/a0NhA5eH2P4kGF9b5UPQetD4iS+oa1ucHDmcAP rwMfBehy8PM7GwgPZosNEGtbu4CwxioUBSKNMkb+1LyvCEUje37ZsnvG+flE0L25DB4S cWvsFrymfM9xfsKkl0jHUKg3TIRL/WqEiJftGGdCaM++GL54F4EsvyDIQWx0jw5Joaga SeaYORrzlJawQzm5lSlyD3o8Wr/RcEKnXxttWgbeNgwr1j2xZ8f8f3oKkfHHOy2+M9lI W6CKDUcCAgFyuI0jmaC296YRpqueuaC0WiMUeOzfsYYmSFzGgnmZ3RbtjZGxaimTee2G tA2Q== X-Gm-Message-State: AOAM533sJhxyD1Gi22j/vwxEhIgW03PHMVx5K3thTLYPdTM5l+k7Xuv2 P5nK+SVR7aojznJpRLDixYaOPESjGJSc5PKWMitvhA== X-Google-Smtp-Source: ABdhPJw6bULqW+oWXBmHOZZ70SunZ2N+dUF2sbNBcWt2HMm7K6hlMKITSXbIg+OzKqzALeOD7pBT7VwTYjP346CuSVA= X-Received: by 2002:a05:6808:1415:: with SMTP id w21mr3179230oiv.150.1624368780183; Tue, 22 Jun 2021 06:33:00 -0700 (PDT) MIME-Version: 1.0 References: <20210527220017.1266765-1-rasmus.villemoes@prevas.dk> <20210527220017.1266765-9-rasmus.villemoes@prevas.dk> In-Reply-To: <20210527220017.1266765-9-rasmus.villemoes@prevas.dk> From: Simon Glass Date: Tue, 22 Jun 2021 07:31:51 -0600 Message-ID: Subject: Re: [PATCH v2 08/10] watchdog: add gpio watchdog driver To: Rasmus Villemoes Cc: U-Boot Mailing List , Stefan Roese , Tom Rini Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 27 May 2021 at 16:00, Rasmus Villemoes wrote: > > A rather common kind of external watchdog circuit is one that is kept > alive by toggling a gpio. Add a driver for handling such a watchdog. > > The corresponding linux driver apparently has support for some > watchdog circuits which can be disabled by tri-stating the gpio, but I > have never actually encountered such a chip in the wild; the whole > point of adding an external watchdog is usually that it is not in any > way under software control. For forward-compatibility, and to make DT > describe the hardware, the current driver only supports devices that > have the always-running property. I went a little back and forth on > whether I should fail ->probe or only ->start, and ended up deciding > ->start was the right place. > > The compatible string is probably a little odd as it has nothing to do > with linux per se - however, I chose that to make .dts snippets > reusable between device trees used with U-Boot and linux, and this is > the (only) compatible string that linux' corresponding driver and DT > binding accepts. I have asked whether one should/could add "wdt-gpio" > to that binding, but the answer was no: > > https://lore.kernel.org/lkml/CAL_JsqKEGaFpiFV_oAtE+S_bnHkg4qry+bhx2EDs=NSbVf_giA@mail.gmail.com/ > > If someone feels strongly about this, I can certainly remove the > "linux," part from the string - it probably wouldn't the only place where > one can't reuse a DT snippet as-is between linux and U-Boot. > > Signed-off-by: Rasmus Villemoes > --- > .../watchdog/gpio-wdt.txt | 19 +++++ > drivers/watchdog/Kconfig | 9 +++ > drivers/watchdog/Makefile | 1 + > drivers/watchdog/gpio_wdt.c | 69 +++++++++++++++++++ > 4 files changed, 98 insertions(+) > create mode 100644 doc/device-tree-bindings/watchdog/gpio-wdt.txt > create mode 100644 drivers/watchdog/gpio_wdt.c > Reviewed-by: Simon Glass