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>
This commit is contained in:
Divya Jyothi
2015-06-25 21:37:13 -07:00
committed by ChromeOS Commit Bot
parent edb53663dd
commit ae834fa50a

View File

@@ -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;
uint32_t rst_sts = MEC1322_PCR_CHIP_PWR_RST &
(MEC1322_PWR_RST_STS_VCC1 |
MEC1322_PWR_RST_STS_VBAT);
/* Reset the image type if reset cause is power-on */
if (status & (1 << 7) || (wdt_cnt == 0))
/*
* 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);