From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from webbox1416.server-home.net ([77.236.96.61]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ahuZr-000806-TA for barebox@lists.infradead.org; Mon, 21 Mar 2016 07:48:41 +0000 Received: from imapserver.systec-electronic.com (unknown [212.185.67.146]) by webbox1416.server-home.net (Postfix) with ESMTPA id 2521B27A5F0 for ; Mon, 21 Mar 2016 08:48:06 +0100 (CET) From: Alexander Stein Date: Mon, 21 Mar 2016 08:47:56 +0100 Message-Id: <1458546476-20624-1-git-send-email-alexander.stein@systec-electronic.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 1/1] ARM i.MX35: Read reset source from CCM To: barebox@lists.infradead.org Cc: Alexander Stein CCM has reset status bits with more detailed information than the watchdog. Set reset source with higher priority. Signed-off-by: Alexander Stein --- arch/arm/mach-imx/clk-imx35.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c index 2433d73..af6c405 100644 --- a/arch/arm/mach-imx/clk-imx35.c +++ b/arch/arm/mach-imx/clk-imx35.c @@ -14,6 +14,7 @@ #include #include #include +#include #include "clk.h" @@ -95,12 +96,31 @@ static int imx35_ccm_probe(struct device_d *dev) struct arm_ahb_div *aad; unsigned char *hsp_div; void __iomem *base; + u32 reg; iores = dev_request_mem_resource(dev, 0); if (IS_ERR(iores)) return PTR_ERR(iores); base = IOMEM(iores->start); + /* Check reset source */ + reg = readl(base + CCM_RCSR); + + switch (reg & 0x0F) { + case 0x00: + reset_source_set_priority(RESET_POR, 200); + break; + case 0x02: + reset_source_set_priority(RESET_JTAG, 200); + break; + case 0x04: + reset_source_set_priority(RESET_RST, 200); + break; + case 0x08: + reset_source_set_priority(RESET_WDG, 200); + break; + } + writel(0xffffffff, base + CCM_CGR0); writel(0xffffffff, base + CCM_CGR1); writel(0xfbffffff, base + CCM_CGR2); -- 2.7.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox