From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c40r1-00077g-AO for barebox@lists.infradead.org; Tue, 08 Nov 2016 07:30:00 +0000 Date: Tue, 8 Nov 2016 08:29:36 +0100 From: Sascha Hauer Message-ID: <20161108072936.beuncvhpwxuhumkg@pengutronix.de> References: <20161107074924.blkryleb2eb5bkhy@pengutronix.de> <20161107094802.bhy2wowbri7q3sra@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: Fwd: boot kernel with append device tree To: Alex Vazquez Cc: barebox@lists.infradead.org On Mon, Nov 07, 2016 at 12:01:25PM +0100, Alex Vazquez wrote: > > Is CONFIG_OFTREE enabled in your build? > Yes. Ok, could you please try the following patch? Another possibility would be to disable CONFIG_OFTREE, but it would be good if you could test the patch anyway since the same bug is still present in current master. Sascha ----------------------------------8<-------------------------------- >From 500e5f87f9943958fa4662e29261a0abb4df24d9 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 8 Nov 2016 08:23:17 +0100 Subject: [PATCH] ARM: Fix appended device tree when CONFIG_OFTREE is enabled When CONFIG_OFTREE is enabled the appended device tree is unflattened and put into data->of_root_node, but there it is never used again. To actually use the appended device tree put it into data->oftree instead. Signed-off-by: Sascha Hauer --- arch/arm/lib/bootm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 28b4f4a..8977d08 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -244,12 +244,21 @@ static int do_bootz_linux_fdt(int fd, struct image_data *data) } if (IS_BUILTIN(CONFIG_OFTREE)) { - data->of_root_node = of_unflatten_dtb(oftree); - if (!data->of_root_node) { + struct device_node *root; + + root = of_unflatten_dtb(oftree); + if (!root) { pr_err("unable to unflatten devicetree\n"); ret = -EINVAL; goto err_free; } + data->oftree = of_get_fixed_tree(root); + if (!data->oftree) { + pr_err("Unable to get fixed tree\n"); + ret = -EINVAL; + goto err_free; + } + free(oftree); } else { data->oftree = oftree; -- 2.10.1 -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox