From patchwork Sun Feb 15 21:37:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 439934 X-Patchwork-Delegate: sbabic@denx.de 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 547D9140188 for ; Mon, 16 Feb 2015 08:37:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E9F8D4B8ED; Sun, 15 Feb 2015 22:37:37 +0100 (CET) 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 QYYqUr2KaYFa; Sun, 15 Feb 2015 22:37:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5C2284B8E9; Sun, 15 Feb 2015 22:37:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 119244B8E9 for ; Sun, 15 Feb 2015 22:37:33 +0100 (CET) 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 XTH0tN_xtvQi for ; Sun, 15 Feb 2015 22:37:32 +0100 (CET) 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-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by theia.denx.de (Postfix) with ESMTPS id 872FC4B8E8 for ; Sun, 15 Feb 2015 22:37:29 +0100 (CET) Received: by pdjy10 with SMTP id y10so30847830pdj.13 for ; Sun, 15 Feb 2015 13:37:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/+Jsw0TrQuOcIUbV44YekumfIAAfSR135QTrOY8828s=; b=l9XbpOKV59gz4pjfjLv0aroc+ZwUr1JywhDlkqn9dKCfMxmePymE4qfiEwDw31A77G lp6yP021nVnIAmz3LzkLDs0nRjKodRZjSZaWzWH8ef2zYZfP23wssDY+dCozlWw/w5kU iLHoNbB07xH3UDv+SR/0/TMObsDhhvTCzBSYnorNN6P7xtB/O2GxwIDvLk6mzZCZjMyj jQhIKU5RhMLx2HSVqWZBhHkNJe3rRvYv0mWLN4o03j7TpqXOBSf+xSc3VOreaPQsOSLb 9A5N3r3NY1jaYTIDIzwvsuHbMFNZha2uAbWFLG+UHmR2W2pFAe1UbUkyXp9HSdm2Jngy ZF1Q== X-Gm-Message-State: ALoCoQkYtgdtVyTtP68xxyRVuu5bNIic8pppTCpdU4+p4fk5rJ6estS351tXGcwTfOmCze0YBdYX X-Received: by 10.68.231.102 with SMTP id tf6mr34216493pbc.40.1424036248286; Sun, 15 Feb 2015 13:37:28 -0800 (PST) Received: from ericsam.boundarydevices.com (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by mx.google.com with ESMTPSA id rk9sm12736993pab.40.2015.02.15.13.37.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Feb 2015 13:37:26 -0800 (PST) From: Eric Nelson To: u-boot@lists.denx.de Date: Sun, 15 Feb 2015 14:37:21 -0700 Message-Id: <1424036242-742-1-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <54DB6B0E.3090206@boundarydevices.com> References: <54DB6B0E.3090206@boundarydevices.com> Cc: fabio.estevam@freescale.com, bpringlemeir@nbsps.com Subject: [U-Boot] [PATCH 1/2] ARM: i.MX: provide access to reset cause through get_imx_reset_cause() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Signed-off-by: Eric Nelson --- This patch set replaces http://patchwork.ozlabs.org/patch/436492/. arch/arm/imx-common/cpu.c | 10 +++++++++- arch/arm/include/asm/arch-imx/cpu.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 28ccd29..067d08f 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -24,13 +24,16 @@ #include #endif -char *get_reset_cause(void) +static u32 reset_cause = -1; + +static char *get_reset_cause(void) { u32 cause; struct src *src_regs = (struct src *)SRC_BASE_ADDR; cause = readl(&src_regs->srsr); writel(cause, &src_regs->srsr); + reset_cause = cause; switch (cause) { case 0x00001: @@ -53,6 +56,11 @@ char *get_reset_cause(void) } } +u32 get_imx_reset_cause(void) +{ + return reset_cause; +} + #if defined(CONFIG_MX53) || defined(CONFIG_MX6) #if defined(CONFIG_MX53) #define MEMCTL_BASE ESDCTL_BASE_ADDR diff --git a/arch/arm/include/asm/arch-imx/cpu.h b/arch/arm/include/asm/arch-imx/cpu.h index 254136e..4715f4e 100644 --- a/arch/arm/include/asm/arch-imx/cpu.h +++ b/arch/arm/include/asm/arch-imx/cpu.h @@ -17,3 +17,5 @@ #define CS0_64M_CS1_64M 1 #define CS0_64M_CS1_32M_CS2_32M 2 #define CS0_32M_CS1_32M_CS2_32M_CS3_32M 3 + +u32 get_imx_reset_cause(void);