From efb28cc783b116d393a939cdd34d69557c29dd22 Mon Sep 17 00:00:00 2001 From: Todd Broch Date: Mon, 5 Jan 2015 13:36:47 -0800 Subject: Add CONFIG_CMD_HASH to optionally remove 'hash' console command. Create optional config to remove 'hash' console command and undef it for a few space-constrained boards (ryu*, samus_pd). Signed-off-by: Todd Broch BRANCH=samus BUG=chrome-os-partner:34489 TEST=manual, - compile for ryu, samus_pd and save ~400bytes - 'hash' command no longer appears as a console command Change-Id: I054fd4473911dd362c2c1d171ee7aaad859d893a Reviewed-on: https://chromium-review.googlesource.com/238433 Reviewed-by: Vincent Palatin Reviewed-by: Alec Berg Commit-Queue: Todd Broch Tested-by: Todd Broch --- board/ryu/board.h | 1 + board/ryu_p1/board.h | 1 + board/samus_pd/board.h | 1 + common/vboot_hash.c | 4 ++-- include/config.h | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/board/ryu/board.h b/board/ryu/board.h index 49aeca9f3d..6c44054aac 100644 --- a/board/ryu/board.h +++ b/board/ryu/board.h @@ -19,6 +19,7 @@ #define CC_DEFAULT (CC_ALL & ~CC_MASK(CC_USBPD)) /* Optional features */ +#undef CONFIG_CMD_HASH #define CONFIG_FORCE_CONSOLE_RESUME #define CONFIG_STM_HWTIMER32 #define CONFIG_USB_POWER_DELIVERY diff --git a/board/ryu_p1/board.h b/board/ryu_p1/board.h index abfc0fb2e7..07a12e9bdf 100644 --- a/board/ryu_p1/board.h +++ b/board/ryu_p1/board.h @@ -19,6 +19,7 @@ #define CC_DEFAULT (CC_ALL & ~CC_MASK(CC_USBPD)) /* Optional features */ +#undef CONFIG_CMD_HASH #define CONFIG_COMMON_GPIO_SHORTNAMES #define CONFIG_STM_HWTIMER32 #define CONFIG_USB_POWER_DELIVERY diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h index adbb4f02df..a607d690ed 100644 --- a/board/samus_pd/board.h +++ b/board/samus_pd/board.h @@ -19,6 +19,7 @@ #define CONFIG_ADC #define CONFIG_BOARD_PRE_INIT #define CONFIG_CHARGE_MANAGER +#undef CONFIG_CMD_HASH /* Minimum ilim = 500 mA */ #define CONFIG_CHARGER_INPUT_CURRENT PWM_0_MA #define CONFIG_COMMON_GPIO_SHORTNAMES diff --git a/common/vboot_hash.c b/common/vboot_hash.c index 9d51d7517d..e7717e96db 100644 --- a/common/vboot_hash.c +++ b/common/vboot_hash.c @@ -209,7 +209,7 @@ DECLARE_HOOK(HOOK_SYSJUMP, vboot_hash_preserve_state, HOOK_PRIO_DEFAULT); /****************************************************************************/ /* Console commands */ - +#ifdef CONFIG_CMD_HASH static int command_hash(int argc, char **argv) { uint32_t offset = CONFIG_FW_RW_OFF; @@ -274,7 +274,7 @@ DECLARE_CONSOLE_COMMAND(hash, command_hash, "[abort | ro | rw] | [ []]", "Request hash recomputation", NULL); - +#endif /* CONFIG_CMD_HASH */ /****************************************************************************/ /* Host commands */ diff --git a/include/config.h b/include/config.h index d0dbd68d9b..ffa46704c4 100644 --- a/include/config.h +++ b/include/config.h @@ -328,6 +328,7 @@ #undef CONFIG_CMD_ECTEMP #undef CONFIG_CMD_FLASH #undef CONFIG_CMD_GSV +#define CONFIG_CMD_HASH #undef CONFIG_CMD_HOSTCMD #undef CONFIG_CMD_ILIM #undef CONFIG_CMD_JUMPTAGS -- cgit v1.2.1