mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2025-12-10 07:44:53 +01:00
ipqsoc: Skip reset in crash dump path.
Skip reset in crash dump path which give access to user to perform secure authentication. in crash path, bootipq cmd only authenticate kernel/rootfs. booting to kernel is restircted. Enable CONFIG_SKIP_RESET to skip reset in crashdump path. Change-Id: I28fdd4dc6475d4d26b20a87aa039cef165db1375 Signed-off-by: Gurumoorthy Santhakumar <quic_gsanthak@quicinc.com>
This commit is contained in:
parent
5c155dbba2
commit
cf2f0c3a97
5 changed files with 32 additions and 7 deletions
|
|
@ -1,2 +1,6 @@
|
||||||
config QCA_COMMON
|
config QCA_COMMON
|
||||||
bool "QCA Common IPs"
|
bool "QCA Common IPs"
|
||||||
|
|
||||||
|
config SKIP_RESET
|
||||||
|
bool "Skip reset after crash dump"
|
||||||
|
default n
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ void set_flash_secondary_type(qca_smem_flash_info_t *);
|
||||||
void dump_func(unsigned int dump_level);
|
void dump_func(unsigned int dump_level);
|
||||||
int do_dumpqca_flash_data(const char *);
|
int do_dumpqca_flash_data(const char *);
|
||||||
int do_dumpqca_usb_data(unsigned int dump_level);
|
int do_dumpqca_usb_data(unsigned int dump_level);
|
||||||
|
void crashdump_exit(void);
|
||||||
int apps_iscrashed(void);
|
int apps_iscrashed(void);
|
||||||
int ipq_read_tcsr_boot_misc(void);
|
int ipq_read_tcsr_boot_misc(void);
|
||||||
int set_uuid_bootargs(char *boot_args, char *part_name, int buflen, bool gpt_flag);
|
int set_uuid_bootargs(char *boot_args, char *part_name, int buflen, bool gpt_flag);
|
||||||
|
|
|
||||||
|
|
@ -757,6 +757,12 @@ static int do_boot_signedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const a
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_SKIP_RESET
|
||||||
|
if (apps_iscrashed())
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This sys call will switch the CE1 channel to ADM usage
|
* This sys call will switch the CE1 channel to ADM usage
|
||||||
* so that HLOS can use it.
|
* so that HLOS can use it.
|
||||||
|
|
@ -940,6 +946,11 @@ static int do_boot_unsignedimg(cmd_tbl_t *cmdtp, int flag, int argc, char *const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_SKIP_RESET
|
||||||
|
if (apps_iscrashed())
|
||||||
|
return 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret < 0 || boot_os(1, arg) != CMD_RET_SUCCESS) {
|
if (ret < 0 || boot_os(1, arg) != CMD_RET_SUCCESS) {
|
||||||
#ifdef CONFIG_USB_XHCI_IPQ
|
#ifdef CONFIG_USB_XHCI_IPQ
|
||||||
ipq_board_usb_init();
|
ipq_board_usb_init();
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,15 @@ __weak int scm_set_boot_addr(bool enable_sec_core)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__weak void crashdump_exit(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_SKIP_RESET
|
||||||
|
run_command("bootipq", 0);
|
||||||
|
#else
|
||||||
|
reset_board();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static int krait_release_secondary(void)
|
static int krait_release_secondary(void)
|
||||||
{
|
{
|
||||||
writel(0xa4, CPU1_APCS_SAW2_VCTL);
|
writel(0xa4, CPU1_APCS_SAW2_VCTL);
|
||||||
|
|
@ -971,7 +980,7 @@ void dump_func(unsigned int dump_level)
|
||||||
printf("Using serverip from env %s\n", serverip);
|
printf("Using serverip from env %s\n", serverip);
|
||||||
} else {
|
} else {
|
||||||
printf("\nServer ip not found, run dhcp or configure\n");
|
printf("\nServer ip not found, run dhcp or configure\n");
|
||||||
goto reset;
|
goto exit;
|
||||||
}
|
}
|
||||||
printf("Trying to ping server.....\n");
|
printf("Trying to ping server.....\n");
|
||||||
snprintf(runcmd, sizeof(runcmd), "ping %s", serverip);
|
snprintf(runcmd, sizeof(runcmd), "ping %s", serverip);
|
||||||
|
|
@ -985,11 +994,11 @@ void dump_func(unsigned int dump_level)
|
||||||
}
|
}
|
||||||
if (ping_status != 1) {
|
if (ping_status != 1) {
|
||||||
printf("Ping failed\n");
|
printf("Ping failed\n");
|
||||||
goto reset;
|
goto exit;
|
||||||
}
|
}
|
||||||
if (do_dumpqca_data(dump_level) == CMD_RET_FAILURE)
|
if (do_dumpqca_data(dump_level) == CMD_RET_FAILURE)
|
||||||
printf("Crashdump saving failed!\n");
|
printf("Crashdump saving failed!\n");
|
||||||
goto reset;
|
goto exit;
|
||||||
} else {
|
} else {
|
||||||
etime = get_timer_masked() + (10 * CONFIG_SYS_HZ);
|
etime = get_timer_masked() + (10 * CONFIG_SYS_HZ);
|
||||||
printf("\nHit any key within 10s to stop dump activity...");
|
printf("\nHit any key within 10s to stop dump activity...");
|
||||||
|
|
@ -1012,8 +1021,8 @@ void dump_func(unsigned int dump_level)
|
||||||
/* reset the system, some images might not be loaded
|
/* reset the system, some images might not be loaded
|
||||||
* when crashmagic is found
|
* when crashmagic is found
|
||||||
*/
|
*/
|
||||||
reset:
|
exit:
|
||||||
reset_board();
|
crashdump_exit();
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_MTD_DEVICE
|
#ifdef CONFIG_MTD_DEVICE
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -386,13 +386,13 @@ void autoboot_command(const char *s)
|
||||||
if (s) {
|
if (s) {
|
||||||
if (strncmp(s, "1", sizeof("1"))) {
|
if (strncmp(s, "1", sizeof("1"))) {
|
||||||
printf("\nError: Invalid variable dump_minimal \n");
|
printf("\nError: Invalid variable dump_minimal \n");
|
||||||
reset_board();
|
crashdump_exit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s) {
|
if (s) {
|
||||||
do_dumpqca_minimal_data(s);
|
do_dumpqca_minimal_data(s);
|
||||||
reset_board();
|
crashdump_exit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dump_func(FULL_DUMP);
|
dump_func(FULL_DUMP);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue