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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 176DDECAAD4 for ; Mon, 29 Aug 2022 06:24:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9C0B84976; Mon, 29 Aug 2022 08:23:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1661754221; bh=CZiwwv8rCLVhxnLu+WMQoyGrusITb/gWbPOt3hHRyQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=yJXJKGrOXl8ZERLQPIfUFXBwqBkAzknHIeNXhD/KlI/DhzOyINd8ei03VjqQLbxV8 eh1g4IlLwPtO9aXBavInOe9J7dccnmJAS5mdp0jze2YRTQ5xDafac9BOaJADiMyQcj giw8E3YuZTF38CD5csfhiQH942B4ZzaTejZbJ0t4RqRnao6wds/2bk7Cr1eCJuUkPH HhgkGHKAbybSjse44Y7lQtOWg3R8cLqTNGW3ojPyC9Kl36Jw8SibkC6PHRLtvR3yye tdhkagLaI+IuSBsEGYAcjcZmoYabSazRV0ZZTs6k1nD03R3Ons5J9nw1FJAiI7gq5C agNWAeF9F6Nvg== Received: by phobos.denx.de (Postfix, from userid 109) id 535138493A; Mon, 29 Aug 2022 08:23:28 +0200 (CEST) Received: from mout-u-107.mailbox.org (mout-u-107.mailbox.org [IPv6:2001:67c:2050:101:465::107]) (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 7829B84951 for ; Mon, 29 Aug 2022 08:23:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4MGL3X4pfWz9sRP; Mon, 29 Aug 2022 08:23:20 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, rasmus.villemoes@prevas.dk Subject: [RFC PATCH 5/8] watchdog: Get rid of ASSEMBLY hacks Date: Mon, 29 Aug 2022 08:23:10 +0200 Message-Id: <20220829062313.32654-6-sr@denx.de> In-Reply-To: <20220829062313.32654-1-sr@denx.de> References: <20220829062313.32654-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MGL3X4pfWz9sRP X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Only one occurance of WATCHDOG_RESET is left in one assembler file. This patch changes this occurance to a direct call to watchdog_reset and then removes all the ASSEMBLY ifdef'ery in watchdog.h, as it's not needed any more to clean this mess a bit up. Signed-off-by: Stefan Roese --- arch/powerpc/lib/ticks.S | 5 ++-- include/watchdog.h | 50 +++++++++++++--------------------------- 2 files changed, 19 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/lib/ticks.S b/arch/powerpc/lib/ticks.S index c487f938fa8d..8647d77cc9ad 100644 --- a/arch/powerpc/lib/ticks.S +++ b/arch/powerpc/lib/ticks.S @@ -9,7 +9,6 @@ #include #include #include -#include /* * unsigned long long get_ticks(void); @@ -42,7 +41,9 @@ wait_ticks: addc r14, r4, r14 /* Compute end time lower */ addze r15, r3 /* and end time upper */ - WATCHDOG_RESET /* Trigger watchdog, if needed */ +#if defined(CONFIG_WATCHDOG) || defined(CONFIG_HW_WATCHDOG) + bl schedule /* Trigger watchdog, if needed */ +#endif 1: bl get_ticks /* Get current time */ subfc r4, r4, r14 /* Subtract current time from end time */ subfe. r3, r3, r15 diff --git a/include/watchdog.h b/include/watchdog.h index 7a09346a0959..1365b154a295 100644 --- a/include/watchdog.h +++ b/include/watchdog.h @@ -38,54 +38,36 @@ int init_func_watchdog_reset(void); * Hardware watchdog */ #ifdef CONFIG_HW_WATCHDOG - #if defined(__ASSEMBLY__) - #define WATCHDOG_RESET bl hw_watchdog_reset - #else - extern void hw_watchdog_reset(void); + extern void hw_watchdog_reset(void); - #define WATCHDOG_RESET hw_watchdog_reset - #endif /* __ASSEMBLY__ */ + #define WATCHDOG_RESET hw_watchdog_reset #else /* * Maybe a software watchdog? */ #if defined(CONFIG_WATCHDOG) - #if defined(__ASSEMBLY__) - /* Don't require the watchdog to be enabled in SPL */ - #if defined(CONFIG_SPL_BUILD) && \ - !defined(CONFIG_SPL_WATCHDOG) - #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/ - #else - #define WATCHDOG_RESET bl watchdog_reset - #endif + /* Don't require the watchdog to be enabled in SPL */ + #if defined(CONFIG_SPL_BUILD) && \ + !defined(CONFIG_SPL_WATCHDOG) + #define WATCHDOG_RESET() { \ + cyclic_run(); \ + } #else - /* Don't require the watchdog to be enabled in SPL */ - #if defined(CONFIG_SPL_BUILD) && \ - !defined(CONFIG_SPL_WATCHDOG) - #define WATCHDOG_RESET() { \ - cyclic_run(); \ - } - #else - extern void watchdog_reset(void); + extern void watchdog_reset(void); - #define WATCHDOG_RESET() { \ - watchdog_reset(); \ - cyclic_run(); \ - } - #endif + #define WATCHDOG_RESET() { \ + watchdog_reset(); \ + cyclic_run(); \ + } #endif #else /* * No hardware or software watchdog. */ - #if defined(__ASSEMBLY__) - #define WATCHDOG_RESET /*XXX DO_NOT_DEL_THIS_COMMENT*/ - #else - #define WATCHDOG_RESET() { \ - cyclic_run(); \ + #define WATCHDOG_RESET() { \ + cyclic_run(); \ } - #endif /* __ASSEMBLY__ */ - #endif /* CONFIG_WATCHDOG && !__ASSEMBLY__ */ + #endif /* CONFIG_WATCHDOG */ #endif /* CONFIG_HW_WATCHDOG */ /* -- 2.37.2