diff options
author | Peter Csaszar <pcsaszar@google.com> | 2022-12-09 00:38:44 -0800 |
---|---|---|
committer | TreeHugger Robot <treehugger-gerrit@google.com> | 2022-12-14 22:21:24 +0000 |
commit | f21c38564e63c489f3bfdf3dccfa0961f8b9ba4d (patch) | |
tree | 3212005b55e9bf93e37cb043b9a28405946b3d7d | |
parent | 967cfcd19ccc44541282c6bc883bb971723cb43d (diff) | |
download | gs-f21c38564e63c489f3bfdf3dccfa0961f8b9ba4d.tar.gz |
soc/google: Proper APC early WD handling
As part of the effort of communicating sufficient reboot reason with
Debug Core upon a crash without relying on the DSS region, the APC
Early Watchdog condition is also indicated in a PMU INFORM register
bit, which is set by ABL, but needs to be cleared by kernel, once
execution has reached the end of the early booting phase. (This is
required to handle cache flush properly in all reboot scenarios.)
Bug: 228502817
Change-Id: I89d7e6abecc13a60987e9c66dbc281b9347fbce3
Signed-off-by: Peter Csaszar <pcsaszar@google.com>
-rw-r--r-- | drivers/soc/google/debug/debug-snapshot-local.h | 5 | ||||
-rw-r--r-- | drivers/soc/google/debug/debug-snapshot-utils.c | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/soc/google/debug/debug-snapshot-local.h b/drivers/soc/google/debug/debug-snapshot-local.h index 3e01db610258..df6a4803dc0a 100644 --- a/drivers/soc/google/debug/debug-snapshot-local.h +++ b/drivers/soc/google/debug/debug-snapshot-local.h @@ -165,4 +165,9 @@ extern struct itmon_logs *dss_itmon; #define ARM_CPU_PART_CORTEX_A78 0xD41 #define ARM_CPU_PART_CORTEX_X1 0xD44 + +/* PMU register access */ +#define PMU_GSA_INFORM0_OFFS 0x0830 +#define PMU_GSA_INFORM0_APC_EARLY_WD (1 << 5) + #endif diff --git a/drivers/soc/google/debug/debug-snapshot-utils.c b/drivers/soc/google/debug/debug-snapshot-utils.c index 2a13bd5fe37a..810e536209f5 100644 --- a/drivers/soc/google/debug/debug-snapshot-utils.c +++ b/drivers/soc/google/debug/debug-snapshot-utils.c @@ -755,6 +755,9 @@ void dbg_snapshot_init_utils(void) /* write default reboot reason as unknown reboot */ dbg_snapshot_report_reason(DSS_SIGN_UNKNOWN_REBOOT); + /* Cancel the "Early Reboot" inform bit set by ABL */ + exynos_pmu_update(PMU_GSA_INFORM0_OFFS, PMU_GSA_INFORM0_APC_EARLY_WD, 0); + /* write reset value to skip abl dump as debug boot */ dbg_snapshot_set_abl_dump_stat(DSS_SIGN_RESET); |