From patchwork Mon Sep 15 11:06:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 389271 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9715A140142 for ; Mon, 15 Sep 2014 21:09:00 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 85411A77F4; Mon, 15 Sep 2014 13:08:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3f3hIIrqhRiC; Mon, 15 Sep 2014 13:08:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ACB28A7A7A; Mon, 15 Sep 2014 13:07:27 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6CD4DA7A1D for ; Mon, 15 Sep 2014 13:07:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E6FD1+Mxb9gA for ; Mon, 15 Sep 2014 13:07:10 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTPS id 59DF5A7A38 for ; Mon, 15 Sep 2014 13:06:59 +0200 (CEST) Received: from mail.nefkom.net (unknown [192.168.8.184]) by mail-out.m-online.net (Postfix) with ESMTP id 3hxPsZ4W91z3hj9w; Mon, 15 Sep 2014 13:06:58 +0200 (CEST) X-Auth-Info: DPwQAUTnRaqFv/ZmMgvLYVSCF2YsCiGzsl537mZ7jxE= Received: from chi.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3hxPsZ14PzzvhTk; Mon, 15 Sep 2014 13:06:58 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 15 Sep 2014 13:06:03 +0200 Message-Id: <1410779188-6880-11-git-send-email-marex@denx.de> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1410779188-6880-1-git-send-email-marex@denx.de> References: <1410779188-6880-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Pavel Machek , Chin Liang See , Tom Rini Subject: [U-Boot] [PATCH 10/35] arm: socfpga: Add watchdog disable for socfpga X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Pavel Machek This adds watchdog disable. It is neccessary for running Linux kernel. Signed-off-by: Pavel Machek Signed-off-by: Marek Vasut Cc: Chin Liang See Cc: Dinh Nguyen Cc: Albert Aribaud Cc: Tom Rini Cc: Wolfgang Denk Cc: Pavel Machek --- arch/arm/cpu/armv7/socfpga/misc.c | 4 ++++ arch/arm/cpu/armv7/socfpga/reset_manager.c | 13 +++++++++++++ arch/arm/include/asm/arch-socfpga/reset_manager.h | 2 ++ 3 files changed, 19 insertions(+) diff --git a/arch/arm/cpu/armv7/socfpga/misc.c b/arch/arm/cpu/armv7/socfpga/misc.c index ecae393..15cd8c2 100644 --- a/arch/arm/cpu/armv7/socfpga/misc.c +++ b/arch/arm/cpu/armv7/socfpga/misc.c @@ -8,6 +8,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -38,6 +39,9 @@ int overwrite_console(void) int misc_init_r(void) { + /* This is needed, otherwise kernel is rebooted by watchdog. */ + watchdog_disable(); + return 0; } diff --git a/arch/arm/cpu/armv7/socfpga/reset_manager.c b/arch/arm/cpu/armv7/socfpga/reset_manager.c index e320c01..07b8c4f 100644 --- a/arch/arm/cpu/armv7/socfpga/reset_manager.c +++ b/arch/arm/cpu/armv7/socfpga/reset_manager.c @@ -14,6 +14,19 @@ DECLARE_GLOBAL_DATA_PTR; static const struct socfpga_reset_manager *reset_manager_base = (void *)SOCFPGA_RSTMGR_ADDRESS; +#define RSTMGR_PERMODRST_L4WD0_LSB 6 + +/* Disable the watchdog (toggle reset to watchdog) */ +void watchdog_disable(void) +{ + /* assert reset for watchdog */ + setbits_le32(&reset_manager_base->per_mod_reset, + (1<per_mod_reset, + (1<