}
fdt_chosen(working_fdt, 1);
- fdt_initrd(working_fdt, initrd_start, initrd_end, 1);
+ fdt_initrd(working_fdt, initrd_start, initrd_end);
#if defined(CONFIG_FIT_SIGNATURE)
} else if (strncmp(argv[1], "che", 3) == 0) {
}
#endif
-int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force)
+int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end)
{
int nodeoffset, addr_cell_len;
int err, j, total;
fdt64_t tmp;
- const char *path;
uint64_t addr, size;
/* find or create "/chosen" node. */
addr_cell_len = get_cells_len(fdt, "#address-cells");
- path = fdt_getprop(fdt, nodeoffset, "linux,initrd-start", NULL);
- if ((path == NULL) || force) {
- write_cell((u8 *)&tmp, initrd_start, addr_cell_len);
- err = fdt_setprop(fdt, nodeoffset,
- "linux,initrd-start", &tmp, addr_cell_len);
- if (err < 0) {
- printf("WARNING: "
- "could not set linux,initrd-start %s.\n",
- fdt_strerror(err));
- return err;
- }
- write_cell((u8 *)&tmp, initrd_end, addr_cell_len);
- err = fdt_setprop(fdt, nodeoffset,
+ write_cell((u8 *)&tmp, initrd_start, addr_cell_len);
+ err = fdt_setprop(fdt, nodeoffset,
+ "linux,initrd-start", &tmp, addr_cell_len);
+ if (err < 0) {
+ printf("WARNING: could not set linux,initrd-start %s.\n",
+ fdt_strerror(err));
+ return err;
+ }
+ write_cell((u8 *)&tmp, initrd_end, addr_cell_len);
+ err = fdt_setprop(fdt, nodeoffset,
"linux,initrd-end", &tmp, addr_cell_len);
- if (err < 0) {
- printf("WARNING: could not set linux,initrd-end %s.\n",
- fdt_strerror(err));
+ if (err < 0) {
+ printf("WARNING: could not set linux,initrd-end %s.\n",
+ fdt_strerror(err));
- return err;
- }
+ return err;
}
return 0;
/* Create a new LMB reservation */
lmb_reserve(lmb, (ulong)blob, of_size);
- fdt_initrd(blob, *initrd_start, *initrd_end, 1);
+ fdt_initrd(blob, *initrd_start, *initrd_end);
if (!ft_verify_fdt(blob))
return -1;
u32 fdt_getprop_u32_default(const void *fdt, const char *path,
const char *prop, const u32 dflt);
int fdt_chosen(void *fdt, int force);
-int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end, int force);
+int fdt_initrd(void *fdt, ulong initrd_start, ulong initrd_end);
void do_fixup_by_path(void *fdt, const char *path, const char *prop,
const void *val, int len, int create);
void do_fixup_by_path_u32(void *fdt, const char *path, const char *prop,