summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-05-05 10:44:30 -0500
committerCommit Bot <commit-bot@chromium.org>2021-05-07 16:17:19 +0000
commit1908d6706c3cbdf06a3604d17785d72588825533 (patch)
tree92b3c6707239c4a158b4de6ea1128997bc80aa36
parent386f987a2ab9703b0fdd3b1e56e595f3ef395727 (diff)
downloadchrome-ec-1908d6706c3cbdf06a3604d17785d72588825533.tar.gz
add CONFIG_CMD_SYSRST
Add CONFIG_CMD_SYSRST to control building the sysrst command. BUG=b:186663661 TEST=flash usage doesn't change with make -j BOARD=cr50 Change-Id: I4922b5b55d895bc2f4b43614fe2af210c5fbe134 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2875469 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
-rw-r--r--board/cr50/board.c20
-rw-r--r--include/config.h1
2 files changed, 12 insertions, 9 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c
index 399d28786d..43e4e8cd3b 100644
--- a/board/cr50/board.c
+++ b/board/cr50/board.c
@@ -1034,15 +1034,6 @@ void deassert_sys_rst(void)
gpio_set_level(GPIO_SYS_RST_L_OUT, 1);
}
-static int is_sys_rst_asserted(void)
-{
- /*
- * SYS_RST_L is pseudo open drain. It is only an output when it's
- * asserted.
- */
- return gpio_get_flags(GPIO_SYS_RST_L_OUT) & GPIO_OUTPUT;
-}
-
/**
* Reboot the AP
*/
@@ -1089,6 +1080,16 @@ static void key_combo0_irq(void)
}
DECLARE_IRQ(GC_IRQNUM_RBOX0_INTR_BUTTON_COMBO0_RDY_INT, key_combo0_irq, 0);
+#ifdef CONFIG_CMD_SYSRST
+static int is_sys_rst_asserted(void)
+{
+ /*
+ * SYS_RST_L is pseudo open drain. It is only an output when it's
+ * asserted.
+ */
+ return gpio_get_flags(GPIO_SYS_RST_L_OUT) & GPIO_OUTPUT;
+}
+
/**
* Console command to toggle system (AP) reset
*/
@@ -1130,6 +1131,7 @@ static int command_sys_rst(int argc, char **argv)
DECLARE_SAFE_CONSOLE_COMMAND(sysrst, command_sys_rst,
"[pulse [time] | <BOOLEAN>]",
"Assert/deassert SYS_RST_L to reset the AP");
+#endif /* CONFIG_CMD_SYSRST */
/*
* Set RBOX register controlling EC reset and wait until RBOX updates the
diff --git a/include/config.h b/include/config.h
index 7395dbf306..86f8346bbf 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1172,6 +1172,7 @@
#define CONFIG_CMD_SYSINFO
#define CONFIG_CMD_SYSJUMP
#define CONFIG_CMD_SYSLOCK
+#define CONFIG_CMD_SYSRST
#undef CONFIG_CMD_TASK_RESET
#undef CONFIG_CMD_TASKREADY
#define CONFIG_CMD_TEMP_SENSOR