From patchwork Wed Nov 21 08:51:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 1000983 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.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 Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 430Gcd5b8tz9rxp for ; Wed, 21 Nov 2018 19:55:29 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 51181C221AE; Wed, 21 Nov 2018 08:52:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 120E5C2221E; Wed, 21 Nov 2018 08:51:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 38957C2222B; Wed, 21 Nov 2018 08:51:51 +0000 (UTC) Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) by lists.denx.de (Postfix) with ESMTPS id 565D7C22213 for ; Wed, 21 Nov 2018 08:51:48 +0000 (UTC) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 430GXH3zpFz9txvX; Wed, 21 Nov 2018 09:51:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr 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 oYBZwugfPAiU; Wed, 21 Nov 2018 09:51:43 +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 430GXH3Wqcz9txv1; Wed, 21 Nov 2018 09:51:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DE5FB8B803; Wed, 21 Nov 2018 09:51:47 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr 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 R5HQIoyNdVhC; Wed, 21 Nov 2018 09:51:47 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9E7468B800; Wed, 21 Nov 2018 09:51:47 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 8FAEE69A95; Wed, 21 Nov 2018 08:51:47 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy To: Tom Rini , Jagan Teki Date: Wed, 21 Nov 2018 08:51:47 +0000 (UTC) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 4/9] board: MCR3000: use new DM watchdog X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This patch switches MCR3000 board to the new DM watchdog. The change in u-boot.lds is because MCR3000.o grows a bit with this patch and doesn't fit anymore below env_offset on some versions of GCC. Signed-off-by: Christophe Leroy --- v2: fixed build failure for lack of space before env_offset in u-boot.lds arch/powerpc/dts/mcr3000.dts | 3 +++ board/cssi/MCR3000/MCR3000.c | 16 ++++++++++++++++ board/cssi/MCR3000/u-boot.lds | 1 - configs/MCR3000_defconfig | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/dts/mcr3000.dts b/arch/powerpc/dts/mcr3000.dts index e4b222857b5..ef423d73c20 100644 --- a/arch/powerpc/dts/mcr3000.dts +++ b/arch/powerpc/dts/mcr3000.dts @@ -9,4 +9,7 @@ /dts-v1/; / { + WDT: watchdog@0 { + compatible = "fsl,pq1-wdt"; + }; }; diff --git a/board/cssi/MCR3000/MCR3000.c b/board/cssi/MCR3000/MCR3000.c index ffbeb14ed0f..d26ac35b440 100644 --- a/board/cssi/MCR3000/MCR3000.c +++ b/board/cssi/MCR3000/MCR3000.c @@ -12,6 +12,8 @@ #include #include #include +#include +#include DECLARE_GLOBAL_DATA_PTR; @@ -143,3 +145,17 @@ int board_early_init_f(void) return 0; } + +int board_early_init_r(void) +{ + struct udevice *watchdog_dev = NULL; + + if (uclass_get_device(UCLASS_WDT, 0, &watchdog_dev)) { + puts("Cannot find watchdog!\n"); + } else { + puts("Enabling watchdog.\n"); + wdt_start(watchdog_dev, 0xffff, 0); + } + + return 0; +} diff --git a/board/cssi/MCR3000/u-boot.lds b/board/cssi/MCR3000/u-boot.lds index 447ffded814..70aef3241c8 100644 --- a/board/cssi/MCR3000/u-boot.lds +++ b/board/cssi/MCR3000/u-boot.lds @@ -19,7 +19,6 @@ SECTIONS arch/powerpc/cpu/mpc8xx/start.o (.text) arch/powerpc/cpu/mpc8xx/traps.o (.text*) arch/powerpc/lib/built-in.o (.text*) - board/cssi/MCR3000/built-in.o (.text*) drivers/net/built-in.o (.text*) . = DEFINED(env_offset) ? env_offset : .; diff --git a/configs/MCR3000_defconfig b/configs/MCR3000_defconfig index 6d7dda82a21..2e79425bdbc 100644 --- a/configs/MCR3000_defconfig +++ b/configs/MCR3000_defconfig @@ -42,6 +42,7 @@ CONFIG_BOOTDELAY=5 CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run flashboot" CONFIG_MISC_INIT_R=y +CONFIG_BOARD_EARLY_INIT_R=y CONFIG_HUSH_PARSER=y # CONFIG_AUTO_COMPLETE is not set CONFIG_SYS_PROMPT="S3K> " @@ -76,3 +77,5 @@ CONFIG_OF_LIBFDT=y CONFIG_DM=y CONFIG_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="mcr3000" +CONFIG_WDT=y +CONFIG_WDT_MPC8xx=y