summaryrefslogtreecommitdiff
path: root/board
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
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')
-rw-r--r--board/falco/board.h1
-rw-r--r--board/falco/ec.tasklist1
-rw-r--r--board/link/board.h1
-rw-r--r--board/link/ec.tasklist1
-rw-r--r--board/nyan/board.h1
-rw-r--r--board/nyan/ec.tasklist3
-rw-r--r--board/peppy/board.h1
-rw-r--r--board/peppy/ec.tasklist1
-rw-r--r--board/pit/board.h3
-rw-r--r--board/pit/ec.tasklist3
-rw-r--r--board/rambi/board.h1
-rw-r--r--board/rambi/ec.tasklist1
-rw-r--r--board/samus/board.h3
-rw-r--r--board/samus/ec.tasklist1
-rw-r--r--board/snow/board.h1
-rw-r--r--board/snow/ec.tasklist3
-rw-r--r--board/spring/board.h3
-rw-r--r--board/spring/ec.tasklist3
-rw-r--r--board/squawks/board.h1
-rw-r--r--board/squawks/ec.tasklist1
20 files changed, 17 insertions, 17 deletions
diff --git a/board/falco/board.h b/board/falco/board.h
index 347da3b0e2..2900dc9b73 100644
--- a/board/falco/board.h
+++ b/board/falco/board.h
@@ -34,6 +34,7 @@
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_PP3300_DX_EN
#define CONFIG_UART_HOST 2
#define CONFIG_USB_PORT_POWER_DUMB
+#define CONFIG_VBOOT_HASH
#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
diff --git a/board/falco/ec.tasklist b/board/falco/ec.tasklist
index 8666f7db09..d193e6e7b2 100644
--- a/board/falco/ec.tasklist
+++ b/board/falco/ec.tasklist
@@ -18,7 +18,6 @@
*/
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(VBOOTHASH, vboot_hash_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_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
diff --git a/board/link/board.h b/board/link/board.h
index 743f77a72c..def2af9146 100644
--- a/board/link/board.h
+++ b/board/link/board.h
@@ -39,6 +39,7 @@
#define CONFIG_TEMP_SENSOR_TMP006
#define CONFIG_UART_HOST 1
#define CONFIG_USB_PORT_POWER_SMART
+#define CONFIG_VBOOT_HASH
#define CONFIG_WIRELESS
#define CONFIG_WP_ACTIVE_HIGH
diff --git a/board/link/ec.tasklist b/board/link/ec.tasklist
index 3f3d9b5015..53b30cb9a3 100644
--- a/board/link/ec.tasklist
+++ b/board/link/ec.tasklist
@@ -18,7 +18,6 @@
*/
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(LIGHTBAR, lightbar_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
diff --git a/board/nyan/board.h b/board/nyan/board.h
index 52c9e80933..ebbe266ea9 100644
--- a/board/nyan/board.h
+++ b/board/nyan/board.h
@@ -21,6 +21,7 @@
#define CONFIG_SPI
#define CONFIG_PWM
#define CONFIG_POWER_BUTTON
+#define CONFIG_VBOOT_HASH
#ifndef __ASSEMBLER__
diff --git a/board/nyan/ec.tasklist b/board/nyan/ec.tasklist
index 448879d105..dcdca4df28 100644
--- a/board/nyan/ec.tasklist
+++ b/board/nyan/ec.tasklist
@@ -15,8 +15,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_NOTEST(POWERLED, power_led_task, NULL, 256) \
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
diff --git a/board/peppy/board.h b/board/peppy/board.h
index c4ceaf93ee..8749e60f89 100644
--- a/board/peppy/board.h
+++ b/board/peppy/board.h
@@ -36,6 +36,7 @@
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_PP3300_DX_EN
#define CONFIG_UART_HOST 2
#define CONFIG_USB_PORT_POWER_DUMB
+#define CONFIG_VBOOT_HASH
#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
diff --git a/board/peppy/ec.tasklist b/board/peppy/ec.tasklist
index 8666f7db09..d193e6e7b2 100644
--- a/board/peppy/ec.tasklist
+++ b/board/peppy/ec.tasklist
@@ -18,7 +18,6 @@
*/
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(VBOOTHASH, vboot_hash_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_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
diff --git a/board/pit/board.h b/board/pit/board.h
index f4fc68b06d..c5ef19fbcd 100644
--- a/board/pit/board.h
+++ b/board/pit/board.h
@@ -22,8 +22,9 @@
#define CONFIG_PMU_HARD_RESET
#define CONFIG_PMU_POWERINFO
#define CONFIG_PMU_TPS65090
-#define CONFIG_SPI
#define CONFIG_PWM
+#define CONFIG_SPI
+#define CONFIG_VBOOT_HASH
#ifndef __ASSEMBLER__
diff --git a/board/pit/ec.tasklist b/board/pit/ec.tasklist
index 448879d105..dcdca4df28 100644
--- a/board/pit/ec.tasklist
+++ b/board/pit/ec.tasklist
@@ -15,8 +15,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_NOTEST(POWERLED, power_led_task, NULL, 256) \
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
diff --git a/board/rambi/board.h b/board/rambi/board.h
index 1cde39f89b..420d072620 100644
--- a/board/rambi/board.h
+++ b/board/rambi/board.h
@@ -36,6 +36,7 @@
#define CONFIG_TEMP_SENSOR_TMP432
#define CONFIG_USB_PORT_POWER_SMART
#define CONFIG_USB_PORT_POWER_SMART_SIMPLE
+#define CONFIG_VBOOT_HASH
#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
diff --git a/board/rambi/ec.tasklist b/board/rambi/ec.tasklist
index c8284ec561..8b4485818f 100644
--- a/board/rambi/ec.tasklist
+++ b/board/rambi/ec.tasklist
@@ -19,7 +19,6 @@
*/
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(VBOOTHASH, vboot_hash_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_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \
diff --git a/board/samus/board.h b/board/samus/board.h
index fac709c313..6eb42c1d84 100644
--- a/board/samus/board.h
+++ b/board/samus/board.h
@@ -46,8 +46,9 @@
#define CONFIG_TEMP_SENSOR_TMP006
#define CONFIG_TEMP_SENSOR_POWER_GPIO GPIO_PP3300_DSW_GATED_EN
#define CONFIG_UART_HOST 2
-#define CONFIG_WIRELESS
#define CONFIG_USB_PORT_POWER_SMART
+#define CONFIG_VBOOT_HASH
+#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
diff --git a/board/samus/ec.tasklist b/board/samus/ec.tasklist
index 3f3d9b5015..53b30cb9a3 100644
--- a/board/samus/ec.tasklist
+++ b/board/samus/ec.tasklist
@@ -18,7 +18,6 @@
*/
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(VBOOTHASH, vboot_hash_task, NULL, LARGER_TASK_STACK_SIZE) \
TASK_NOTEST(LIGHTBAR, lightbar_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
diff --git a/board/snow/board.h b/board/snow/board.h
index 476fc551c9..aadf10f827 100644
--- a/board/snow/board.h
+++ b/board/snow/board.h
@@ -30,6 +30,7 @@
#define CONFIG_PMU_HARD_RESET
#define CONFIG_PMU_TPS65090
#define CONFIG_PWM
+#define CONFIG_VBOOT_HASH
/* use STOP mode when we have nothing to do */
#define CONFIG_LOW_POWER_IDLE
diff --git a/board/snow/ec.tasklist b/board/snow/ec.tasklist
index e2525aaeaf..e9c4bdd269 100644
--- a/board/snow/ec.tasklist
+++ b/board/snow/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_NOTEST(POWERLED, power_led_task, NULL, 256) \
TASK_ALWAYS(CHARGER, charger_task, NULL, TASK_STACK_SIZE) \
TASK_NOTEST(CHIPSET, chipset_task, NULL, TASK_STACK_SIZE) \
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) \
diff --git a/board/squawks/board.h b/board/squawks/board.h
index 1b93ecab22..0d184ace96 100644
--- a/board/squawks/board.h
+++ b/board/squawks/board.h
@@ -36,6 +36,7 @@
#define CONFIG_TEMP_SENSOR_TMP432
#define CONFIG_USB_PORT_POWER_SMART
#define CONFIG_USB_PORT_POWER_SMART_SIMPLE
+#define CONFIG_VBOOT_HASH
#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
diff --git a/board/squawks/ec.tasklist b/board/squawks/ec.tasklist
index c8284ec561..8b4485818f 100644
--- a/board/squawks/ec.tasklist
+++ b/board/squawks/ec.tasklist
@@ -19,7 +19,6 @@
*/
#define CONFIG_TASK_LIST \
TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \
- TASK_NOTEST(VBOOTHASH, vboot_hash_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_NOTEST(KEYPROTO, keyboard_protocol_task, NULL, TASK_STACK_SIZE) \