diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2021-03-29 18:31:37 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-07 02:50:27 +0000 |
commit | adcaef75c457970dc5b17e8bf5a2346302836832 (patch) | |
tree | 23c70c4f4be0321065b8431a3eeca6c8c72a8e1b /core | |
parent | 19dcdf2830ae424f7d24c828002fa133a7b7b38d (diff) | |
download | chrome-ec-adcaef75c457970dc5b17e8bf5a2346302836832.tar.gz |
it8xxx2: add support option CONFIG_PRESERVE_LOGS
On it8xxx2 chips, assert WRST# to reset itself will clear memory
content to default value, this is a HW mechanism. So if
CONFIG_PRESERVE_LOGS and CONFIG_IT83XX_HARD_RESET_BY_GPG1 are enabled
at the same time, we have to save EC logs into flash before reset.
We will restore logs from flash on the next initialization before
jumping to main routine.
BUG=b:183899510, b:183466169
BRANCH=none
TEST=1) __image_size is same as ec.RW.bin size.
2) buildall.
3) manually verify reboot, poweroff, and sysjump from AP console:
localhost ~ # ectool uptimeinfo
EC uptime: 64.755 seconds
AP resets since EC boot: 0
Most recent AP reset causes:
EC reset flags at last EC boot: reset-pin | power-on
localhost ~ # reboot
...
localhost ~ # ectool uptimeinfo
EC uptime: 19.334 seconds
AP resets since EC boot: 0
Most recent AP reset causes:
71.609: reset: at AP's request
EC reset flags at last EC boot: reset-pin | power-on | hard
localhost ~ # poweroff
...
localhost ~ # ectool uptimeinfo
EC uptime: 20.627 seconds
AP resets since EC boot: 0
Most recent AP reset causes:
71.609: reset: at AP's request
32.149: reset: at AP's request
EC reset flags at last EC boot: reset-pin | power-on | hard
localhost ~ # ectool reboot_ec RW
localhost ~ # ectool uptimeinfo
EC uptime: 37.998 seconds
AP resets since EC boot: 0
Most recent AP reset causes:
71.609: reset: at AP's request
32.149: reset: at AP's request
EC reset flags at last EC boot: reset-pin | power-on | sysjump | hard
localhost ~ #
Change-Id: I76b5f172b7728dc5ce9bf3a965cb7b2d638f8fc3
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2794322
Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/riscv-rv32i/ec.lds.S | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/riscv-rv32i/ec.lds.S b/core/riscv-rv32i/ec.lds.S index 109fe7c579..80d1208a69 100644 --- a/core/riscv-rv32i/ec.lds.S +++ b/core/riscv-rv32i/ec.lds.S @@ -271,6 +271,25 @@ SECTIONS __data_lma_start = .; +#ifdef CONFIG_PRESERVE_LOGS + .preserve_logs(NOLOAD) : { + /* + * The address of the preserved logs is fixed at the beginning + * of memory. + */ + . = ALIGN(8); + __preserved_logs_start = .; + *(SORT(.preserved_logs.*)) + . = ALIGN(8); + __preserved_logs_end = .; + } > IRAM + __preserved_logs_size = __preserved_logs_end - __preserved_logs_start; +#ifdef CONFIG_IT83XX_HARD_RESET_BY_GPG1 + ASSERT(__preserved_logs_size <= CHIP_FLASH_PRESERVE_LOGS_SIZE, + "Not enough flash space to save EC logs.") +#endif +#endif /* CONFIG_PRESERVE_LOGS */ + .data : { . = ALIGN(4); __data_start = .; |