diff --git a/board/qca/arm/ipq6018/ipq6018.c b/board/qca/arm/ipq6018/ipq6018.c index f128d9e565..58c5eef27c 100644 --- a/board/qca/arm/ipq6018/ipq6018.c +++ b/board/qca/arm/ipq6018/ipq6018.c @@ -30,6 +30,7 @@ #include #define DLOAD_MAGIC_COOKIE 0x10 +#define DLOAD_DISABLED 0x40 DECLARE_GLOBAL_DATA_PTR; struct sdhci_host mmc_host; extern int ipq6018_edma_init(void *cfg); @@ -775,6 +776,16 @@ __weak int ipq_get_tz_version(char *version_name, int buf_size) return 1; } +int apps_iscrashed_crashdump_disabled(void) +{ + u32 *dmagic = (u32 *)CONFIG_IPQ6018_DMAGIC_ADDR; + + if (*dmagic == DLOAD_DISABLED) + return 1; + + return 0; +} + int apps_iscrashed(void) { u32 *dmagic = (u32 *)CONFIG_IPQ6018_DMAGIC_ADDR; diff --git a/common/autoboot.c b/common/autoboot.c index 37076adbdc..48b06063ab 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -361,6 +361,11 @@ __weak int apps_iscrashed(void) return 0; } +__weak int apps_iscrashed_crashdump_disabled(void) +{ + return 0; +} + void autoboot_command(const char *s) { debug("### main_loop: bootcmd=\"%s\"\n", s ? s : ""); @@ -392,6 +397,11 @@ void autoboot_command(const char *s) } #endif + if (apps_iscrashed_crashdump_disabled()) { + printf("Crashdump disabled, resetting the board..\n"); + reset_board(); + } + if (stored_bootdelay != -1 && s && !abortboot(stored_bootdelay)) { #if defined(CONFIG_AUTOBOOT_KEYED) && !defined(CONFIG_AUTOBOOT_KEYED_CTRLC) int prev = disable_ctrlc(1); /* disable Control C checking */