From patchwork Fri Feb 6 22:06:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 437481 X-Patchwork-Delegate: andreas.biessmann@googlemail.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 C4779140168 for ; Sat, 7 Feb 2015 09:08:00 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 354CB4A053; Fri, 6 Feb 2015 23:07:51 +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 PL7P2Rzox8J0; Fri, 6 Feb 2015 23:07:51 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AE7814B62C; Fri, 6 Feb 2015 23:07:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7561C4A050 for ; Fri, 6 Feb 2015 23:07:44 +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 5M5b-YH2YbNu for ; Fri, 6 Feb 2015 23:07:44 +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-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by theia.denx.de (Postfix) with ESMTPS id 7F8184B612 for ; Fri, 6 Feb 2015 23:07:37 +0100 (CET) Received: by mail-wg0-f43.google.com with SMTP id y19so16171383wgg.2 for ; Fri, 06 Feb 2015 14:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=3WPVnWlBDWEnUdTTQ6m9mFHFITqPgwfSSz0/O/wDxiI=; b=HT20JHBHM2n/xbeveuy1E18TdKJNRa8fumRxYeX5Fi/m6XTEN3zCzHeu091RLJZ/CS b3VDcoku5JV39aF7+RA3bZ8GBlOAmYLIvUIzWQx/FNSDPuuuPdfpe+r9Z8nRoGD7lYhp AHZ2b6hcM5Pjbzs+P/CBY0dipHRBWDbA9uV/TANcAVVi74kryxdLsy+Dfe/wyIVCRhDW 3swBA8t5Vb1RIK/CsLOVPsydAFXw8D0GLijVcMfNpdGzXbYwyfK1BRfQOOei4f6D45ap gYhzN5mJjhWTJj6i5eug3eP17zpPAOf++vYivnNpZQILvzXsnpyHcZy8Tf07p3ij3y0m teVg== X-Received: by 10.180.206.14 with SMTP id lk14mr7663931wic.71.1423260457586; Fri, 06 Feb 2015 14:07:37 -0800 (PST) Received: from localhost (dockstar.er.biessmann.org. [2a01:198:47b:1::10]) by mx.google.com with ESMTPSA id li7sm3166398wic.4.2015.02.06.14.07.36 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Feb 2015 14:07:37 -0800 (PST) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: U-Boot List Date: Fri, 6 Feb 2015 23:06:44 +0100 Message-Id: <1423260410-9290-7-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1423260410-9290-1-git-send-email-andreas.devel@googlemail.com> References: <1423260410-9290-1-git-send-email-andreas.devel@googlemail.com> MIME-Version: 1.0 Cc: Kim Phillips , Waldemar Brodkorb , Kumar Gala , Andy Fleming , Stefan Roese Subject: [U-Boot] [PATCH v3 06/12] avr32: use generic gd->start_addr_sp 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Before avr32 had an extra storage for stack end to have a nice stack printout on exception. Remove this extra storage and use generic gd->start_addr_sp instead. Signed-off-by: Andreas Bießmann --- Changes in v3: - new in v3 Changes in v2: None Changes in v1: None arch/avr32/cpu/exception.c | 6 +++--- arch/avr32/include/asm/global_data.h | 1 - arch/avr32/lib/board.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/avr32/cpu/exception.c b/arch/avr32/cpu/exception.c index 5d1bc68..d6991f6 100644 --- a/arch/avr32/cpu/exception.c +++ b/arch/avr32/cpu/exception.c @@ -96,11 +96,11 @@ void do_unknown_exception(unsigned int ecr, struct pt_regs *regs) printf("CPU Mode: %s\n", cpu_modes[mode]); /* Avoid exception loops */ - if (regs->sp < (gd->arch.stack_end - CONFIG_STACKSIZE) - || regs->sp >= gd->arch.stack_end) + if (regs->sp < (gd->start_addr_sp - CONFIG_STACKSIZE) || + regs->sp >= gd->start_addr_sp) printf("\nStack pointer seems bogus, won't do stack dump\n"); else - dump_mem("\nStack: ", regs->sp, gd->arch.stack_end); + dump_mem("\nStack: ", regs->sp, gd->start_addr_sp); panic("Unhandled exception\n"); } diff --git a/arch/avr32/include/asm/global_data.h b/arch/avr32/include/asm/global_data.h index d82fb7c..60abd00 100644 --- a/arch/avr32/include/asm/global_data.h +++ b/arch/avr32/include/asm/global_data.h @@ -8,7 +8,6 @@ /* Architecture-specific global data */ struct arch_global_data { - unsigned long stack_end; /* highest stack address */ unsigned long cpu_hz; /* cpu core clock frequency */ }; diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c index 13b7fed..99aa96e 100644 --- a/arch/avr32/lib/board.c +++ b/arch/avr32/lib/board.c @@ -157,7 +157,7 @@ void board_init_f(ulong board_type) /* And finally, a new, bigger stack. */ new_sp = (unsigned long *)addr; - gd->arch.stack_end = addr; + gd->start_addr_sp = addr; *(--new_sp) = 0; *(--new_sp) = 0;