Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 226B6C433F5 for ; Thu, 4 Nov 2021 03:55:29 +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 42F23611AD for ; Thu, 4 Nov 2021 03:55:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 42F23611AD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BB15A83690; Thu, 4 Nov 2021 04:55:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="fzZQ29Ve"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CukyjNxu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7E17A8367D; Thu, 4 Nov 2021 04:55:23 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 49EBF83257 for ; Thu, 4 Nov 2021 04:55:20 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E25305C019C; Wed, 3 Nov 2021 23:55:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 03 Nov 2021 23:55:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm1; bh=FMZDh9221yfL+80DIeuwW7exm0 3Gw0naxvrNI98bFFI=; b=fzZQ29VeprjYXkGTg9JbjZC9jfioZQ1hqg7gA26/RT P3G2aC/jRc/dzGBYUKj3yPNk1yMqvC6TymHp13fmQnf4RkfW9MHlK1tq7o9/CEgl pUOEz1OzSoZeC8SsQHeQS1VrEKgGZcg1M0nwIcsCJVH6NCapim8MxiMXnqYcJvu4 C0V0eumq9sc7CU9KCECKveBykAG7EmEfR6U2diTm0XmLa4YCz0ekE2Tidatow1U/ xp07OenekS4gZiiMY4lbBoSnyOvsnbp9IZnis+Bs2CL26McJhXeDd6FJ3SG6JMIc 3vV9H74MCGOBIstAjDtTihUYQ3dTClEua8A0P1Xpbs+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=FMZDh9221yfL+80DI euwW7exm03Gw0naxvrNI98bFFI=; b=CukyjNxurR3g03jDld+kVMivti+X2s/0V Z1srh6fLJ68PNoGJtk2umO5nWPaly24/03CjD40XP/8k8nmu68mZuknODzwSktDb 1fT9vbft5Boi1C9s4PHATLPr4Myi6Wy5qdKYOxx9J2xbQj3lX5pSO6EKxnskbsWF GHkckaYCJVocGb4COPzOzvhlcDQqC/xhb1yr2WwNgs2frGa2gnjrDdSHZ/g8/+W2 HDoaSw5MxHKsHlDlq8K2rRkK+Mu9t7VX8BWw6onprntqGSt8Id9faUZ0mnq5nkbl OULtLjZ36ev2LGR3kbfPhumFqePHmVd3o0AnjAgESmrUpYXDzWNkw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdefgdeivdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghlucfj ohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrfgrth htvghrnhepieetkefhheduudfgledtudefjeejfeegveehkeeufffhhfejkeehiefftdev tdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsh grmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Nov 2021 23:55:17 -0400 (EDT) From: Samuel Holland To: Stefan Roese , u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Bin Meng , Heinrich Schuchardt , Sean Anderson , Simon Glass , Samuel Holland Subject: [PATCH v3 0/6] Improved sysreset/watchdog uclass integration Date: Wed, 3 Nov 2021 22:55:10 -0500 Message-Id: <20211104035516.28268-1-samuel@sholland.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This series hooks up the watchdog uclass to automatically register watchdog devices for use with sysreset, doing a bit of minor cleanup along the way. The goal is for this to replace the sunxi board-level non-DM reset_cpu() function. I was surprised to find that the wdt_reboot driver requires its own undocumented device tree node, which references the watchdog device by phandle. This is problematic for us, because sunxi-u-boot.dtsi file covers 20 different SoCs with varying watchdog node phandle names. So it would have required adding a -u-boot.dtsi file for each board. Hooking things up automatically makes sense to me; this is what Linux does. However, I put the code behind a new option to avoid surprises for other platforms. Changes in v3: - Move condition to wdt-uclass.c to fix build errors. - Include watchdog name in error message. Changes in v2: - Extend the "if SYSRESET" block to the end of the file. - Also make gpio_reboot_probe function static. - Rebase on top of 492ee6b8d0e7 (now handle all watchdogs). - Added patches 5-6 as an example of how the new option will be used. Samuel Holland (6): sysreset: Add uclass Kconfig dependency to drivers sysreset: Mark driver probe functions as static sysreset: watchdog: Move watchdog reference to plat data watchdog: Automatically register device with sysreset sunxi: Avoid duplicate reset_cpu with SYSRESET enabled sunxi: Use sysreset framework for poweroff/reset arch/arm/Kconfig | 3 +++ arch/arm/mach-sunxi/board.c | 2 ++ drivers/sysreset/Kconfig | 11 ++++++-- drivers/sysreset/sysreset_gpio.c | 2 +- drivers/sysreset/sysreset_resetctl.c | 2 +- drivers/sysreset/sysreset_syscon.c | 2 +- drivers/sysreset/sysreset_watchdog.c | 40 ++++++++++++++++++++++------ drivers/watchdog/wdt-uclass.c | 8 ++++++ include/sysreset.h | 10 +++++++ 9 files changed, 67 insertions(+), 13 deletions(-) -- 2.32.0