summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-07-12 17:07:27 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-07-17 21:27:14 -0700
commitcc6662135d38f1544d655cf1d4d0f1f3e3d059b7 (patch)
tree588520f37b159f82f7cccc4bebbaa702abd9170d
parent412093d046ec6eab64798f70bff98c8865f709d3 (diff)
downloadchrome-ec-cc6662135d38f1544d655cf1d4d0f1f3e3d059b7.tar.gz
hammer: Enable Link-Time-Optimization CONFIG_LTO
We need to add __keep to the USB descriptors, otherwise they get thrown away. Also, for some reason the optimized RWSIG task uses a little bit more stack space, so account for that: 1 RWSIG 00000000 0.264350 1096/2048 BRANCH=none BUG=b:63610290 TEST=make BOARD=hammer -j make newsizes build/hammer/RO/ec.RO.flat shrank by 2052 bytes: (37336 to 35284) build/hammer/RW/ec.RW.flat shrank by 3172 bytes: (50508 to 47336) Flash hammer, touchpad, keyboard, update all still work fine. Change-Id: I39ffd320dae883596ce481efc4adec6e3c23000b Reviewed-on: https://chromium-review.googlesource.com/567909 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--board/hammer/board.h1
-rw-r--r--board/hammer/ec.tasklist2
-rw-r--r--include/usb_descriptor.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/board/hammer/board.h b/board/hammer/board.h
index 0e20d9f8f2..3aabd26f7a 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -73,6 +73,7 @@
/* Optional features */
#define CONFIG_LOW_POWER_IDLE
+#define CONFIG_LTO
#define CONFIG_FORCE_CONSOLE_RESUME
#define CONFIG_STM_HWTIMER32
#define CONFIG_HW_CRC
diff --git a/board/hammer/ec.tasklist b/board/hammer/ec.tasklist
index 06ff3e0c1d..0cbc39dbf6 100644
--- a/board/hammer/ec.tasklist
+++ b/board/hammer/ec.tasklist
@@ -17,7 +17,7 @@
* 's' is the stack size in bytes; must be a multiple of 8
*/
#define CONFIG_TASK_LIST \
- TASK_ALWAYS_RO(RWSIG, rwsig_task, NULL, 1024) \
+ TASK_ALWAYS_RO(RWSIG, rwsig_task, NULL, 1280) \
TASK_ALWAYS (HOOKS, hook_task, NULL, 2048) \
TASK_ALWAYS_RW(TOUCHPAD, elan_tp_task, NULL, TASK_STACK_SIZE) \
TASK_ALWAYS (CONSOLE, console_task, NULL, 1024) \
diff --git a/include/usb_descriptor.h b/include/usb_descriptor.h
index c6e877aac6..33fde009d2 100644
--- a/include/usb_descriptor.h
+++ b/include/usb_descriptor.h
@@ -276,7 +276,7 @@ extern struct usb_string_desc *usb_serialno_desc;
/* Use these macros for declaring descriptors, to order them properly */
#define USB_CONF_DESC_VAR(name, varname) varname \
- __attribute__((section(".rodata.usb_desc_" STRINGIFY(name))))
+ __keep __attribute__((section(".rodata.usb_desc_" STRINGIFY(name))))
#define USB_CONF_DESC(name) USB_CONF_DESC_VAR(name, CONCAT2(usb_desc_, name))
#define USB_IFACE_DESC(num) USB_CONF_DESC(CONCAT3(iface, num, _0iface))
#define USB_CUSTOM_DESC_VAR(i, name, varname) \