summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorShannon Chen <shannc@google.com>2019-08-02 17:48:58 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-21 04:58:22 +0000
commit2fb1836646a1f4edcea1f22408535872b833d14e (patch)
tree3fead01aba3c47b18c85f462e88cf505fb4f4464 /core
parent10d0ea416eac754b94858c491efdd56cf1ef2476 (diff)
downloadchrome-ec-2fb1836646a1f4edcea1f22408535872b833d14e.tar.gz
log: Preserve Kukui EC reset logs across every EC reboot on SRAM.
On Kukui, we need to put console logs and reset reasons at fixed addresses on SRAM to save the information across each EC resets. Otherwise, EC will lose console logs and reset reasons after resetting EC. This CL ensures that the contents of reset and console logs will not be clobbered or cleared by putting mandatory symbols at a fixed location on SRAM. The values will only be reset when checksum or sanity check fails. BUG=b:133795403 TEST=1. On Kukui, shutdown AP, reboot AP, or sysjump, and see the previous logs before reboot will be kept on /var/log/croc_ec.log 2. Reset reasons can be viewed with ectool uptimeinfo BRANCH=master Change-Id: I19db49101fda1675dc2fdc047b7f14af77cdb6e6 Signed-off-by: Shannon Chen <shannc@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1716671 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Shannon Chen <shannc@chromium.org> Tested-by: Shannon Chen <shannc@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m0/ec.lds.S28
1 files changed, 24 insertions, 4 deletions
diff --git a/core/cortex-m0/ec.lds.S b/core/cortex-m0/ec.lds.S
index 42e0b2e034..953433459a 100644
--- a/core/cortex-m0/ec.lds.S
+++ b/core/cortex-m0/ec.lds.S
@@ -191,16 +191,36 @@ SECTIONS
. = ALIGN(4);
} > FLASH
__data_lma_start = . ;
-
- .bss : {
+ .vtable : {
/*
- * Vector table must be at the beginning of bss section. The vector
+ * Vector table must be at the base of SRAM. The vector
* table section contains a RAM copy of the vector table used on
* STM chips for relocating the vector table.
*/
. = ALIGN(8);
- __bss_start = .;
*(.bss.vector_table)
+ . = ALIGN(8);
+ } > IRAM
+
+#ifdef CONFIG_PRESERVE_LOGS
+ .preserve_logs(NOLOAD) : {
+ /*
+ * The size of the vector table is fixed. Thus, the address of
+ * the preserved logs is also fixed.
+ */
+ . = ALIGN(8);
+ *(SORT(.preserved_logs.*))
+ . = ALIGN(8);
+ __preserved_logs_end = .;
+ } > IRAM
+
+ ASSERT((SIZEOF(.vtable) + SIZEOF(.preserve_logs) + CONFIG_RAM_BASE) ==
+ __preserved_logs_end, "preserve_logs must be right after vtable")
+#endif
+
+ .bss : {
+ . = ALIGN(8);
+ __bss_start = .;
/* Stacks must be 64-bit aligned */
. = ALIGN(8);
*(.bss.system_stack)