From patchwork Tue Mar 15 17:04:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Moffett X-Patchwork-Id: 87018 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 0124CB70DC for ; Wed, 16 Mar 2011 04:05:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5079D2809E; Tue, 15 Mar 2011 18:05:09 +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 EPw2NmKIyoOZ; Tue, 15 Mar 2011 18:05:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3F2BE280A7; Tue, 15 Mar 2011 18:04:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9F5DA28097 for ; Tue, 15 Mar 2011 18:04: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 4ApQ09dajjvf for ; Tue, 15 Mar 2011 18:04:43 +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 0649328090 for ; Tue, 15 Mar 2011 18:04:40 +0100 (CET) Received: from ysera.exmeritus.com (firewall2.exmeritus.com [10.13.38.2]) by border.exmeritus.com (Postfix) with ESMTP id 6856BAC07E; Tue, 15 Mar 2011 13:04:39 -0400 (EDT) From: Kyle Moffett To: u-boot@lists.denx.de Date: Tue, 15 Mar 2011 13:04:23 -0400 Message-Id: <1300208664-18339-4-git-send-email-Kyle.D.Moffett@boeing.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1300208664-18339-1-git-send-email-Kyle.D.Moffett@boeing.com> References: <1300208664-18339-1-git-send-email-Kyle.D.Moffett@boeing.com> Cc: Andy Fleming , Kumar Gala , John Livingston , Kyle Moffett , York Sun Subject: [U-Boot] [PATCH v6 3/4] mpc85xx: Add a board-specific restart hook 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 HWW-1U-1A board needs to be able to override the "reset" command due to hardware design limitations. Signed-off-by: Kyle Moffett Cc: Andy Fleming Cc: Kumar Gala --- Changelog: v2: Removed in favor of more involved reset rework v6: Resurrected again (the more involved rework was NAKed) arch/powerpc/cpu/mpc85xx/cpu.c | 27 ++++++++++++++++++++++----- 1 files changed, 22 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index 49ea6cc..75e4aab 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -203,11 +203,17 @@ int checkcpu (void) /* ------------------------------------------------------------------------- */ -int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +/* Board-specific reset stub */ +__attribute__((__weak__)) +int __board_restart(void) { -/* Everything after the first generation of PQ3 parts has RSTCR */ + return 0; +} + #if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \ defined(CONFIG_MPC8555) || defined(CONFIG_MPC8560) +int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ unsigned long val, msr; /* @@ -221,14 +227,25 @@ int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) val = mfspr(DBCR0); val |= 0x70000000; mtspr(DBCR0,val); +} #else - volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); +int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +{ + /* Everything after the first generation of PQ3 parts has RSTCR */ + ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + + /* Allow boards to override the reset */ + int err = __board_restart(); + if (err) + return err; + out_be32(&gur->rstcr, 0x2); /* HRESET_REQ */ udelay(100); -#endif - return 1; } +#endif + + /*