}
static int smh_load_file(const char * const name, ulong load_addr,
- ulong *end_addr)
+ ulong *size)
{
long fd;
long len;
smh_close(fd);
if (ret == len) {
- *end_addr = load_addr + len - 1;
+ *size = len;
printf("loaded file %s from %08lX to %08lX, %08lX bytes\n",
name,
load_addr,
- *end_addr,
+ load_addr + len - 1,
len);
} else if (ret >= 0) {
ret = -EAGAIN;
{
if (argc == 3 || argc == 4) {
ulong load_addr;
- ulong end_addr = 0;
+ ulong size = 0;
int ret;
- char end_str[64];
+ char size_str[64];
load_addr = hextoul(argv[2], NULL);
if (!load_addr)
return -1;
- ret = smh_load_file(argv[1], load_addr, &end_addr);
+ ret = smh_load_file(argv[1], load_addr, &size);
if (ret < 0)
return CMD_RET_FAILURE;
/* Optionally save returned end to the environment */
if (argc == 4) {
- sprintf(end_str, "0x%08lx", end_addr);
- env_set(argv[3], end_str);
+ sprintf(size_str, "0x%08lx", size);
+ env_set(argv[3], size_str);
}
} else {
return CMD_RET_USAGE;
if (argc == 4) {
initrd_start = hextoul(argv[2], NULL);
- initrd_end = hextoul(argv[3], NULL);
+ initrd_end = initrd_start + hextoul(argv[3], NULL) - 1;
}
fdt_chosen(working_fdt);
"fdt rsvmem print - Show current mem reserves\n"
"fdt rsvmem add <addr> <size> - Add a mem reserve\n"
"fdt rsvmem delete <index> - Delete a mem reserves\n"
- "fdt chosen [<start> <end>] - Add/update the /chosen branch in the tree\n"
- " <start>/<end> - initrd start/end addr\n"
+ "fdt chosen [<start> <size>] - Add/update the /chosen branch in the tree\n"
+ " <start>/<size> - initrd start addr/size\n"
#if defined(CONFIG_FIT_SIGNATURE)
"fdt checksign [<addr>] - check FIT signature\n"
" <start> - addr of key blob\n"