From patchwork Sat Feb 27 18:26:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 589444 X-Patchwork-Delegate: trini@ti.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 024E914029E for ; Sun, 28 Feb 2016 05:27:13 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 62679A7879; Sat, 27 Feb 2016 19:27:07 +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 kp2TVpdjtt16; Sat, 27 Feb 2016 19:27:07 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8778CA786F; Sat, 27 Feb 2016 19:26:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A3187A7843 for ; Sat, 27 Feb 2016 19:26:50 +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 B4N8PAw5DQ_3 for ; Sat, 27 Feb 2016 19:26:50 +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 gagarine.paulk.fr (gagarine.paulk.fr [109.190.93.129]) by theia.denx.de (Postfix) with ESMTPS id 42CDEA7849 for ; Sat, 27 Feb 2016 19:26:47 +0100 (CET) Received: by gagarine.paulk.fr (Postfix, from userid 65534) id C94DA20316; Sat, 27 Feb 2016 19:26:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on gagarine.paulk.fr 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 armstrong.paulk.fr (armstrong.paulk.fr [82.233.88.171]) by gagarine.paulk.fr (Postfix) with ESMTPS id 45E3520330; Sat, 27 Feb 2016 19:26:39 +0100 (CET) Received: from localhost.localdomain (aldrin [192.168.0.128]) by armstrong.paulk.fr (Postfix) with ESMTP id 2C59A37811; Sat, 27 Feb 2016 19:26:38 +0100 (CET) From: Paul Kocialkowski To: u-boot@lists.denx.de Date: Sat, 27 Feb 2016 19:26:42 +0100 Message-Id: <1456597604-10981-3-git-send-email-contact@paulk.fr> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1456597604-10981-1-git-send-email-contact@paulk.fr> References: <1456597604-10981-1-git-send-email-contact@paulk.fr> Cc: Tom Rini Subject: [U-Boot] [PATCH 2/4] omap3: Use a define for reboot reason offset 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" This introduces a define for the offset to the reboot reason, rather than hardcoding it. Signed-off-by: Paul Kocialkowski Reviewed-by: Tom Rini --- arch/arm/cpu/armv7/omap3/boot.c | 8 +++++--- arch/arm/include/asm/arch-omap3/omap.h | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/omap3/boot.c b/arch/arm/cpu/armv7/omap3/boot.c index 259c210..64b242b 100644 --- a/arch/arm/cpu/armv7/omap3/boot.c +++ b/arch/arm/cpu/armv7/omap3/boot.c @@ -65,7 +65,8 @@ int omap_reboot_mode(char *mode, unsigned int length) if (length < 2) return -1; - reboot_mode = readl((u32 *)(OMAP34XX_SCRATCHPAD + 4)); + reboot_mode = readl((u32 *)(OMAP34XX_SCRATCHPAD + + OMAP_REBOOT_REASON_OFFSET)); c = (reboot_mode >> 24) & 0xff; if (c != 'B') @@ -85,7 +86,7 @@ int omap_reboot_mode(char *mode, unsigned int length) int omap_reboot_mode_clear(void) { - writel(0, (u32 *)(OMAP34XX_SCRATCHPAD + 4)); + writel(0, (u32 *)(OMAP34XX_SCRATCHPAD + OMAP_REBOOT_REASON_OFFSET)); return 0; } @@ -96,7 +97,8 @@ int omap_reboot_mode_store(char *mode) reboot_mode = 'B' << 24 | 'M' << 16 | mode[0]; - writel(reboot_mode, (u32 *)(OMAP34XX_SCRATCHPAD + 4)); + writel(reboot_mode, (u32 *)(OMAP34XX_SCRATCHPAD + + OMAP_REBOOT_REASON_OFFSET)); return 0; } diff --git a/arch/arm/include/asm/arch-omap3/omap.h b/arch/arm/include/asm/arch-omap3/omap.h index 4044b8d..bc0e02a 100644 --- a/arch/arm/include/asm/arch-omap3/omap.h +++ b/arch/arm/include/asm/arch-omap3/omap.h @@ -249,6 +249,8 @@ struct gpio { /* ABB tranxdone mask */ #define OMAP_ABB_MPU_TXDONE_MASK (0x1 << 26) +#define OMAP_REBOOT_REASON_OFFSET 0x04 + /* Boot parameters */ #ifndef __ASSEMBLY__ struct omap_boot_parameters {