mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-02-08 13:00:57 +01:00
QCA: Crashdump data to flash
If the dump_to_flash environment variable is set with the proper offset in u-boot, crashdump data will be stored to flash memory. Otherwise it will be stored in tftp server. Change-Id: I10ac1016e3dfe6a2fa11a0a67c5774b29c3df67a Signed-off-by: Gokul Sriram Palanisamy <gokulsri@codeaurora.org>
This commit is contained in:
parent
68e5a86eb8
commit
ebfe553da8
3 changed files with 8 additions and 10 deletions
|
|
@ -51,6 +51,7 @@ void board_mmc_deinit(void);
|
|||
|
||||
void set_flash_secondary_type(qca_smem_flash_info_t *);
|
||||
void dump_func(void);
|
||||
int do_dumpqca_flash_data(const char *);
|
||||
int apps_iscrashed(void);
|
||||
|
||||
struct dumpinfo_t{
|
||||
|
|
|
|||
|
|
@ -1343,8 +1343,7 @@ static int qca_wdt_write_crashdump_data(
|
|||
* the type of boot flash memory and writes all these crashdump information
|
||||
* in provided offset in flash memory.
|
||||
*/
|
||||
static int do_dumpqca_flash_data(cmd_tbl_t *cmdtp, int flag,
|
||||
int argc, char *const argv[])
|
||||
int do_dumpqca_flash_data(const char *offset)
|
||||
{
|
||||
unsigned char *kernel_crashdump_address =
|
||||
(unsigned char *) CONFIG_QCA_KERNEL_CRASHDUMP_ADDRESS;
|
||||
|
|
@ -1353,8 +1352,6 @@ static int do_dumpqca_flash_data(cmd_tbl_t *cmdtp, int flag,
|
|||
int ret_val;
|
||||
loff_t crashdump_offset;
|
||||
|
||||
if (argc != 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (sfi->flash_type == SMEM_BOOT_NAND_FLASH) {
|
||||
flash_type = SMEM_BOOT_NAND_FLASH;
|
||||
|
|
@ -1369,7 +1366,7 @@ static int do_dumpqca_flash_data(cmd_tbl_t *cmdtp, int flag,
|
|||
return CMD_RET_FAILURE;
|
||||
}
|
||||
|
||||
ret_val = str2off(argv[1], &crashdump_offset);
|
||||
ret_val = str2off(offset, &crashdump_offset);
|
||||
|
||||
if (!ret_val)
|
||||
return CMD_RET_USAGE;
|
||||
|
|
@ -1394,8 +1391,4 @@ static int do_dumpqca_flash_data(cmd_tbl_t *cmdtp, int flag,
|
|||
|
||||
return CMD_RET_SUCCESS;
|
||||
}
|
||||
|
||||
U_BOOT_CMD(dumpipq_flash_data, 2, 0, do_dumpqca_flash_data,
|
||||
"dumpipq_flash_data crashdump collection and storing in flash",
|
||||
"dumpipq_flash_data [offset in flash]\n");
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -370,7 +370,11 @@ void autoboot_command(const char *s)
|
|||
*/
|
||||
if (apps_iscrashed()) {
|
||||
printf("Crashdump magic found, initializing dump activity..\n");
|
||||
dump_func();
|
||||
s = getenv("dump_to_flash");
|
||||
if (s)
|
||||
do_dumpqca_flash_data(s); /* write core dump data to flash */
|
||||
else
|
||||
dump_func();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue