mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
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:
committed by
ChromeOS Commit Bot
parent
57ec5805fe
commit
2f4a590379
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user