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 25673C6FA86 for ; Sat, 17 Sep 2022 08:16:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1ACDC84BF0; Sat, 17 Sep 2022 10:15:18 +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=1663402518; 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=VfwkSC71OiMy3EyunutiYbfS1/j1eyyulOzbDGqBvqPnBUNr4FO3F7eExedPD4pKt 1tia4Tw5A9cZC5uvaSrRotJPpJJbwog+fCUN2kHm4xbEYBJWalLWQr5nyLN/iyT6vn KwiEhGC9kO3KLMH7xhBVh3otEFw2U2HObGkL4B0unSOS1wDen7qvdwLiXu0cxU7tnf z15CI6o6/7OY95dcyvNm5eioa69/3qLzqfiHSRQhvyGpZD6g1T9ek502DoS3f+suZr M5SknL9USS3ZwXbRTWlX15TePjIbF/M3lQRv9XTJ2tUu7edUQTiG0wyqiXbzzL/g3o aVnq7X2NlPKYg== Received: by phobos.denx.de (Postfix, from userid 109) id A479E848C2; Sat, 17 Sep 2022 10:14:58 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::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 5277284BD4 for ; Sat, 17 Sep 2022 10:14:55 +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-204.mailbox.org (Postfix) with ESMTPS id 4MV3dT3Fl4z9sSl; Sat, 17 Sep 2022 10:14:53 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: trini@konsulko.com, sjg@chromium.org, rasmus.villemoes@prevas.dk Subject: [PATCH v2 4/6] watchdog: Get rid of ASSEMBLY hacks Date: Sat, 17 Sep 2022 10:14:48 +0200 Message-Id: <20220917081450.21549-5-sr@denx.de> In-Reply-To: <20220917081450.21549-1-sr@denx.de> References: <20220917081450.21549-1-sr@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4MV3dT3Fl4z9sSl 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