QCA: Enable board reset after crashdump to flash

Added board reset command after crashdump to flash. Also,
updated with valid return values in do_dumpqca_flash_data function.

Change-Id: Ib89ee06cd6e34c0a56090284983534f107c97ea7
Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
This commit is contained in:
Gokul Sriram Palanisamy 2018-01-31 19:13:06 +05:30 committed by Gerrit - the friendly Code Review server
parent b5939020fe
commit 3ad3c2e50c
2 changed files with 7 additions and 5 deletions

View file

@ -1363,13 +1363,13 @@ int do_dumpqca_flash_data(const char *offset)
#endif
} else {
printf("command not supported for this flash memory\n");
return CMD_RET_FAILURE;
return -EINVAL;
}
ret_val = str2off(offset, &crashdump_offset);
if (!ret_val)
return CMD_RET_USAGE;
return -EINVAL;
g_crashdump_data.cpu_context = kernel_crashdump_address;
tlv_msg.msg_buffer = kernel_crashdump_address + CONFIG_CPU_CONTEXT_DUMP_SIZE;
@ -1384,11 +1384,11 @@ int do_dumpqca_flash_data(const char *offset)
if (ret_val) {
printf("crashdump data writing in flash failure\n");
return CMD_RET_FAILURE;
return -EPERM;
}
printf("crashdump data writing in flash successful\n");
return CMD_RET_SUCCESS;
return 0;
}
#endif

View file

@ -371,8 +371,10 @@ void autoboot_command(const char *s)
if (apps_iscrashed()) {
printf("Crashdump magic found, initializing dump activity..\n");
s = getenv("dump_to_flash");
if (s)
if (s) {
do_dumpqca_flash_data(s); /* write core dump data to flash */
run_command("reset", 0);
}
else
dump_func();
return;