When the node 'reserved-memory' is not defined in the DT we fail
to add needed properties. We also fail to move 'offs' to point to
the new node. Fix these here.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
u32 sec_mem_start = CONFIG_TI_SECURE_EMIF_REGION_START;
u32 sec_mem_size = CONFIG_TI_SECURE_EMIF_TOTAL_REGION_SIZE;
fdt64_t temp[2];
u32 sec_mem_start = CONFIG_TI_SECURE_EMIF_REGION_START;
u32 sec_mem_size = CONFIG_TI_SECURE_EMIF_TOTAL_REGION_SIZE;
fdt64_t temp[2];
/* If start address is zero, place at end of DRAM */
if (0 == sec_mem_start)
/* If start address is zero, place at end of DRAM */
if (0 == sec_mem_start)
debug("Node %s not found\n", path);
path = "/";
subpath = "reserved-memory";
debug("Node %s not found\n", path);
path = "/";
subpath = "reserved-memory";
- fdt_path_offset(fdt, path);
+ offs = fdt_path_offset(fdt, path);
offs = fdt_add_subnode(fdt, offs, subpath);
if (offs < 0) {
printf("Could not create %s%s node.\n", path, subpath);
offs = fdt_add_subnode(fdt, offs, subpath);
if (offs < 0) {
printf("Could not create %s%s node.\n", path, subpath);
}
path = "/reserved-memory";
offs = fdt_path_offset(fdt, path);
}
path = "/reserved-memory";
offs = fdt_path_offset(fdt, path);
+ two = cpu_to_fdt32(2);
+ fdt_setprop(fdt, offs, "#address-cells", &two, sizeof(two));
+ fdt_setprop(fdt, offs, "#size-cells", &two, sizeof(two));
+ fdt_setprop(fdt, offs, "ranges", NULL, 0);
}
subpath = "secure_reserved";
}
subpath = "secure_reserved";