From patchwork Mon Mar 7 17:37:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Moffett X-Patchwork-Id: 85780 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 B28D2B70E1 for ; Tue, 8 Mar 2011 04:41:42 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D660F280F3; Mon, 7 Mar 2011 18:39:43 +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 z02qZ501O5fM; Mon, 7 Mar 2011 18:39:43 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9419280F4; Mon, 7 Mar 2011 18:38:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6E9A928089 for ; Mon, 7 Mar 2011 18:38:25 +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 Ei-d8legav1O for ; Mon, 7 Mar 2011 18:38:25 +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 55BC72809A for ; Mon, 7 Mar 2011 18:38:22 +0100 (CET) Received: from ysera.exmeritus.com (firewall2.exmeritus.com [10.13.38.2]) by border.exmeritus.com (Postfix) with ESMTP id 5B6DAAC096; Mon, 7 Mar 2011 12:38:22 -0500 (EST) From: Kyle Moffett To: u-boot@lists.denx.de Date: Mon, 7 Mar 2011 12:37:36 -0500 Message-Id: <1299519462-25320-16-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: Scott McNutt , Kyle Moffett , Kyle Moffett Subject: [U-Boot] [PATCH 15/21] nios2: Generic system restart support 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 Nios-II port appears to use no generic hardware capability for performing a CPU reset. Since all of the supported boards use the exact same code to perform a jump-to-flash it goes into __arch_restart(). This means that Nios-II has a no-op __arch_emergency_restart() function. If the CPU is in an invalid state then jump-to-FLASH probably won't work. Signed-off-by: Kyle Moffett Cc: Scott McNutt --- arch/nios2/cpu/cpu.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c index ef360ee..9f40188 100644 --- a/arch/nios2/cpu/cpu.c +++ b/arch/nios2/cpu/cpu.c @@ -40,10 +40,20 @@ int checkcpu (void) return (0); } -int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int __arch_restart(void) { disable_interrupts(); /* indirect call to go beyond 256MB limitation of toolchain */ nios2_callr(CONFIG_SYS_RESET_ADDR); return 0; } + +/* + * The __arch_restart() just jumps back to flash, which isn't safe to do in + * emergency conditions. Since we don't have anything better to do, just + * fall through into the default hang(). + */ +void __arch_emergency_restart(void) +{ + return; +}