summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/stm32/system.c37
-rw-r--r--common/console.c30
-rw-r--r--include/config.h7
-rw-r--r--include/system.h7
4 files changed, 3 insertions, 78 deletions
diff --git a/chip/stm32/system.c b/chip/stm32/system.c
index ea8c91390d..605f095f95 100644
--- a/chip/stm32/system.c
+++ b/chip/stm32/system.c
@@ -18,8 +18,6 @@
#include "version.h"
#include "watchdog.h"
-#define CONSOLE_BIT_MASK 0x8000
-
enum bkpdata_index {
BKPDATA_INDEX_SCRATCHPAD, /* General-purpose scratchpad */
BKPDATA_INDEX_SAVED_RESET_FLAGS, /* Saved reset flags */
@@ -128,15 +126,12 @@ static void check_reset_cause(void)
uint32_t raw_cause = STM32_RCC_CSR;
uint32_t pwr_status = STM32_PWR_CSR;
- uint32_t console_en = flags & CONSOLE_BIT_MASK;
- flags &= ~CONSOLE_BIT_MASK;
-
/* Clear the hardware reset cause by setting the RMVF bit */
STM32_RCC_CSR |= 1 << 24;
/* Clear SBF in PWR_CSR */
STM32_PWR_CR |= 1 << 3;
/* Clear saved reset flags */
- bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, 0 | console_en);
+ bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, 0);
if (raw_cause & 0x60000000) {
/*
@@ -248,9 +243,6 @@ void system_reset(int flags)
{
uint32_t save_flags = 0;
- uint32_t console_en = bkpdata_read(BKPDATA_INDEX_SAVED_RESET_FLAGS) &
- CONSOLE_BIT_MASK;
-
/* Disable interrupts to avoid task swaps during reboot */
interrupt_disable();
@@ -265,7 +257,7 @@ void system_reset(int flags)
if (flags & SYSTEM_RESET_HARD)
save_flags |= RESET_FLAG_HARD;
- bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, save_flags | console_en);
+ bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, save_flags);
if (flags & SYSTEM_RESET_HARD) {
#ifdef CONFIG_SOFTWARE_PANIC
@@ -336,10 +328,7 @@ const char *system_get_chip_vendor(void)
const char *system_get_chip_name(void)
{
- if (system_get_console_force_enabled())
- return STRINGIFY(CHIP_VARIANT-unsafe);
- else
- return STRINGIFY(CHIP_VARIANT);
+ return STRINGIFY(CHIP_VARIANT);
}
const char *system_get_chip_revision(void)
@@ -380,26 +369,6 @@ int system_set_vbnvcontext(const uint8_t *block)
return EC_SUCCESS;
}
-int system_set_console_force_enabled(int val)
-{
- uint16_t flags = bkpdata_read(BKPDATA_INDEX_SAVED_RESET_FLAGS);
-
- if (val)
- flags |= CONSOLE_BIT_MASK;
- else
- flags &= ~CONSOLE_BIT_MASK;
-
- return bkpdata_write(BKPDATA_INDEX_SAVED_RESET_FLAGS, flags);
-}
-
-int system_get_console_force_enabled(void)
-{
- if (bkpdata_read(BKPDATA_INDEX_SAVED_RESET_FLAGS) & CONSOLE_BIT_MASK)
- return 1;
- else
- return 0;
-}
-
int system_is_reboot_warm(void)
{
#if defined(CHIP_FAMILY_STM32F0) || defined(CHIP_FAMILY_STM32F3)
diff --git a/common/console.c b/common/console.c
index c451de041f..e64d07f8d7 100644
--- a/common/console.c
+++ b/common/console.c
@@ -646,15 +646,6 @@ void console_has_input(void)
void console_task(void)
{
-#ifdef CONFIG_CONSOLE_RESTRICTED_INPUT
- /* the console is not available due to security restrictions */
- if (system_is_locked() && !system_get_console_force_enabled()) {
- ccprintf("Console is DISABLED (WP is ON).\n");
- while (1)
- task_wait_event(-1);
- }
-#endif
-
console_init();
while (1) {
@@ -741,27 +732,6 @@ DECLARE_CONSOLE_COMMAND(help, command_help,
"[ list | <name> ]",
"Print command help");
-#ifdef CONFIG_CONSOLE_RESTRICTED_INPUT
-static int command_force_enabled(int argc, char **argv)
-{
- int val;
-
- if (argc < 2)
- return EC_ERROR_PARAM_COUNT;
-
- if (!parse_bool(argv[1], &val))
- return EC_ERROR_PARAM1;
-
- system_set_console_force_enabled(val);
- ccprintf("Console force enabled = %s\n", val ? "on" : "off");
-
- return EC_SUCCESS;
-}
-DECLARE_CONSOLE_COMMAND(forceen, command_force_enabled,
- "<on | off>",
- "Force enable console");
-#endif
-
#ifdef CONFIG_CONSOLE_HISTORY
static int command_history(int argc, char **argv)
{
diff --git a/include/config.h b/include/config.h
index 7a62d2988e..2abb6df74c 100644
--- a/include/config.h
+++ b/include/config.h
@@ -669,13 +669,6 @@
#define CONFIG_CONSOLE_INPUT_LINE_SIZE 80
/*
- * Disable EC console input if the system is locked. This is needed for
- * security on platforms where the EC console is accessible from outside the
- * case - for example, via a special USB dongle.
- */
-#undef CONFIG_CONSOLE_RESTRICTED_INPUT
-
-/*
* Enable the experimental console.
*
* NOTE: If you enable this experimental console, you will need to run the
diff --git a/include/system.h b/include/system.h
index 7b08683ac0..55b841facd 100644
--- a/include/system.h
+++ b/include/system.h
@@ -302,13 +302,6 @@ void board_hibernate_late(void) __attribute__((weak));
#define SYSTEM_HIB_MINIMUM_DURATION 0, 150000
/**
- * Get/Set console force enable status. This is only supported/used on platform
- * with CONFIG_CONSOLE_RESTRICTED_INPUT defined.
- */
-int system_get_console_force_enabled(void);
-int system_set_console_force_enabled(int enabled);
-
-/**
* Read the real-time clock.
*
* @return The real-time clock value as a timestamp.