arm: qca: Add support to set CRASHDUMP RESET bit

The CRASHDUMP RESET bit of TCSR_BOOT_MISC_DETECT Register
has to be set in the crashdump collection path before reset
from u-boot for the  TZ to differentiate between the
normal reset and crashdump reset from u-boot and
to retain the crash reason.

Change-Id: Ic74cec02bf749925e599ee12205257480a234064
Signed-off-by: Priyanka MA <quic_priyma@quicnic.com>
This commit is contained in:
Priyanka MA 2023-01-23 16:26:40 +05:30 committed by Gerrit - the friendly Code Review server
parent 448f8eeb38
commit 95375f5fe9
6 changed files with 18 additions and 0 deletions

View file

@ -657,6 +657,11 @@ void reset_crashdump(void)
qca_scm_sdi();
cookie = ipq_read_tcsr_boot_misc();
/* Set CRASHDUMP_RESET in crashdump path,
* for TZ to differentiate it from normal reset */
if (cookie & DLOAD_ENABLE) {
cookie |= CRASHDUMP_RESET;
}
cookie &= DLOAD_DISABLE;
ret = qca_scm_dload(cookie);
if (ret)

View file

@ -845,6 +845,11 @@ void reset_crashdump(void)
cookie = ipq_read_tcsr_boot_misc();
qca_scm_sdi();
/* Set CRASHDUMP_RESET in crashdump path,
* for TZ to differentiate it from normal reset */
if (cookie & DLOAD_ENABLE) {
cookie |= CRASHDUMP_RESET;
}
cookie &= DLOAD_DISABLE;
ret = qca_scm_dload(cookie);
if (ret)

View file

@ -151,6 +151,11 @@ void reset_crashdump(void)
cookie = ipq_read_tcsr_boot_misc();
qca_scm_sdi();
/* Set CRASHDUMP_RESET in crashdump path,
* for TZ to differentiate it from normal reset */
if (cookie & DLOAD_ENABLE) {
cookie |= CRASHDUMP_RESET;
}
cookie &= DLOAD_DISABLE;
ret = qca_scm_dload(cookie);
if (ret)

View file

@ -363,6 +363,7 @@ extern loff_t board_env_size;
#ifdef CONFIG_OF_BOARD_SETUP
#define DLOAD_DISABLE (~BIT(4))
#define DLOAD_ENABLE BIT(4)
#define CRASHDUMP_RESET BIT(11)
#define CLEAR_MAGIC 0x0
#define SCM_CMD_TZ_CONFIG_HW_FOR_RAM_DUMP_ID 0x9

View file

@ -385,6 +385,7 @@ extern loff_t board_env_size;
#ifdef CONFIG_OF_BOARD_SETUP
#define DLOAD_DISABLE (~BIT(4))
#define DLOAD_ENABLE BIT(4)
#define CRASHDUMP_RESET BIT(11)
#define SET_MAGIC 0x1
#define CLEAR_MAGIC 0x0
#define SCM_CMD_TZ_CONFIG_HW_FOR_RAM_DUMP_ID 0x9

View file

@ -294,6 +294,7 @@ extern loff_t board_env_size;
#ifdef CONFIG_OF_BOARD_SETUP
#define DLOAD_DISABLE (~BIT(4))
#define DLOAD_ENABLE BIT(4)
#define CRASHDUMP_RESET BIT(11)
/*
* Below Configs need to be updated after enabling reset_crashdump