From patchwork Fri Nov 30 23:01:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 203075 X-Patchwork-Delegate: albert.aribaud@free.fr 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 2BF3D2C0095 for ; Sat, 1 Dec 2012 10:03:02 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F04D4A0AA; Sat, 1 Dec 2012 00:02:41 +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 fkXzthxtWLV8; Sat, 1 Dec 2012 00:02:41 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5FC874A0FD; Sat, 1 Dec 2012 00:02:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A2AE44A04B for ; Sat, 1 Dec 2012 00:02:03 +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 k-lWVBsWZBdt for ; Sat, 1 Dec 2012 00:02:01 +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-wi0-f202.google.com (mail-wi0-f202.google.com [209.85.212.202]) by theia.denx.de (Postfix) with ESMTPS id 460204A04A for ; Sat, 1 Dec 2012 00:01:50 +0100 (CET) Received: by mail-wi0-f202.google.com with SMTP id hn17so445wib.3 for ; Fri, 30 Nov 2012 15:01:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=ntoZJCDQNFVx7jUDGsIlm9mx7LqAZxG5+ybLS7vAtdQ=; b=f73CGXOzWMjn1n547JKfUJx69Crh7S/QW68p4VmkuJ8URzW7nmUPcF3EuIWyfCvGX8 T7Rogqpjv6PjiCqWm08pB1S6rffsYl9IoQoAivedO42MJMGKX+9RGczI6ReFzNSzsyyN 1qwcq2MgMw71aDihPwanDQE11PjfTufp1iA+TEvd9QxqjZDWk4PpIp3Oe+kkarHByX3u vCS9S+4rFn2RVsOl6TM7NFMX5b6pdt3unH4BR0Dd0gf9Xsm+nZrYHPsY9fvUFVXaiaB3 g+E4ZYWAsWRK+9INXmOnJVhI8GVmR/6iK6YIdqqpvdNZX/3k9PE103KVRO6M8itMISUb UUUA== Received: by 10.14.216.7 with SMTP id f7mr3520463eep.4.1354316510261; Fri, 30 Nov 2012 15:01:50 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id u8si1491342een.1.2012.11.30.15.01.50 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 30 Nov 2012 15:01:50 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id DB6D6200057; Fri, 30 Nov 2012 15:01:49 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 6BE92160A59; Fri, 30 Nov 2012 15:01:33 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 30 Nov 2012 15:01:22 -0800 Message-Id: <1354316484-23515-9-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1354316484-23515-1-git-send-email-sjg@chromium.org> References: <1354316484-23515-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQk0cIIJl1XogyC/DA4Rzzs5n0qKBqiQSUbK5+zJ7HnFqpbFKcbGZH04LunqR1CrvD6x+JWVLfvFlhAfR3v8MjYi9ZqavRLjXS2M0BiPq6RZ1KA6kJ54YoHwT7nONeHWbdnt6d4A2XlCSQGYUmPtFCdITMNP6N8u7nzcez7bpc60yPIXZKTF++MCbJnbNh+NWBHczBUX Subject: [U-Boot] [PATCH v2 09/10] arm: Move bootstage record for board_init_f() to after arch_cpu_init() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 timer may be inited in arch_cpu_init() so it is not safe to make a bootstage mark before this is called. Arrange the code to fix this. Note: The question was raised as to why we don't keep all archs in sync. PowerPC doesn't have specific bootstage markers at present (although it does use boot progress). I hope that the generic board series will solve this problem in general, but in the meantime this is a real problem, and only in ARM. We now get a correct time for board_init_f: Timer summary in microseconds: Mark Elapsed Stage 0 0 reset 100,000 100,000 spl_start 848,530 748,530 board_init_f 907,301 58,771 board_init_r 910,478 3,177 board_init Signed-off-by: Simon Glass --- Changes in v2: - Rebase to master - Update commit message arch/arm/lib/board.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 1d563bb..0410dae 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -232,8 +232,17 @@ int __power_init_board(void) int power_init_board(void) __attribute__((weak, alias("__power_init_board"))); + /* Record the board_init_f() bootstage (after arch_cpu_init()) */ +static int mark_bootstage(void) +{ + bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); + + return 0; +} + init_fnc_t *init_sequence[] = { arch_cpu_init, /* basic arch cpu dependent setup */ + mark_bootstage, #ifdef CONFIG_OF_CONTROL fdtdec_check_fdt, #endif @@ -277,8 +286,6 @@ void board_init_f(ulong bootflag) void *new_fdt = NULL; size_t fdt_size = 0; - bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_F, "board_init_f"); - /* Pointer is writable since we allocated a register for it */ gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07); /* compiler optimization barrier needed for GCC >= 3.4 */