it8380dev: fix reset cause

symptom: there are many reset cause while chip power on.
root cause: there is no default value for bram.

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=1. "power-on" reset cause still exist.
     2. console "reboot" hard, preserve, and ap-off.
     3. console "sysjump" rw and ro.

Change-Id: Ie190ade4990bfaf46e73746ac5019f61307c81e5
Reviewed-on: https://chromium-review.googlesource.com/286281
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
This commit is contained in:
Dino Li
2015-07-22 11:39:54 +08:00
committed by ChromeOS Commit Bot
parent 57ec5805fe
commit 2f4a590379

View File

@@ -51,10 +51,14 @@ static void check_reset_cause(void)
flags |= RESET_FLAG_POWER_ON;
/* Restore then clear saved reset flags. */
flags |= REG8(IT83XX_BRAM_BASE+BRAM_INDEX_SAVED_RESET_FLAGS) << 24;
flags |= REG8(IT83XX_BRAM_BASE+BRAM_INDEX_SAVED_RESET_FLAGS+1) << 16;
flags |= REG8(IT83XX_BRAM_BASE+BRAM_INDEX_SAVED_RESET_FLAGS+2) << 8;
flags |= REG8(IT83XX_BRAM_BASE+BRAM_INDEX_SAVED_RESET_FLAGS+3);
if (!(flags & RESET_FLAG_POWER_ON)) {
const uint32_t addr =
IT83XX_BRAM_BASE+BRAM_INDEX_SAVED_RESET_FLAGS;
flags |= REG8(addr + 0) << 24;
flags |= REG8(addr + 1) << 16;
flags |= REG8(addr + 2) << 8;
flags |= REG8(addr + 3);
}
REG8(IT83XX_BRAM_BASE+BRAM_INDEX_SAVED_RESET_FLAGS) = 0;
REG8(IT83XX_BRAM_BASE+BRAM_INDEX_SAVED_RESET_FLAGS+1) = 0;