diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-02-20 00:10:44 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-03-06 11:41:28 +0100 |
commit | 64c199dd29b7eed9def158afba2036fd2ebe905a (patch) | |
tree | 6a5d2ff97d2057f369157bdabe124874f4fdf6f8 /commands/bootm.c | |
parent | ef317ef43d311c6769984e3f07d968abc4924b80 (diff) | |
download | barebox-64c199dd29b7eed9def158afba2036fd2ebe905a.tar.gz barebox-64c199dd29b7eed9def158afba2036fd2ebe905a.tar.xz |
of: Pass barebox internal format devicetree to of_get_fixed_tree
With this every devicetree is first converted to the barebox internal
format before it's converted back to dtb again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/bootm.c')
-rw-r--r-- | commands/bootm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/commands/bootm.c b/commands/bootm.c index 4d3f0221ca..38233e72f1 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -140,6 +140,7 @@ static int bootm_open_oftree(struct image_data *data, const char *oftree, int nu enum filetype ft; struct fdt_header *fdt, *fixfdt; size_t size; + struct device_node *node; printf("Loading devicetree from '%s'\n", oftree); @@ -187,7 +188,13 @@ static int bootm_open_oftree(struct image_data *data, const char *oftree, int nu file_type_to_string(ft)); } - fixfdt = of_get_fixed_tree(fdt); + node = of_unflatten_dtb(NULL, fdt); + if (!node) { + pr_err("unable to unflatten devicetree\n"); + return -EINVAL; + } + + fixfdt = of_get_fixed_tree(node); if (!fixfdt) return -EINVAL; |