Files
OpenCellular/include/software_panic.h
Alec Berg 02d0ce1526 samus: panic reboot EC if PD MCU crashes
Use the EC to check if PD MCU has crashed. The EC knows this
by checking the PD status bits: if PD MCU was in RW, and is
now in RO, AND it did not get to RO via a sysjump, then it
must have crashed. When the EC detects this, the EC will also
panic and reboot the entire system, so that we can software
sync to a known good state.

Also, when EC panics due to PD crash, it will log panic info.

BUG=chrome-os-partner:36636
BRANCH=samus
TEST=load onto samus EC and PD, try sysjump'ing back and forth
on PD MCU console and verify EC does not do anything. Crash
the PD MCU when in RW by reboot command and crash divzero command,
and make sure the EC panics with PD crash panic message. Crash
the PD MCU when in RO (before sysjumping to RW) and make sure
EC does not panic.

Change-Id: I57961028e6b23a878b8e477a9d8e180cb121a742
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/250100
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-02-18 04:53:59 +00:00

25 lines
790 B
C

/* Copyright (c) 2015 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Software panic constants. This file must be parsable by the assembler.
*/
#ifndef __CROS_EC_SOFTWARE_PANIC_H
#define __CROS_EC_SOFTWARE_PANIC_H
/* Holds software panic reason PANIC_SW_* */
#define SOFTWARE_PANIC_REASON_REG r4
#define SOFTWARE_PANIC_INFO_REG r5
#define PANIC_SW_BASE 0xDEAD6660
/* Software panic reasons */
#define PANIC_SW_DIV_ZERO (PANIC_SW_BASE + 0)
#define PANIC_SW_STACK_OVERFLOW (PANIC_SW_BASE + 1)
#define PANIC_SW_PD_CRASH (PANIC_SW_BASE + 2)
#define PANIC_SW_ASSERT (PANIC_SW_BASE + 3)
#define PANIC_SW_WATCHDOG (PANIC_SW_BASE + 4)
#endif /* __CROS_EC_SOFTWARE_PANIC_H */