Professional Documents
Culture Documents
Overview
80-NU268-1 A
PAGE 2 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Revision History
PAGE 3 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Contents
PAGE 4 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Objectives
PAGE 5 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Problem Statements
PAGE 6 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Secure Watchdog Reset Debug
PAGE 7 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Secure Watchdog Reset (System Crash) Debug
PAGE 8 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Secure Watchdog Reset Debug (Interaction Chart)
TZ AO
RPM APPS CPU DDR controller QDSS
PMIC RST_CTL (APPS CPU)
Secure WDT
bite
1
Start a timer (SW sets up a 8ms timer, max is 512ms), to allow ETR to flush Trigger Stage − Connects
2a
Set CTI trigger to flush ETR the watchdog expired
Timer expires
signal to start the process
2b Start a timer (SW sets up a 8ms timer, max is 128ms), to allow ETB to flush
Set CTI trigger to flush ETB (rc_pre_ares is asserted when timer is started) – stop capturing (ETB shall be configured to be “stop on flush”)
Start a timer, set to the right amount to allow DDR to enter self refresh
Capture ETB registers
Set HW_DDR_REFRESH_REQ(rc_pre_ares)
3
Timer expires
Preparation stage/
4 Assert WD_PSHOLD_ARES
Information Retention stage
Flushes data out of
internal queues, in
particular, the system
trace data
Keeps DDR memory in
Refresh mode
PAGE 9 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Secure Watchdog Reset Debug (Interaction Chart) (cont.)
Set func_ares
Runs software to flush
Krait rail
is kept 7
Clear func_ares
caches and reads
RP
M
is o
FLCB
FLCB checks WD_reset[0] and
WD_debug_en bit in the beginning,
critical data into
ut ROM
FUSE_SENSE is
NOT performed
of
res
et APPS
If both set, bypass USB emuration and
bring Krait out of reset memory
Boot ROM
8
9
M
I ME lerWD_reset [0] set
to d
s Rs han and WD_debug
Ye py GP WD
C o t o enabled?
p
Jum
IMEM
10
Initialized DDR to run at XO frequency
lock L1 + lock L2
Information Download
Flush L1 of Core 0 and L2 in DDR, Copy ETB to DDR if needed
Normal boot
Stage
N
Flush ETB/ETR/TPIU
Re-init Core 0 to a know state. Flushes data out of
Same op for other APPS cores
internal queues, in
Set a flag to dump data to USB/SDCC
particular, the system
Clear WD_reset[0] Put DDR in self-refresh
Clear PS_HOLD trace data
TZ clears CP region using Keeps DDR memory
saved AMT table in DDR
(not entire DDR) in Refresh mode
11
SBL check the flag, then
dump data to USB or SDCC
Clear WD_reset[1]
12
SW up and running
(secure WDT enabled)
13
PAGE 10 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Abnormal Reset Debug
PAGE 11 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Abnormal Reset Debug
PAGE 12 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Abnormal Reset Debug (cont.)
TZ
PMIC RST_CTL RPM (APPS CPU) APPS CPU AO DDR controller QDSS
Start a timer (SW sets up a 8ms timer, max is 512ms), to allow ETR to flush
2a
Set CTI trigger to flush ETR
Timer expires
2b Start a timer (SW sets up a 8ms timer, max is 128ms), to allow ETB to flush
Set CTI trigger to flush ETB (rc_pre_ares is asserted when timer is started) – stop capturing (ETB shall be configured to be “stop on flush”)
Trigger stage − Connects
the other hardware reset
Timer matches backoff time from expiration signals such as MSM
2c
Back off time is programmable from 0 to 7 sleep clock cycles (218us) temperature sensor,
TMC Register Shadow/Capture Enable pulse
PMIC reset signal, to
Start a timer, set to the right amount to allow DDR to enter self refresh
start the same watchdog
Set HW_DDR_REFRESH_REQ(rc_pre_ares)
reset debug process
3
Timer expires
4 Assert WD_PSHOLD_ARES
ps_hold FLCB checks WD_reset[0] and
de-asserts WD_debug_en bit in the beginning,
5
resin_n If both set, bypass USB emuration and
6 bring Krait out of reset
Set func_ares
Krait rail
is kept 7
Clear func_ares
PAGE 13 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
RAM Dump Debugging
PAGE 14 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Watchdog Flow
Watchdog
Expired
IRQ
PAGE 15 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
RAM Dump
PAGE 16 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
RAM Dump Collection
PAGE 17 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Watchdog Debug
Linux RAM dump parser is available to parse logs for various WDOG and
abnormal resets, see [R1]
Kernel panic – Unhandled page fault, BUG_ON, SLUB POISONs
Apps WDOG bark
Apps WDOG bite
TZ Fatal FIQ – Bus Timeout, NOC Error, xPU Error, etc.
Secure WDOG bite
PAGE 18 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Apps Watchdog Bark
PAGE 19 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Apps Watchdog Bite
PAGE 20 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Nonsecure WDOG Bite and Fatal FIQ − TZ Diag Buffer
The following shows RAM dump collected after a controlled reset (TZ fatal
or WDOG trigger); the TZ diagnostic buffer provides more information on
reset.
The TZ diag buffer struct pointer is saved at 0x720 offset on OCIMEM.BIN and
can be loaded with tz.elf. v.v (struct tzbsp_diag_s *)(0x8600000+0x720).
PAGE 21 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
TZ Fatal FIQ − NOC Error
PAGE 22 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Debugging SDI/SYSDBG Logs
Only those sysdbg cookies shown above are updated, and they will not be
updated if sysdbg did not run for any reason, such as kernel panic or secure
fuse blown device.
In these cases, the SBL collects PMIC reset regions on PMIC_PON.BIN,
RST_STAT.BIN.
PAGE 23 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Interpretation of GCC_RESET_STATUS
GCC_RESET_STATUS
PAGE 24 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Interpretation of GCC_RESET_STATUS (cont.)
If GCC_RESET_STATUS = 0 x 0:
GCC_RESE
Check PMIC Warm Reset 1 and 2 -> If 0, go to (b). T == 0 ?
If not, there was a PMIC warm reset. There can be multiple
triggers for a warm reset at the same time, and all triggers Yes
are captured in these registers, i.e., you can have more
than one bit set. PMIC
Warm
If Warm Reset reasons 1 and 2 are 0, then Reset 1&2
=0?
PON_REASON and POFF_REASON1/
POFF_REASON2 register.
Yes
These will be updated every time the PMIC powers on and
off.
PON_
The snapshot shows RESET reason as secure REASON ?
WDOG bite, if TZ does not receive nonsecure
WDOG bite.
POFF
Reason
1&2?
Reset
reason
PAGE 25 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
PON/POFF Reset Reason
PAGE 26 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
References
Ref. Document
Qualcomm Technologies
Q1 Application Note: Software Glossary for Customers CL93-V3077-1
Resources
R1 Code Aurora Forum https://www.codeaurora.org/cgit/quic/la/platform/vendor/qcom-
opensource/tools/tree/linux-ramdump-parser-v2
PAGE 27 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Questions?
https://support.cdmatech.com
PAGE 28 80-NU268-1 A Nov 2014 Confidential and Proprietary – Qualcomm Technologies, Inc. | MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION