From patchwork Sun Nov 29 05:16:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 549723 X-Patchwork-Delegate: sjg@chromium.org 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 21CD81401DE for ; Sun, 29 Nov 2015 16:17:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=UyOqcpuQ; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C67674B788; Sun, 29 Nov 2015 06:16:59 +0100 (CET) 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 XxxtyC7SrBcr; Sun, 29 Nov 2015 06:16:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A30E34B78B; Sun, 29 Nov 2015 06:16:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C72B4B78B for ; Sun, 29 Nov 2015 06:16:46 +0100 (CET) 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 t9q72mo-qsSR for ; Sun, 29 Nov 2015 06:16:45 +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-ob0-f174.google.com (mail-ob0-f174.google.com [209.85.214.174]) by theia.denx.de (Postfix) with ESMTPS id 2205C4B788 for ; Sun, 29 Nov 2015 06:16:41 +0100 (CET) Received: by obbbj7 with SMTP id bj7so105645720obb.1 for ; Sat, 28 Nov 2015 21:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=xdSm7OTSr8V06pewSJ6sQzMjCh6Q3AzpLILZR6WCw5o=; b=UyOqcpuQXlc+8dUk1IK1Kh1FUVvBDeTB+utPB72xH2L90bHVdMrnERdoOeGCeBbdvd Fpp1TH8gO5dmHvDhoa00Ccbm4RWm3wqbDtvQahm9aAp5qK/fAo8fCnX0ZG7bn999L/oD eqXEt0j3VTn8JPF+ptw2CCc9VTM+0ZkWc3PaoL+XNFDRtawBSX7z67KwsORaoUiHBUBW 29mg1EEvLetiiiUu+k8ezDoL7VN8FF/Qbdb4jLR5F2xT5ZViWF9BOYWnzvDWeOr/Or3O 9LVQ1Wmh8WcdEbyIiC1cY85Fy+sv40m5f665F3rO08dITRjwD2r5o0fIaC9QIaQthTYJ 3GVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=xdSm7OTSr8V06pewSJ6sQzMjCh6Q3AzpLILZR6WCw5o=; b=Quj8VDEevbYERvmMhJYGvqA8YQ9Ns8+yj5ePfZAtSoQfhZZS3ae9n2smzn4sjMjjVF R8a32jVUekYczF7pCz8eyUmyQJZSSJNpHpt9tbSrjJIlgrgO3YEiLL09GCv6F/2r7rII svzQmnoLwjDpNpgcWQzSqcNyXPcgJ8W2gxns8J7xo9PN4iHouT7bjQt5IiOUN+Iq0yRd MNqblCn5eX/YMb3gohRqRSofkgxun3ijC+TSzzEX0hlecfpKmULMRI7pbmhAjsdI2I4c +A8TZJgpyUwOq+PqTiW1PxWDC0APYVkTPc3xFWf9nky4szmyE4/ETYP9+R1rnIsGij/n WF5A== X-Gm-Message-State: ALoCoQnFfkxfeLiJluxnJtPu/C3sqjRDjhI2SgamtgsIDd/9zlL00W0YDIqkDJ6yZME8OVTzMJIv X-Received: by 10.60.173.42 with SMTP id bh10mr38191441oec.58.1448774199875; Sat, 28 Nov 2015 21:16:39 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by smtp.gmail.com with ESMTPSA id s7sm19114319obk.17.2015.11.28.21.16.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Nov 2015 21:16:38 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id A7A98220A2A; Sat, 28 Nov 2015 22:16:37 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Sat, 28 Nov 2015 22:16:35 -0700 Message-Id: <1448774195-17976-1-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 Cc: "angelo@sysam.it" , Jan Kiszka , Masahiro Yamada , Stefan Roese , Thierry Reding Subject: [U-Boot] [PATCH] dm: timer: Avoid using timer before it is ready X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present bootstage will try to read the timer very early after relocation. When driver model it used to provide the timer, we cannot read it until driver model is ready. Correct this by adding a separate stage for the post-relocation bootstage init. This fixes booting on chromebook_link. Signed-off-by: Simon Glass Acked-by: Thomas Chou Reviewed-by: Bin Meng Reviewed-by: Mugunthan V N --- common/board_r.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/board_r.c b/common/board_r.c index f7118e8..a41fb54 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -109,7 +109,6 @@ static int initr_reloc(void) { /* tell others: relocation done */ gd->flags |= GD_FLG_RELOC | GD_FLG_FULL_MALLOC_INIT; - bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); return 0; } @@ -310,6 +309,14 @@ static int initr_dm(void) } #endif +static int initr_bootstage(void) +{ + /* We cannot do this before initr_dm() */ + bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); + + return 0; +} + __weak int power_init_board(void) { return 0; @@ -748,6 +755,7 @@ init_fnc_t init_sequence_r[] = { #ifdef CONFIG_DM initr_dm, #endif + initr_bootstage, #if defined(CONFIG_ARM) || defined(CONFIG_NDS32) board_init, /* Setup chipselects */ #endif