From patchwork Mon Mar 7 17:37:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Moffett X-Patchwork-Id: 85786 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 78D0CB70F7 for ; Tue, 8 Mar 2011 04:42:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 675D12808C; Mon, 7 Mar 2011 18:40:13 +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 BwPTcJwyX2n3; Mon, 7 Mar 2011 18:40:13 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8ACAB28086; Mon, 7 Mar 2011 18:38:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 91B0E280AA for ; Mon, 7 Mar 2011 18:38:28 +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 tugMJPDjsvBf for ; Mon, 7 Mar 2011 18:38:27 +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 11AB828087 for ; Mon, 7 Mar 2011 18:38:23 +0100 (CET) Received: from ysera.exmeritus.com (firewall2.exmeritus.com [10.13.38.2]) by border.exmeritus.com (Postfix) with ESMTP id 6C2D7AC09D; Mon, 7 Mar 2011 12:38:23 -0500 (EST) From: Kyle Moffett To: u-boot@lists.denx.de Date: Mon, 7 Mar 2011 12:37:40 -0500 Message-Id: <1299519462-25320-20-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 19/21] sparc: Unify duplicate reset code 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 Both Sparc processor variants have the same do_reset() and reset_cpu() function implementations. Furthermore, the only caller of the reset_cpu() function on Sparc is do_reset(). To simplify and prepare for Sparc generic-restart support this patch removes 26 lines of code by merging the functions together and moving them into common code. Signed-off-by: Kyle Moffett Cc: Daniel Hellstrom --- arch/sparc/cpu/leon2/cpu.c | 18 ------------------ arch/sparc/cpu/leon3/cpu.c | 19 ------------------- arch/sparc/lib/board.c | 11 +++++++++++ 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/arch/sparc/cpu/leon2/cpu.c b/arch/sparc/cpu/leon2/cpu.c index 46512c7..7d9ae4a 100644 --- a/arch/sparc/cpu/leon2/cpu.c +++ b/arch/sparc/cpu/leon2/cpu.c @@ -40,24 +40,6 @@ int checkcpu(void) /* ------------------------------------------------------------------------- */ -void cpu_reset(void) -{ - /* Interrupts off */ - disable_interrupts(); - - /* jump to restart in flash */ - _reset_reloc(); -} - -int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) -{ - cpu_reset(); - - return 1; -} - -/* ------------------------------------------------------------------------- */ - #ifdef CONFIG_GRETH int cpu_eth_init(bd_t *bis) { diff --git a/arch/sparc/cpu/leon3/cpu.c b/arch/sparc/cpu/leon3/cpu.c index a1646e2..58c97a7 100644 --- a/arch/sparc/cpu/leon3/cpu.c +++ b/arch/sparc/cpu/leon3/cpu.c @@ -41,25 +41,6 @@ int checkcpu(void) return 0; } -/* ------------------------------------------------------------------------- */ - -void cpu_reset(void) -{ - /* Interrupts off */ - disable_interrupts(); - - /* jump to restart in flash */ - _reset_reloc(); -} - -int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) -{ - cpu_reset(); - - return 1; - -} - u64 flash_read64(void *addr) { return __raw_readq(addr); diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c index 386cd04..128ece7 100644 --- a/arch/sparc/lib/board.c +++ b/arch/sparc/lib/board.c @@ -445,4 +445,15 @@ void hang(void) for (;;) ; } +int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) +{ + /* Interrupts off */ + disable_interrupts(); + + /* jump to restart in flash */ + _reset_reloc(); + + return 1; +} + /************************************************************************/