diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-03-03 14:06:29 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-03-06 11:41:29 +0100 |
commit | 973e58e3abdc70f3d28c61961a4fc7b0acac0719 (patch) | |
tree | 17afc74f845bc0cdf24539a567359b5c4b21c401 /common | |
parent | 6d6edfcf53be19efa040b3a6fcb7583ce1fca573 (diff) | |
download | barebox-973e58e3abdc70f3d28c61961a4fc7b0acac0719.tar.gz barebox-973e58e3abdc70f3d28c61961a4fc7b0acac0719.tar.xz |
ARM bootm: Switch initrd support to unflattened tree
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/oftree.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/common/oftree.c b/common/oftree.c index 44ffadec3f..e6c82d602a 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -273,72 +273,6 @@ int fdt_get_path_or_create(struct fdt_header *fdt, const char *path) return nodeoffset; } -int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force) -{ - int nodeoffset; - int err, j, total; - u32 tmp; - const char *path; - uint64_t addr, size; - - /* Find the "chosen" node */ - nodeoffset = fdt_path_offset(fdt, "/chosen"); - - /* If there is no "chosen" node in the blob return */ - if (nodeoffset < 0) { - printf("fdt_initrd: %s\n", fdt_strerror(nodeoffset)); - return nodeoffset; - } - - /* just return if initrd_start/end aren't valid */ - if ((initrd_start == 0) || (initrd_end == 0)) - return 0; - - total = fdt_num_mem_rsv(fdt); - - /* - * Look for an existing entry and update it. If we don't find - * the entry, we will j be the next available slot. - */ - for (j = 0; j < total; j++) { - err = fdt_get_mem_rsv(fdt, j, &addr, &size); - if (addr == initrd_start) { - fdt_del_mem_rsv(fdt, j); - break; - } - } - - err = fdt_add_mem_rsv(fdt, initrd_start, initrd_end - initrd_start); - if (err < 0) { - printf("fdt_initrd: %s\n", fdt_strerror(err)); - return err; - } - - path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL); - if (!path || force) { - tmp = __cpu_to_be32(initrd_start); - err = fdt_setprop(fdt, nodeoffset, - "linux,initrd-start", &tmp, sizeof(tmp)); - if (err < 0) { - printf("WARNING: " - "could not set linux,initrd-start %s.\n", - fdt_strerror(err)); - return err; - } - tmp = __cpu_to_be32(initrd_end); - err = fdt_setprop(fdt, nodeoffset, - "linux,initrd-end", &tmp, sizeof(tmp)); - if (err < 0) { - printf("WARNING: could not set linux,initrd-end %s.\n", - fdt_strerror(err)); - - return err; - } - } - - return 0; -} - static int of_fixup_bootargs(struct device_node *root) { struct device_node *node; |