From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjpGO-00063G-VL for barebox@lists.infradead.org; Wed, 16 Jan 2019 17:46:08 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gjpGL-0006gW-CY for barebox@lists.infradead.org; Wed, 16 Jan 2019 18:46:01 +0100 Received: from afa by dude.hi.pengutronix.de with local (Exim 4.92-RC4) (envelope-from ) id 1gjpGK-0007qV-QU for barebox@lists.infradead.org; Wed, 16 Jan 2019 18:46:00 +0100 From: Ahmad Fatoum Date: Wed, 16 Jan 2019 18:45:52 +0100 Message-Id: <20190116174559.17416-5-a.fatoum@pengutronix.de> In-Reply-To: <20190116174559.17416-1-a.fatoum@pengutronix.de> References: <20190116174559.17416-1-a.fatoum@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 04/11] ARM: at91: watchdog: implement at91_wdt_disable To: barebox@lists.infradead.org Low level init code might want to disable the watchdog in PBL. Provide a helper to do so. Signed-off-by: Ahmad Fatoum --- arch/arm/mach-at91/include/mach/at91_wdt.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm/mach-at91/include/mach/at91_wdt.h b/arch/arm/mach-at91/include/mach/at91_wdt.h index 36d37b9d2d64..ecb50edc8c70 100644 --- a/arch/arm/mach-at91/include/mach/at91_wdt.h +++ b/arch/arm/mach-at91/include/mach/at91_wdt.h @@ -35,4 +35,20 @@ #define AT91_WDT_WDUNF (1 << 0) /* Watchdog Underflow */ #define AT91_WDT_WDERR (1 << 1) /* Watchdog Error */ +#ifndef __ASSEMBLY__ +// SPDX-License-Identifier: BSD-1-Clause +/* + * Copyright (c) 2006, Atmel Corporation + */ + +#include + +static inline void at91_wdt_disable(void __iomem *wdt_base) +{ + u32 reg = __raw_readl(wdt_base + AT91_WDT_MR); + reg |= AT91_WDT_WDDIS; + __raw_writel(reg, wdt_base + AT91_WDT_MR); +} + +#endif /* __ASSEMBLY__ */ #endif -- 2.20.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox