summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2019-04-11 18:18:02 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-04-17 21:32:37 -0700
commite16da08f09cc108bf23c88a23f28382e2455f5e8 (patch)
treeadcbadedad270b3592ced5ae4cca350b59db97d9
parenta19ad262f2df67cf36d6051d1f309a9f50c2b7f3 (diff)
downloadchrome-ec-e16da08f09cc108bf23c88a23f28382e2455f5e8.tar.gz
kukui: remove flashpd/rwhashpd host command from RO
Kukui is running out of RO space. In order to save more space, we found that these two functions takes ~500 bytes, so it's especially worth removing. RO size before and after: 122056 Apr 11 17:01 build/kukui/RO/ec.RO.flat 121544 Apr 11 18:14 build/kukui/RO/ec.RO.flat BUG=b:120588396 TEST=make buildall -j BRANCH=None Change-Id: I2e08d45093d5ef88516950e8289e559d4421d126 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1564490 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
-rw-r--r--board/kukui/board.h5
-rw-r--r--common/usb_pd_protocol.c5
-rw-r--r--include/config.h8
3 files changed, 16 insertions, 2 deletions
diff --git a/board/kukui/board.h b/board/kukui/board.h
index 40d1fc3930..e2cb3b68d1 100644
--- a/board/kukui/board.h
+++ b/board/kukui/board.h
@@ -174,6 +174,11 @@
#undef CONFIG_CMD_POWERINDEBUG
#undef CONFIG_CMD_TIMERINFO
+#ifdef SECTION_IS_RO
+#undef CONFIG_HOSTCMD_FLASHPD
+#undef CONFIG_HOSTCMD_RWHASHPD
+#endif
+
#define CONFIG_TASK_PROFILING
/* I2C ports */
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 932467826d..d8f93f06ab 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -5044,6 +5044,7 @@ DECLARE_HOST_COMMAND(EC_CMD_USB_PD_CONTROL,
hc_usb_pd_control,
EC_VER_MASK(0) | EC_VER_MASK(1) | EC_VER_MASK(2));
+#ifdef CONFIG_HOSTCMD_FLASHPD
static int hc_remote_flash(struct host_cmd_handler_args *args)
{
const struct ec_params_usb_pd_fw_update *p = args->params;
@@ -5141,7 +5142,9 @@ static int hc_remote_flash(struct host_cmd_handler_args *args)
DECLARE_HOST_COMMAND(EC_CMD_USB_PD_FW_UPDATE,
hc_remote_flash,
EC_VER_MASK(0));
+#endif /* CONFIG_HOSTCMD_FLASHPD */
+#ifdef CONFIG_HOSTCMD_RWHASHPD
static int hc_remote_rw_hash_entry(struct host_cmd_handler_args *args)
{
int i, idx = 0, found = 0;
@@ -5171,6 +5174,7 @@ static int hc_remote_rw_hash_entry(struct host_cmd_handler_args *args)
DECLARE_HOST_COMMAND(EC_CMD_USB_PD_RW_HASH_ENTRY,
hc_remote_rw_hash_entry,
EC_VER_MASK(0));
+#endif /* CONFIG_HOSTCMD_RWHASHPD */
static int hc_remote_pd_dev_info(struct host_cmd_handler_args *args)
{
@@ -5192,7 +5196,6 @@ static int hc_remote_pd_dev_info(struct host_cmd_handler_args *args)
args->response_size = sizeof(*r);
return EC_RES_SUCCESS;
}
-
DECLARE_HOST_COMMAND(EC_CMD_USB_PD_DEV_INFO,
hc_remote_pd_dev_info,
EC_VER_MASK(0));
diff --git a/include/config.h b/include/config.h
index 0dee087d73..67b1b7a1dd 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1991,7 +1991,13 @@
#undef CONFIG_HOSTCMD_AP_SET_SKUID
/* Command to issue AP reset */
-#undef CONFIG_HOSTCMD_AP_RESET
+#undef CONFIG_HOSTCMD_AP_RESET
+
+/* Flash commands over PD */
+#define CONFIG_HOSTCMD_FLASHPD
+
+/* Set entry in PD MCU's device rw_hash table */
+#define CONFIG_HOSTCMD_RWHASHPD
/* List of host commands whose debug output will be suppressed */
#undef CONFIG_SUPPRESSED_HOST_COMMANDS