#define RESET_SEQUENCER_CONFIGURATION (0x0500)
#define PS_HOLD_CONTROL (0x330C)
#define EXYNOS_PMU_SYSIP_DAT0 (0x0810)
-
+#define LAST_POWERUP_REASON_REG (0x0854) /*EXYNOS9610_POWER_INFORM9*/
/* defines for BIG reset */
#define PEND_BIG (1 << 0)
#define PEND_LITTLE (1 << 1)
/* Reboot into recovery */
#define REBOOT_MODE_FACTORY 0xFD
+#define RESET_EXTRA_RESET_KUNPOW_REASON BIT(9)
+#define RESET_EXTRA_POST_PANIC_REASON (BIT(4) | BIT(5))
+#define RESET_EXTRA_POST_PMICWDT_REASON BIT(5)
+#define RESET_EXTRA_POST_WDT_REASON BIT(4)
+#define RESET_EXTRA_POST_REBOOT_MASK (BIT(4) | BIT(5) | BIT(6))
+#define RESET_EXTRA_PANIC_REASON BIT(3)
+#define RESET_EXTRA_REBOOT_BL_REASON BIT(2)
+#define RESET_EXTRA_HW_RESET_REASON BIT(1)
+
#if !defined(CONFIG_SEC_REBOOT)
#ifdef CONFIG_OF
static void exynos_power_off(void)
{
u32 soc_id, revision;
void __iomem *addr;
-
+ void __iomem *addr_extra;
if (!exynos_pmu_base)
return;
#ifdef CONFIG_EXYNOS_ACPM
printk("[%s] reboot cmd: %s\n", __func__, cmd);
addr = exynos_pmu_base + EXYNOS_PMU_SYSIP_DAT0;
+ addr_extra = exynos_pmu_base + LAST_POWERUP_REASON_REG;
+ /*Clear the last power up reason first*/
+ __raw_writel(0, addr_extra);
if (cmd) {
if (!strcmp((char *)cmd, "charge")) {
__raw_writel(REBOOT_MODE_CHARGE, addr);
__raw_writel(REBOOT_MODE_RECOVERY, addr);
} else if (!strcmp(cmd, "sfactory")) {
__raw_writel(REBOOT_MODE_FACTORY, addr);
+ } else if (!strncmp(cmd, "post-wdt",8)) {
+ __raw_writel(RESET_EXTRA_POST_WDT_REASON, addr_extra);
+ } else if (!strncmp(cmd, "post-pmicwdt",12)) {
+ __raw_writel(RESET_EXTRA_POST_PMICWDT_REASON, addr_extra);
+ } else if (!strncmp(cmd, "post-panic",10)) {
+ __raw_writel(RESET_EXTRA_POST_PANIC_REASON, addr_extra);
}
}