summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2016-09-30 12:23:53 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-01 00:02:01 -0700
commit0a4bb34bcdde39f1cd21dd555d7284a8b1ce9cca (patch)
treed5810ab7598d0df4d5f372eb87d09be352b12c94
parentf715b8b86531b8984fe0fd48265ff85f3a5e9cf2 (diff)
downloadchrome-ec-0a4bb34bcdde39f1cd21dd555d7284a8b1ce9cca.tar.gz
Add more CONFIG_CMD_* options for console commands
We have a large number of config.h options to enable/disable specific console commands. This adds a few more that we will want to control. BUG=chrome-os-partner:57408 BRANCH=none TEST=make buildall; try on Gru with and without CR50_DEV=1 Change-Id: Id41f0e9f44fc77feaf56853f357a6b33bb685b0c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/391614 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--common/memory_commands.c2
-rw-r--r--common/system.c4
-rw-r--r--common/timer.c2
-rw-r--r--include/config.h4
4 files changed, 11 insertions, 1 deletions
diff --git a/common/memory_commands.c b/common/memory_commands.c
index 3cf7974e5e..f44640d5e3 100644
--- a/common/memory_commands.c
+++ b/common/memory_commands.c
@@ -111,6 +111,7 @@ DECLARE_CONSOLE_COMMAND(md, command_mem_dump,
"dump memory values, optionally specifying the format");
#endif /* CONFIG_CMD_MD */
+#ifdef CONFIG_CMD_RW
static int command_read_word(int argc, char **argv)
{
volatile uint32_t *address;
@@ -191,3 +192,4 @@ DECLARE_CONSOLE_COMMAND
(rw, command_read_word,
"[.b|.h] addr [value]",
"Read or write a word in memory optionally specifying the size");
+#endif /* CONFIG_CMD_RW */
diff --git a/common/system.c b/common/system.c
index 0ca7b33643..5e26ba3e43 100644
--- a/common/system.c
+++ b/common/system.c
@@ -996,6 +996,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(version, command_version,
NULL,
"Print versions");
+#ifdef CONFIG_CMD_SYSJUMP
static int command_sysjump(int argc, char **argv)
{
uint32_t addr;
@@ -1035,6 +1036,7 @@ static int command_sysjump(int argc, char **argv)
DECLARE_CONSOLE_COMMAND(sysjump, command_sysjump,
"[RO | RW | addr | disable]",
"Jump to a system image or address");
+#endif
static int command_reboot(int argc, char **argv)
{
@@ -1079,7 +1081,7 @@ DECLARE_SAFE_CONSOLE_COMMAND(syslock, command_system_lock,
NULL,
"Lock the system, even if WP is disabled");
-#ifdef CONFIG_LOW_POWER_IDLE
+#if defined(CONFIG_LOW_POWER_IDLE) && defined(CONFIG_CMD_SLEEPMASK)
/**
* Modify and print the sleep mask which controls access to deep sleep
* mode in the idle task.
diff --git a/common/timer.c b/common/timer.c
index 0daf501b9c..bda3e9c197 100644
--- a/common/timer.c
+++ b/common/timer.c
@@ -252,6 +252,7 @@ static void timer_sysjump(void)
}
DECLARE_HOOK(HOOK_SYSJUMP, timer_sysjump, HOOK_PRIO_DEFAULT);
+#ifdef CONFIG_CMD_WAITMS
static int command_wait(int argc, char **argv)
{
char *e;
@@ -271,6 +272,7 @@ static int command_wait(int argc, char **argv)
DECLARE_CONSOLE_COMMAND(waitms, command_wait,
"msec",
"Busy-wait for msec");
+#endif
#ifdef CONFIG_CMD_FORCETIME
static int command_force_time(int argc, char **argv)
diff --git a/include/config.h b/include/config.h
index d95ec4581e..291c9e934e 100644
--- a/include/config.h
+++ b/include/config.h
@@ -624,13 +624,16 @@
#define CONFIG_CMD_REGULATOR
#undef CONFIG_CMD_RTC
#undef CONFIG_CMD_RTC_ALARM
+#define CONFIG_CMD_RW
#undef CONFIG_CMD_SCRATCHPAD
#define CONFIG_CMD_SHMEM
#undef CONFIG_CMD_SLEEP
+#define CONFIG_CMD_SLEEPMASK
#undef CONFIG_CMD_SPI_FLASH
#undef CONFIG_CMD_SPI_NOR
#undef CONFIG_CMD_SPI_XFER
#undef CONFIG_CMD_STACKOVERFLOW
+#define CONFIG_CMD_SYSJUMP
#undef CONFIG_CMD_TASKREADY
#define CONFIG_CMD_TEMP_SENSOR
#define CONFIG_CMD_TIMERINFO
@@ -638,6 +641,7 @@
#undef CONFIG_CMD_USART_INFO
#define CONFIG_CMD_USBMUX
#undef CONFIG_CMD_USB_PD_PE
+#define CONFIG_CMD_WAITMS
/*****************************************************************************/