From patchwork Thu Feb 20 07:39:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 1241292 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=c-s.fr header.i=@c-s.fr header.a=rsa-sha256 header.s=mail header.b=ttYxjC3/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48NRM975LZz9sRG for ; Thu, 20 Feb 2020 18:40:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 75C4E8173F; Thu, 20 Feb 2020 08:39:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=c-s.fr 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=c-s.fr header.i=@c-s.fr header.b="ttYxjC3/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6CE11813D1; Thu, 20 Feb 2020 08:39:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0C0C0813D1 for ; Thu, 20 Feb 2020 08:39:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=c-s.fr Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=christophe.leroy@c-s.fr Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48NRLv3Lnfz9v9yv; Thu, 20 Feb 2020 08:39:51 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=ttYxjC3/; dkim-adsp=pass; dkim-atps=neutral Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id aWE4aHmdp_ic; Thu, 20 Feb 2020 08:39:51 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48NRLv2Cjpz9v9yT; Thu, 20 Feb 2020 08:39:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582184391; bh=d+talTm6JaRDllRrRkU7vZWO2+lEXZUgvLQ/LIeULpk=; h=From:Subject:To:Cc:Date:From; b=ttYxjC3/VBP5D5mZjuk9AUoH/IuiCcbrsvvyaA7fUzWrr4hBIe2JBbILdE6BwYE1n ZaPc4o2B7PikUiQN1vbkIvSOs6ip7f2X9p0kf/pZ4B34OKahlWdpxhGe5bxW8XDlFf s4EvAnyJgznSWw008DKU+EC7voS96QvcTkdvPQBA= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 46D118B77C; Thu, 20 Feb 2020 08:39:52 +0100 (CET) Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id KuIlECNpQA16; Thu, 20 Feb 2020 08:39:52 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0EEBC8B773; Thu, 20 Feb 2020 08:39:52 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id B83BF65336; Thu, 20 Feb 2020 07:39:51 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH] watchdog: mpc8xx: Revert the 8xx watchdog back to CONFIG_HW_WATCHDOG To: Tom Rini , Stefan Roese Cc: u-boot@lists.denx.de, charles.frey@c-s.fr, Patrice Chotard Date: Thu, 20 Feb 2020 07:39:51 +0000 (UTC) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Commit f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros cleanup") switched the watchdog to CONFIG_WATCHDOG. But this is not compatible with the 8xx because it starts the watchdog HW timer at reset and must be serviced from the very beginning including while U-boot is executed in the firmware before relocation in RAM. Select CONFIG_HW_WATCHDOG and make hw_watchdog_reset() visible. Meanwhile, finalise the cleanup of arch/powerpc/cpu/mpc8xx/Kconfig by removing the lines put in comment in that commit, and also remove again the selection of CONFIG_MPC8xx_WATCHDOG which was removed by that commit and brought back by mistake by commit b3134ffbd944 ("watchdog: Kconfig: Sort entry alphabetically") Note that there was an 'imply WATCHDOG' in the original commit but it disappeared in the Kconfig alphabetical sorting, so no need to remove it here. Fixes: f3729ba6e7b2 ("watchdog: mpc8xx_wdt: Watchdog driver and macros cleanup") Fixes: b3134ffbd944 ("watchdog: Kconfig: Sort entry alphabetically") Signed-off-by: Christophe Leroy Cc: Stefan Roese Cc: Patrice Chotard Reviewed-by: Stefan Roese --- arch/powerpc/cpu/mpc8xx/Kconfig | 4 ---- drivers/watchdog/Kconfig | 2 +- drivers/watchdog/mpc8xx_wdt.c | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xx/Kconfig b/arch/powerpc/cpu/mpc8xx/Kconfig index 3e8ea3852959..f11231737656 100644 --- a/arch/powerpc/cpu/mpc8xx/Kconfig +++ b/arch/powerpc/cpu/mpc8xx/Kconfig @@ -25,10 +25,6 @@ config MPC885 endchoice -#config MPC8xx_WATCHDOG -# bool "Watchdog" -# select HW_WATCHDOG - config 8xx_GCLK_FREQ int "CPU GCLK Frequency" diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 36fbdce55208..fbb561b995f1 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -118,7 +118,7 @@ config WDT_CORTINA config WDT_MPC8xx bool "MPC8xx watchdog timer support" depends on WDT && MPC8xx - select CONFIG_MPC8xx_WATCHDOG + select HW_WATCHDOG help Select this to enable mpc8xx watchdog timer diff --git a/drivers/watchdog/mpc8xx_wdt.c b/drivers/watchdog/mpc8xx_wdt.c index 8a7a4c5bc6c3..c8b104d8f567 100644 --- a/drivers/watchdog/mpc8xx_wdt.c +++ b/drivers/watchdog/mpc8xx_wdt.c @@ -11,7 +11,7 @@ #include #include -static void hw_watchdog_reset(void) +void hw_watchdog_reset(void) { immap_t __iomem *immap = (immap_t __iomem *)CONFIG_SYS_IMMR;