summaryrefslogtreecommitdiff
path: root/board/spring
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-01-08 14:13:23 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-01-09 20:25:11 +0000
commit72481572aad731b3c2db20c41efb6d5a51812eaa (patch)
treef8c8bc1d9aa7847e6837834d6706eabc2673f5a1 /board/spring
parentaea8b2d79860ee0cf1117455070c6af45892309c (diff)
downloadchrome-ec-72481572aad731b3c2db20c41efb6d5a51812eaa.tar.gz
Convert vboot hash calculation from task to deferred function
Vboot hash calculation takes ~350 ms during EC boot. Since the hash task is higher priority than the hook task, this starves all the hooks during boot. We could, in theory, fix that simply by swapping the priority of the hook and hash tasks. But then watchdog detection (in the hook task) wouldn't detect hangs in the hash task. A better fix (implemented here) is to convert the hashing operation to a series of deferred function calls. This gets rid of the hash task entirely, and allows all pending hooks and other deferred function calls to take place between each chunk of hashing. On STM32-based boards, we need to bump up the hook task stack size, since hashing is called from several layers deep in the hook task instead of at the top of its own task, but this is still a net win of several hundred bytes of SRAM. BUG=chrome-os-partner:24892 BRANCH=rambi TEST=Boot EC; look for "hash start" and "hash done" debug output. 'taskinfo' shows at least 32 bytes of unused stack for HOOKS task. 'hash ro' runs properly from EC console. Change-Id: I9e580dc10fc0bc8e44896d84451218ef67578bbe Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/181954
Diffstat (limited to 'board/spring')
-rw-r--r--board/spring/board.h3
-rw-r--r--board/spring/ec.tasklist3
2 files changed, 3 insertions, 3 deletions
diff --git a/board/spring/board.h b/board/spring/board.h
index 031e8b96b7..5259ebc1ca 100644
--- a/board/spring/board.h
+++ b/board/spring/board.h
@@ -34,8 +34,9 @@
#define CONFIG_LED_DRIVER_LP5562
#define CONFIG_PMU_HARD_RESET
#define CONFIG_PMU_TPS65090
-#define CONFIG_USB_SWITCH_TSU6721
#define CONFIG_PWM
+#define CONFIG_USB_SWITCH_TSU6721
+#define CONFIG_VBOOT_HASH
#ifndef __ASSEMBLER__
diff --git a/board/spring/ec.tasklist b/board/spring/ec.tasklist
index 4503bb2e95..f96ee6e387 100644
--- a/board/spring/ec.tasklist
+++ b/board/spring/ec.tasklist
@@ -17,8 +17,7 @@
* 's' is the stack size in bytes; must be a multiple of 8
*/
#define CONFIG_TASK_LIST \
- TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \
- TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, TASK_STACK_SIZE) \
+ TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \