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 438CBC38145 for ; Fri, 2 Sep 2022 12:11:53 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2DEF484AA4; Fri, 2 Sep 2022 14:11:22 +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=1662120682; bh=+/WlZhwX9hD8h7pwkXXCQM85n7re4kyp1E6Sa+8/87s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=0RULK2Q0bH8goeHeEoHCj5/NLpMltTu3IYdQlpcfb5Nz2jRVHNKOStJDlefhpwLgE 4Q5cLsYAG2g4RTgloQGR8zMB5Ug9UVpKYFxPqU9x9Cx6CEMiq5r3RPuX8kVKQBwqBv USRF/pqLYVgrys3cZxSUriuh2wDvgOJVuiJwLyfTpq9i0+fab0ByZmtOGJgVwPuhBp 98FuNsqOH62sNCWOPl0afebRf+VyUtyZV6U4C7mwqUSNRhODOWo/OnaozQk0kjthIQ KBIGiwsi8+rUzNsg3BDy70vEc883xFXr7Srq4izL7ywzs47O4fduRhxoFHsiVvrVuq mr8q/gCoU37kw== Received: by phobos.denx.de (Postfix, from userid 109) id 8943C84A8C; Fri, 2 Sep 2022 14:11:11 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [80.241.59.204]) (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 8F5AD84A99 for ; Fri, 2 Sep 2022 14:11:05 +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 smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (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-204.mailbox.org (Postfix) with ESMTPS id 4MJxZv4G8Lz9sT1; Fri, 2 Sep 2022 14:11:03 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, rasmus.villemoes@prevas.dk Subject: [PATCH v1 4/6] watchdog: Get rid of ASSEMBLY hacks Date: Fri, 2 Sep 2022 14:10:47 +0200 Message-Id: <20220902121049.1282136-5-sr@denx.de> In-Reply-To: <20220902121049.1282136-1-sr@denx.de> References: <20220902121049.1282136-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MJxZv4G8Lz9sT1 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 --- v1: - No change 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.3