diff options
author | Zhen Kong <zkong@codeaurora.org> | 2017-06-26 11:40:58 -0700 |
---|---|---|
committer | Zhen Kong <zkong@codeaurora.org> | 2017-06-28 10:54:49 -0700 |
commit | 61823254729fc0a255bf49a2e15d938d78c76a6d (patch) | |
tree | 42da6c47f12ffe2d2368d575232300e61e09e0d2 /drivers | |
parent | 840d1a232cfd67867a61a31ccc5d81c5c2192474 (diff) |
firmware: qcom: tz_log: update interrupt info offset
As interrupt info table is changed after TZ 4.0, update
its offset according to TZ version when tz_log driver
reads it.
Change-Id: I28750a12b79a3920904c00fd52a2f4c7ffef7000
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/firmware/qcom/tz_log.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/firmware/qcom/tz_log.c b/drivers/firmware/qcom/tz_log.c index fa90330db93b..c893681f3bf3 100644 --- a/drivers/firmware/qcom/tz_log.c +++ b/drivers/firmware/qcom/tz_log.c @@ -477,10 +477,10 @@ static int _disp_tz_reset_stats(void) static int _disp_tz_interrupt_stats(void) { - int i, j, int_info_size; + int i, j; int len = 0; int *num_int; - unsigned char *ptr; + void *ptr; struct tzdbg_int_t *tzdbg_ptr; struct tzdbg_int_t_tz40 *tzdbg_ptr_tz40; @@ -488,14 +488,12 @@ static int _disp_tz_interrupt_stats(void) (tzdbg.diag_buf->int_info_off - sizeof(uint32_t))); ptr = ((unsigned char *)tzdbg.diag_buf + tzdbg.diag_buf->int_info_off); - int_info_size = ((tzdbg.diag_buf->ring_off - - tzdbg.diag_buf->int_info_off)/(*num_int)); pr_info("qsee_version = 0x%x\n", tzdbg.tz_version); if (tzdbg.tz_version < QSEE_VERSION_TZ_4_X) { + tzdbg_ptr = ptr; for (i = 0; i < (*num_int); i++) { - tzdbg_ptr = (struct tzdbg_int_t *)ptr; len += snprintf(tzdbg.disp_buf + len, (debug_rw_buf_size - 1) - len, " Interrupt Number : 0x%x\n" @@ -519,11 +517,11 @@ static int _disp_tz_interrupt_stats(void) __func__); break; } - ptr += int_info_size; + tzdbg_ptr++; } } else { + tzdbg_ptr_tz40 = ptr; for (i = 0; i < (*num_int); i++) { - tzdbg_ptr_tz40 = (struct tzdbg_int_t_tz40 *)ptr; len += snprintf(tzdbg.disp_buf + len, (debug_rw_buf_size - 1) - len, " Interrupt Number : 0x%x\n" @@ -547,7 +545,7 @@ static int _disp_tz_interrupt_stats(void) __func__); break; } - ptr += int_info_size; + tzdbg_ptr_tz40++; } } |