From patchwork Mon Mar 7 17:37:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Moffett X-Patchwork-Id: 85775 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 67D8CB70F9 for ; Tue, 8 Mar 2011 04:40:29 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 85A832815F; Mon, 7 Mar 2011 18:39:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 QmUknGh-VbWD; Mon, 7 Mar 2011 18:39:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8CB2E280CA; Mon, 7 Mar 2011 18:38:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4E3AC280A0 for ; Mon, 7 Mar 2011 18:38:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 6PqUL45wzDBD for ; Mon, 7 Mar 2011 18:38:23 +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 border.exmeritus.com (wsip-70-167-241-26.dc.dc.cox.net [70.167.241.26]) by theia.denx.de (Postfix) with ESMTP id 1C95D280A8 for ; Mon, 7 Mar 2011 18:38:21 +0100 (CET) Received: from ysera.exmeritus.com (firewall2.exmeritus.com [10.13.38.2]) by border.exmeritus.com (Postfix) with ESMTP id 21134AC083; Mon, 7 Mar 2011 12:38:21 -0500 (EST) From: Kyle Moffett To: u-boot@lists.denx.de Date: Mon, 7 Mar 2011 12:37:30 -0500 Message-Id: <1299519462-25320-10-git-send-email-Kyle.D.Moffett@boeing.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1299519462-25320-1-git-send-email-Kyle.D.Moffett@boeing.com> References: <1299519462-25320-1-git-send-email-Kyle.D.Moffett@boeing.com> Cc: Kyle Moffett , Kyle Moffett Subject: [U-Boot] [PATCH 09/21] blackfin: Replace "bfin_reset_or_hang()" with "panic()" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The bfin_reset_or_hang function unnecessarily duplicates the panic() logic based on CONFIG_PANIC_HANG. This patch deletes 20 lines of code and just calls panic() instead. This also makes the following generic-restart conversion patch simpler. Signed-off-by: Kyle Moffett Cc: Mike Frysinger --- arch/blackfin/cpu/cpu.h | 1 - arch/blackfin/cpu/reset.c | 19 +------------------ arch/blackfin/cpu/traps.c | 2 +- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/arch/blackfin/cpu/cpu.h b/arch/blackfin/cpu/cpu.h index ba85e0b..e70560f 100644 --- a/arch/blackfin/cpu/cpu.h +++ b/arch/blackfin/cpu/cpu.h @@ -28,7 +28,6 @@ #include void board_reset(void) __attribute__((__weak__)); -void bfin_reset_or_hang(void) __attribute__((__noreturn__)); void bfin_dump(struct pt_regs *reg); void bfin_panic(struct pt_regs *reg); void dump(struct pt_regs *regs); diff --git a/arch/blackfin/cpu/reset.c b/arch/blackfin/cpu/reset.c index 164afde..49d0cf8 100644 --- a/arch/blackfin/cpu/reset.c +++ b/arch/blackfin/cpu/reset.c @@ -80,27 +80,10 @@ static void bfin_reset(void) * PC relative call with a 25 bit immediate. This is not enough * to get us from the top of SDRAM into L1. */ -__attribute__ ((__noreturn__)) -static inline void bfin_reset_trampoline(void) +int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (board_reset) board_reset(); while (1) asm("jump (%0);" : : "a" (bfin_reset)); } - -__attribute__ ((__noreturn__)) -void bfin_reset_or_hang(void) -{ -#ifdef CONFIG_PANIC_HANG - hang(); -#else - bfin_reset_trampoline(); -#endif -} - -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -{ - bfin_reset_trampoline(); - return 0; -} diff --git a/arch/blackfin/cpu/traps.c b/arch/blackfin/cpu/traps.c index 09388aa..0cb833a 100644 --- a/arch/blackfin/cpu/traps.c +++ b/arch/blackfin/cpu/traps.c @@ -426,5 +426,5 @@ void bfin_panic(struct pt_regs *regs) unsigned long tflags; trace_buffer_save(tflags); bfin_dump(regs); - bfin_reset_or_hang(); + panic("PANIC: Blackfin internal error"); }