summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-02-22 11:02:06 -0700
committerJett Rink <jettrink@chromium.org>2019-02-26 14:32:45 +0000
commit916b0771e4bdaafb710b5c964c2ceba4128a1c51 (patch)
tree0958c60fa2ae3be69f840e4fbab33e687f2cb037
parent456d85195c3ceede52d4c219dfccc51f67b78544 (diff)
downloadchrome-ec-916b0771e4bdaafb710b5c964c2ceba4128a1c51.tar.gz
ish: add reboot support
Make the `reboot` EC commands (console and host) operational BRANCH=none BUG=none TEST=`reboot` on ISH console will power cycle ISH Change-Id: I2dfb4437bf110493cea91087c65b62df5d08be05 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/1483278 Reviewed-by: Li1 Feng <li1.feng@intel.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
-rw-r--r--chip/ish/reset_prep_wr.c18
-rw-r--r--chip/ish/system.c6
2 files changed, 15 insertions, 9 deletions
diff --git a/chip/ish/reset_prep_wr.c b/chip/ish/reset_prep_wr.c
index 6d8702bee9..c6524b9f49 100644
--- a/chip/ish/reset_prep_wr.c
+++ b/chip/ish/reset_prep_wr.c
@@ -6,10 +6,11 @@
/* Power managerment module for ISH */
#include "common.h"
#include "console.h"
-#include "registers.h"
+#include "hooks.h"
#include "interrupts.h"
+#include "registers.h"
+#include "system.h"
#include "task.h"
-#include "hooks.h"
#ifdef PM_DEBUG
#define CPUTS(outstr) cputs(CC_SYSTEM, outstr)
@@ -21,14 +22,13 @@
#define CPRINTF(format, args...)
#endif
+/*
+ * IRQ fires when we receive a RESET_PREP message from AP. This happens at S0
+ * entry.
+ */
static void reset_prep_wr_isr(void)
{
- /*
- * ISH HW looks at the rising edge of this bit to
- * trigger a MIA reset. Now in S0, reset MIA.
- */
- ISH_RST_REG = 0;
- ISH_RST_REG = 1;
+ system_reset(SYSTEM_RESET_HARD);
}
DECLARE_IRQ(ISH_RESET_PREP_IRQ, reset_prep_wr_isr);
@@ -37,7 +37,7 @@ void reset_prep_init(void)
/* Clear reset bit */
ISH_RST_REG = 0;
- /* clear reset history register in CCU */
+ /* Clear reset history register from previous boot. */
CCU_RST_HST = CCU_RST_HST;
/* Unmask reset prep avail interrupt mask */
PMU_RST_PREP = 0;
diff --git a/chip/ish/system.c b/chip/ish/system.c
index f532e8bf85..6c8550b0b4 100644
--- a/chip/ish/system.c
+++ b/chip/ish/system.c
@@ -46,6 +46,12 @@ uint32_t chip_read_reset_flags(void)
void _system_reset(int flags, int wake_from_hibernate)
{
+ /*
+ * ISH HW looks at the rising edge of this bit to
+ * trigger a MIA reset.
+ */
+ ISH_RST_REG = 0;
+ ISH_RST_REG = 1;
}
void system_reset(int flags)