summaryrefslogtreecommitdiffstats
path: root/commands/bootm.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-02-04 15:49:04 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-04 15:49:04 +0100
commit0b12784089b6a4372ed27cf1fd578d85a7d3dbd4 (patch)
tree6f25a55d72f51aeb1d42f02bf5f56edcc051b41a /commands/bootm.c
parent5c6cc8736ed4e14119fb2e8c0ed1ecab7caff9ae (diff)
parent9a554f8ff25685e44431079e73887b061d6f4a41 (diff)
downloadbarebox-0b12784089b6a4372ed27cf1fd578d85a7d3dbd4.tar.gz
barebox-0b12784089b6a4372ed27cf1fd578d85a7d3dbd4.tar.xz
Merge branch 'for-next/oftree'
Conflicts: drivers/of/base.c
Diffstat (limited to 'commands/bootm.c')
-rw-r--r--commands/bootm.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/commands/bootm.c b/commands/bootm.c
index 5ccf2372ac..4d3f0221ca 100644
--- a/commands/bootm.c
+++ b/commands/bootm.c
@@ -139,9 +139,7 @@ static int bootm_open_oftree(struct image_data *data, const char *oftree, int nu
{
enum filetype ft;
struct fdt_header *fdt, *fixfdt;
- int ret;
size_t size;
- unsigned int align;
printf("Loading devicetree from '%s'\n", oftree);
@@ -189,36 +187,18 @@ static int bootm_open_oftree(struct image_data *data, const char *oftree, int nu
file_type_to_string(ft));
}
- /*
- * ARM Linux uses a single 1MiB section (with 1MiB alignment)
- * for mapping the devicetree, so we are not allowed to cross
- * 1MiB boundaries.
- */
- align = 1 << fls(size + OFTREE_SIZE_INCREASE - 1);
-
- fixfdt = xmemalign(align, size + OFTREE_SIZE_INCREASE);
- memcpy(fixfdt, fdt, size);
-
-
- ret = fdt_open_into(fdt, fixfdt, size + OFTREE_SIZE_INCREASE);
+ fixfdt = of_get_fixed_tree(fdt);
+ if (!fixfdt)
+ return -EINVAL;
free(fdt);
- if (ret) {
- printf("unable to parse %s\n", oftree);
- return -ENODEV;
- }
-
- ret = of_fix_tree(fixfdt);
- if (ret)
- return ret;
-
if (bootm_verbose(data) > 1)
fdt_print(fixfdt, "/");
data->oftree = fixfdt;
- return ret;
+ return 0;
}
#endif
@@ -420,6 +400,10 @@ static int do_bootm(int argc, char *argv[])
ret = bootm_open_oftree(&data, oftree, oftree_num);
if (ret)
goto err_out;
+ } else {
+ data.oftree = of_get_fixed_tree(NULL);
+ if (bootm_verbose(&data) && data.oftree)
+ printf("using internal devicetree\n");
}
#endif
if (data.os_address == UIMAGE_SOME_ADDRESS)