From patchwork Wed Jan 18 05:51:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 716505 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 3v3GN700Fkz9t0C for ; Wed, 18 Jan 2017 16:52:54 +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="YVoXC6P9"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 80E36B3941; Wed, 18 Jan 2017 06:52:42 +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 NsYesGJPYsUE; Wed, 18 Jan 2017 06:52:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E6D9B3943; Wed, 18 Jan 2017 06:52:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1226BB391C for ; Wed, 18 Jan 2017 06:52:32 +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 u_X_Gilr6cBH for ; Wed, 18 Jan 2017 06:52:32 +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-oi0-f53.google.com (mail-oi0-f53.google.com [209.85.218.53]) by theia.denx.de (Postfix) with ESMTPS id 60719B3910 for ; Wed, 18 Jan 2017 06:52:23 +0100 (CET) Received: by mail-oi0-f53.google.com with SMTP id w204so1746745oiw.0 for ; Tue, 17 Jan 2017 21:52:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=hyGK53ffyq91owjRN1CuV3S9W41AcwP2LLnYDXzTuk4=; b=YVoXC6P9RNiq9+3BAnWE0XWKf8+zXfyeJDmX4XiFXRXf+f3kBMOOiijkwBc9fXOo23 kklpg854l0HvcCyeNT+N/fPRWPEH/2xKiROgBJGRzys6GGIOezuvkBlVJAvmOXm3ewTz CVL1OWYl/ln5jsOWLF9cP84hbgM5p6P2yNZ9zn2bxCCQsuZhd3QoaEAuH6iNtzblJmsO +EpVg2OIGiDsRtLwJYoDvv5LXO5uEX7kMpPshjfPOAPz7oEdAcUPgw0DJFjqVHYqqWjd 1Bb+PNl9eiEweYBNv2u1l3aPLXqhL3/mCMuq1S6AN4GxyQx80z5DUSbjqtm78mMl48pq pW4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=hyGK53ffyq91owjRN1CuV3S9W41AcwP2LLnYDXzTuk4=; b=sYQ+kv3eoDN3372Wx91MuG4idAIqifhDl1kvBZQlgejcXuX+v9dCa1JijNg7n1J7TA l+tUiU5ehtjGEjSc719dww4eT4KHRXfom+xy7EdUkRnZuiTkVbuuDCAffDBEE6vHPvaZ 6SHn60+9oOQ4FBx0u0VZPl1Muxxa1E+BIINer4hBAxYFXzitO1MRTTag7GtWVvOoqWOE CyjdhwKUGGkg6MIot8xp/rcD+uGaBAOinck9QcopooGbaVPPtOksgicGDLWF9ZsTTQ68 rBcoruSrC4Cb5t2HnIq8y9VpRKqA0giw2uj34rdiv8DxYjWowlHXn4MX9SEN2du2QQLe QMZQ== X-Gm-Message-State: AIkVDXLnHYQ+Qrq0oqZYHJr8RfMILD6tmFoM8YFkOQ0p2jT2NPxLK5TeZpuxRyVQnzXR2rtd X-Received: by 10.202.253.206 with SMTP id b197mr843286oii.160.1484718741789; Tue, 17 Jan 2017 21:52:21 -0800 (PST) Received: from kaki.bld.corp.google.com ([100.100.197.46]) by smtp.gmail.com with ESMTPSA id 76sm12380289otf.21.2017.01.17.21.52.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 21:52:21 -0800 (PST) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 98B4440487; Tue, 17 Jan 2017 22:52:20 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Tue, 17 Jan 2017 22:51:43 -0700 Message-Id: <20170118055200.6825-8-sjg@chromium.org> X-Mailer: git-send-email 2.11.0.483.g087da7b7c-goog In-Reply-To: <20170118055200.6825-6-sjg@chromium.org> References: <20170118055200.6825-6-sjg@chromium.org> Cc: Tom Rini , Stephen Warren , Michal Simek Subject: [U-Boot] [PATCH 07/22] dm: Build a live tree after relocation 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" If enabled, build a live device tree after relocation. This can then be used by driver model. Signed-off-by: Simon Glass --- common/board_r.c | 12 ++++++++++++ include/livetree.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index a3733526c69..3c865720036 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -33,6 +33,7 @@ #if defined(CONFIG_CMD_KGDB) #include #endif +#include #include #include #include @@ -314,6 +315,14 @@ static int initr_noncached(void) } #endif +#ifdef CONFIG_OF_LIVE +static int initr_livetree(void) +{ + return livetree_build(gd->fdt_blob, + (struct device_node **)&gd->of_root); +} +#endif + #ifdef CONFIG_DM static int initr_dm(void) { @@ -781,6 +790,9 @@ init_fnc_t init_sequence_r[] = { initr_noncached, #endif bootstage_relocate, +#ifdef CONFIG_OF_LIVE + initr_livetree, +#endif #ifdef CONFIG_DM initr_dm, #endif diff --git a/include/livetree.h b/include/livetree.h index aa0a8687c1b..8f8fee73114 100644 --- a/include/livetree.h +++ b/include/livetree.h @@ -10,6 +10,8 @@ #ifndef _LIVETREE_H #define _LIVETREE_H +struct device_node; + /** * livetree_build() - build a live (hierarchical) tree from a flat DT *