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 /include | |
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 'include')
-rw-r--r-- | include/config.h | 4 | ||||
-rw-r--r-- | include/link_defs.h | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/config.h b/include/config.h index 8e7db9af9c..283d8ff7fb 100644 --- a/include/config.h +++ b/include/config.h @@ -3953,8 +3953,8 @@ #undef CONFIG_UART_PAD_SWITCH /** - * This will only be used for Kukui and cortex-m0. Preserve EC reset logs and - * console logs on SRAM so that the logs will be preserved after EC shutting + * This will only be used for Kukui. Preserve EC reset logs and console + * logs on SRAM/FLASH so that the logs will be preserved after EC shutting * down or sysjumped. It will keep the contents across EC resets, so we have * more information about system states. The contents on SRAM will be cleared * when checksum or validity check fails. diff --git a/include/link_defs.h b/include/link_defs.h index f18c52a45c..79b1a99159 100644 --- a/include/link_defs.h +++ b/include/link_defs.h @@ -148,6 +148,9 @@ extern void *__dram_bss_end; #ifdef CONFIG_PRESERVE_LOGS #define __preserved_logs(name) \ __attribute__((section(".preserved_logs." STRINGIFY(name)))) +/* preserved_logs section. */ +extern const char __preserved_logs_start[]; +extern const char __preserved_logs_size[]; #else #define __preserved_logs(name) #endif |