summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill McVicker <willmcvicker@google.com>2024-04-15 10:55:08 -0700
committerWill McVicker <willmcvicker@google.com>2024-04-15 11:46:55 -0700
commitab950dcfbd3aa3b855aab16d4a7d547640ba797b (patch)
tree33b3ffaed264e3e976dd0e6d1f886593f02b1621
parentcf015ee6bbb9fb7d255206e835b95ae36e074ec6 (diff)
parent9b4bb088cf8f02bcebece637f0a1a6c33f3db29d (diff)
downloadreset-android14-gs-pixel-6.1.tar.gz
Merge aosp/android-gs-raviole-5.10-android14-qpr2 into aosp/android14-gs-pixel-6.1android14-gs-pixel-6.1
* aosp/android-gs-raviole-5.10-android14-qpr2: power: reset: gs101: use PMU_INFORM2 for dump_gpr_mode power: reset: align all thermal shutdown scenario power: reset: align all thermal shutdown scenario power: reset: align all thermal shutdown scenario power: reset: determine reset type by reboot_mode power: reset: determine reset type by reboot_mode power: reset: power key detection only when power off power: reset: force warm_reset for thermal shutdown Change-Id: I2667e2c3e58a106cbc4d55c04b1b8eb46aafd172 Signed-off-by: Will McVicker <willmcvicker@google.com>
-rw-r--r--exynos-gs101-reboot.c23
-rw-r--r--exynos-gs201-reboot.c4
2 files changed, 19 insertions, 8 deletions
diff --git a/exynos-gs101-reboot.c b/exynos-gs101-reboot.c
index 70d5c70..834b4e8 100644
--- a/exynos-gs101-reboot.c
+++ b/exynos-gs101-reboot.c
@@ -25,18 +25,20 @@
#include <soc/google/acpm_ipc_ctrl.h>
#endif
#include <soc/google/exynos-el3_mon.h>
-#include <soc/google/debug-snapshot.h>
#include "../../bms/google_bms.h"
#define EXYNOS_PMU_SYSIP_DAT0 (0x0810)
#define BMS_RSBM_VALID BIT(31)
+#define DUMP_GPR_MODE (0xDAB)
+
static struct regmap *pmureg;
static u32 warm_reboot_offset, warm_reboot_trigger;
static u32 cold_reboot_offset, cold_reboot_trigger;
static u32 reboot_cmd_offset;
static u32 shutdown_offset, shutdown_trigger;
+static u32 dump_gpr_offset;
static phys_addr_t pmu_alive_base;
static bool rsbm_supported;
static bool force_warm_reboot_on_thermal_shutdown;
@@ -143,8 +145,8 @@ static void exynos_reboot_parse(const char *cmd)
value = REBOOT_MODE_DMVERITY_CORRUPTED;
} else if (!strcmp(cmd, "rescue")) {
value = REBOOT_MODE_RESCUE;
- } else if (!strcmp(cmd, "shutdown-thermal") ||
- !strcmp(cmd, "shutdown,thermal")) {
+ } else if (!strncmp(cmd, "shutdown-thermal", strlen("shutdown-thermal")) ||
+ !strncmp(cmd, "shutdown,thermal", strlen("shutdown,thermal"))) {
if (force_warm_reboot_on_thermal_shutdown)
force_warm_reboot = true;
value = REBOOT_MODE_SHUTDOWN_THERMAL;
@@ -200,9 +202,13 @@ static int exynos_restart_handler(struct notifier_block *this, unsigned long mod
/* Do S/W Reset */
pr_emerg("%s: Exynos SoC reset right now\n", __func__);
- if (s2mpg10_get_rev_id() == S2MPG10_EVT0 ||
- !rsbm_supported || !dbg_snapshot_get_reboot_status() ||
- dbg_snapshot_get_panic_status() || dbg_snapshot_get_warm_status()) {
+ if (reboot_mode == REBOOT_WARM || reboot_mode == REBOOT_SOFT)
+ set_priv_reg(pmu_alive_base + dump_gpr_offset, DUMP_GPR_MODE);
+ else
+ set_priv_reg(pmu_alive_base + dump_gpr_offset, 0x0);
+
+ if (s2mpg10_get_rev_id() == S2MPG10_EVT0 || !rsbm_supported ||
+ reboot_mode == REBOOT_WARM || reboot_mode == REBOOT_SOFT) {
set_priv_reg(pmu_alive_base + warm_reboot_offset, warm_reboot_trigger);
} else {
pr_emerg("Set PS_HOLD Low.\n");
@@ -276,6 +282,11 @@ static int exynos_reboot_probe(struct platform_device *pdev)
reboot_cmd_offset = EXYNOS_PMU_SYSIP_DAT0;
}
+ if (of_property_read_u32(np, "dump-gpr-offset", &dump_gpr_offset) < 0) {
+ dev_err(dev, "failed to find dump-gpr-offset property\n");
+ return -EINVAL;
+ }
+
force_warm_reboot_on_thermal_shutdown = of_property_read_bool(np,
"force-warm-reboot-on-thermal-shutdown");
diff --git a/exynos-gs201-reboot.c b/exynos-gs201-reboot.c
index bb658d0..224aa2d 100644
--- a/exynos-gs201-reboot.c
+++ b/exynos-gs201-reboot.c
@@ -83,8 +83,8 @@ static void exynos_reboot_parse(const char *cmd)
value = REBOOT_MODE_DMVERITY_CORRUPTED;
} else if (!strcmp(cmd, "rescue")) {
value = REBOOT_MODE_RESCUE;
- } else if (!strcmp(cmd, "shutdown-thermal") ||
- !strcmp(cmd, "shutdown,thermal")) {
+ } else if (!strncmp(cmd, "shutdown-thermal", strlen("shutdown-thermal")) ||
+ !strncmp(cmd, "shutdown,thermal", strlen("shutdown,thermal"))) {
if (force_warm_reboot_on_thermal_shutdown)
force_warm_reboot = true;
value = REBOOT_MODE_SHUTDOWN_THERMAL;