From patchwork Mon Feb 15 01:36:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 582659 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 40B5B1402C4 for ; Mon, 15 Feb 2016 12:40:15 +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=K50eBXLj; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 766F4A7620; Mon, 15 Feb 2016 02:39:16 +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 X0ei3BWf-afJ; Mon, 15 Feb 2016 02:39:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B7D0EA74DE; Mon, 15 Feb 2016 02:38:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7D101A7579 for ; Mon, 15 Feb 2016 02:38:12 +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 PBRbjXe1S5dA for ; Mon, 15 Feb 2016 02:38:12 +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-f177.google.com (mail-ob0-f177.google.com [209.85.214.177]) by theia.denx.de (Postfix) with ESMTPS id 3CD06A756B for ; Mon, 15 Feb 2016 02:38:05 +0100 (CET) Received: by mail-ob0-f177.google.com with SMTP id xk3so192340429obc.2 for ; Sun, 14 Feb 2016 17:38:05 -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:in-reply-to:references; bh=BA1HhpZyvMzStlAdvXEu8WGfqYrHdqQNSVqnB9yVx/0=; b=K50eBXLj16CFIHB6Dfy7PEJtNy9pNFJNbiTdxoxq16cvbxPgaxcp0OXhpX/E1UicSw fywBsb+u+ba3xttP1d8xRFZ2JmgQre4bteal5QS7cT0CUFGKucvyhpaGTw3NrYoWqwHY r1sg7cF8eG1BpScPV1AgpaQEEYNtkCUYHicRAuKcY6ehXC5j5yiUgJaYATbQnWk7dFsq xDT++jN9/eWkgJnc22Pjkip10gwfVcFuMBBEiojfYt+P3E67AMnhcXgyqrplrhyK6NHR 4iC8m2RLqraeI0RfZF1azs/Vgx9Jwl3WH4e1ZSA/P5lDOToL1nJ9kM11s4l/I191Vl9+ 9qnA== 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 :in-reply-to:references; bh=BA1HhpZyvMzStlAdvXEu8WGfqYrHdqQNSVqnB9yVx/0=; b=OE563AZhFD7sW9GUJFIrtTG4wLRZ/BZczojprvIz8rJfUHoyo/5zG1utK02SqRs+nQ 2FHgmR/nn1x2G3nxS4XmKUCOvC1b8PGJcNADDRiqhbL19dqOBOKfDy8z8Eyt3J/5Eg2O +38Kpq68cyVRwwg0DE1WylLX2yUdOZC0v6UB7z32IXft50mQ1xHDGdi0BI2uOcsefoOF T/AzyO5ROVqZN4SEN5Iu2OO5VvloziZvabDBnmXO0DSmu6qvNPYWj3IReHMUEbE2gpiP IkYJkyg4ataN+CyX2eb+Fxz76U4wuuPZ1/9yI4IV0URsSOpToG9C9nMLOLLgJmte5zOb YVhw== X-Gm-Message-State: AG10YOSzogRjFmwvAffi8eW69Q+PApZOb1ARC1Ec6uSNgQKQgWYRuJ8jGR+lReyxVMYfhfMC X-Received: by 10.182.186.105 with SMTP id fj9mr10334225obc.17.1455500284339; Sun, 14 Feb 2016 17:38:04 -0800 (PST) Received: from kaki.bld.corp.google.com ([2620:0:1005:1100:c5a1:13c0:c018:abc6]) by smtp.gmail.com with ESMTPSA id cn2sm14440731oeb.8.2016.02.14.17.38.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Feb 2016 17:38:02 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 702EE225DB6; Sun, 14 Feb 2016 18:37:59 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Sun, 14 Feb 2016 18:36:53 -0700 Message-Id: <1455500220-1324-10-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1455500220-1324-1-git-send-email-sjg@chromium.org> References: <1455500220-1324-1-git-send-email-sjg@chromium.org> Cc: Tom Rini , Stefan Roese , "angelo@sysam.it" , Joe Hershberger , Alexey Brodkin , Jan Kiszka , Bernhard Nortmann , York Sun Subject: [U-Boot] [PATCH 09/16] timer: Set up the real timer after driver model is available 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" When using the early timer, we need to manually trigger setting up the real timer. This will not happen automatically. Do this immediately after starting driver model. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- common/board_f.c | 6 ++++++ common/board_r.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index a960144..622093a 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -805,6 +806,11 @@ static int initf_dm(void) if (ret) return ret; #endif +#ifdef CONFIG_TIMER_EARLY + ret = dm_timer_init(); + if (ret) + return ret; +#endif return 0; } diff --git a/common/board_r.c b/common/board_r.c index 6c23865..52a9b26 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #ifdef CONFIG_CMD_AMBAPP @@ -312,13 +313,22 @@ static int initr_noncached(void) #ifdef CONFIG_DM static int initr_dm(void) { + int ret; + /* Save the pre-reloc driver model and start a new one */ gd->dm_root_f = gd->dm_root; gd->dm_root = NULL; -#ifdef CONFIG_TIMER + ret = dm_init_and_scan(false); + if (ret) + return ret; +#ifdef CONFIG_TIMER_EARLY gd->timer = NULL; + ret = dm_timer_init(); + if (ret) + return ret; #endif - return dm_init_and_scan(false); + + return 0; } #endif