summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDivya Jyothi <divya.jyothi@intel.com>2015-06-25 21:37:13 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-01 03:49:19 +0000
commitae834fa50a44887ea7e26939cd344514a5e16ad9 (patch)
tree1ad94fb04cf6a4d9a3509013530aefd939b719e7
parentedb53663dd476b4f8cf43bdfe510cc8512d9b089 (diff)
downloadchrome-ec-ae834fa50a44887ea7e26939cd344514a5e16ad9.tar.gz
mec1322: correct reset cause state in lfw
Reset cause was recorded / corrected only in RO/RW images. lfw still has old implementation.This caused sysjump RO/RW to not jump appropriately. BRANCH=None BUG=chrome-os-partner:38103 TEST=on Cyan,sysjump RO and sysjump RW console commands nd make sure it jumps to the right image. Change-Id: I37138f552fdd385c98d770d242d896ffc014697c Signed-off-by: Divya Jyothi <divya.jyothi@intel.com> Reviewed-on: https://chromium-review.googlesource.com/282210 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Bernie Thompson <bhthompson@chromium.org> Tested-by: Bernie Thompson <bhthompson@chromium.org>
-rw-r--r--chip/mec1322/lfw/ec_lfw.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/chip/mec1322/lfw/ec_lfw.c b/chip/mec1322/lfw/ec_lfw.c
index 997e41aa0b..cb690fb3e1 100644
--- a/chip/mec1322/lfw/ec_lfw.c
+++ b/chip/mec1322/lfw/ec_lfw.c
@@ -202,16 +202,23 @@ void uart_init(void)
void system_init(void)
{
- uint32_t status = MEC1322_VBAT_STS;
uint32_t wdt_cnt = MEC1322_EC_WDT_CNT;
-
- /* Reset the image type if reset cause is power-on */
- if (status & (1 << 7) || (wdt_cnt == 0))
+ uint32_t rst_sts = MEC1322_PCR_CHIP_PWR_RST &
+ (MEC1322_PWR_RST_STS_VCC1 |
+ MEC1322_PWR_RST_STS_VBAT);
+
+ /*
+ * BIT[6:5] determine VCC1 reset and VBAT reset status.
+ * when Poweron watchdog is reset and both VCC1 and VBAT
+ * are set
+ */
+ if ((rst_sts == (MEC1322_PWR_RST_STS_VCC1 |
+ MEC1322_PWR_RST_STS_VBAT))
+ && (wdt_cnt == 0))
MEC1322_VBAT_RAM(MEC1322_IMAGETYPE_IDX)
= SYSTEM_IMAGE_UNKNOWN;
}
-
enum system_image_copy_t system_get_image_copy(void)
{
return MEC1322_VBAT_RAM(MEC1322_IMAGETYPE_IDX);