From patchwork Fri Feb 4 12:35:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 81882 X-Patchwork-Delegate: graeme.russ@gmail.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 DA4D0B7121 for ; Fri, 4 Feb 2011 23:43:10 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1751D283C9; Fri, 4 Feb 2011 13:43:06 +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 gAN5urFh6XbI; Fri, 4 Feb 2011 13:43:04 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 362CD283D8; Fri, 4 Feb 2011 13:43:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 32E6C283D8 for ; Fri, 4 Feb 2011 13:42:58 +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 3nXWSOD-kaIX for ; Fri, 4 Feb 2011 13:42:56 +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-yx0-f172.google.com (mail-yx0-f172.google.com [209.85.213.172]) by theia.denx.de (Postfix) with ESMTPS id 0635A283C9 for ; Fri, 4 Feb 2011 13:42:54 +0100 (CET) Received: by yxt33 with SMTP id 33so1000541yxt.3 for ; Fri, 04 Feb 2011 04:42:53 -0800 (PST) Received: by 10.236.108.52 with SMTP id p40mr23731898yhg.41.1296823041438; Fri, 04 Feb 2011 04:37:21 -0800 (PST) Received: from helios.localdomain6 (d122-104-34-241.sbr6.nsw.optusnet.com.au [122.104.34.241]) by mx.google.com with ESMTPS id g27sm398868yhc.8.2011.02.04.04.37.19 (version=SSLv3 cipher=RC4-MD5); Fri, 04 Feb 2011 04:37:20 -0800 (PST) From: Graeme Russ To: u-boot@lists.denx.de Date: Fri, 4 Feb 2011 23:35:52 +1100 Message-Id: <1296822959-3927-26-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.1.422.g049e9 In-Reply-To: <1296822959-3927-1-git-send-email-graeme.russ@gmail.com> References: <1296822959-3927-1-git-send-email-graeme.russ@gmail.com> Subject: [U-Boot] [PATCH 25/32] x86: Move test for cold boot into init functions 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 Signed-off-by: Graeme Russ --- arch/i386/cpu/sc520/sc520.c | 7 ++++--- arch/i386/lib/board.c | 17 +++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/arch/i386/cpu/sc520/sc520.c b/arch/i386/cpu/sc520/sc520.c index d5597ca..e5dcac6 100644 --- a/arch/i386/cpu/sc520/sc520.c +++ b/arch/i386/cpu/sc520/sc520.c @@ -45,15 +45,16 @@ int cpu_init_f(void) gd->cpu_clk = 100000000; } - /* wait at least one millisecond */ asm("movl $0x2000, %%ecx\n" "0: pushl %%ecx\n" "popl %%ecx\n" "loop 0b\n": : : "ecx"); - /* turn on the SDRAM write buffer */ - writeb(0x11, &sc520_mmcr->dbctl); + if (gd->flags & GD_FLG_COLD_BOOT) { + /* turn on the SDRAM write buffer */ + writeb(0x11, &sc520_mmcr->dbctl); + } return x86_cpu_init_f(); } diff --git a/arch/i386/lib/board.c b/arch/i386/lib/board.c index 1d47a55..73aaadc 100644 --- a/arch/i386/lib/board.c +++ b/arch/i386/lib/board.c @@ -207,16 +207,13 @@ void board_init_f(ulong boot_flags) dest_addr -= (bss_end - text_start); rel_offset = text_start - dest_addr; - /* Perform low-level initialization only when cold booted */ - if (gd->flags & GD_FLG_COLD_BOOT) { - /* First stage CPU initialization */ - if (cpu_init_f() != 0) - hang(); - - /* First stage Board initialization */ - if (board_early_init_f() != 0) - hang(); - } + /* First stage CPU initialization */ + if (cpu_init_f() != 0) + hang(); + + /* First stage Board initialization */ + if (board_early_init_f() != 0) + hang(); /* Copy U-Boot into RAM */ dst_addr = (ulong *)dest_addr;