summaryrefslogtreecommitdiff
path: root/include/link_defs.h
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2021-03-29 18:31:37 +0800
committerCommit Bot <commit-bot@chromium.org>2021-04-07 02:50:27 +0000
commitadcaef75c457970dc5b17e8bf5a2346302836832 (patch)
tree23c70c4f4be0321065b8431a3eeca6c8c72a8e1b /include/link_defs.h
parent19dcdf2830ae424f7d24c828002fa133a7b7b38d (diff)
downloadchrome-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/link_defs.h')
-rw-r--r--include/link_defs.h3
1 files changed, 3 insertions, 0 deletions
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