diff options
-rw-r--r-- | common/uart_buffering.c | 8 | ||||
-rw-r--r-- | include/config.h | 6 |
2 files changed, 13 insertions, 1 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c index b81c8cf065..e8dfacd11d 100644 --- a/common/uart_buffering.c +++ b/common/uart_buffering.c @@ -405,6 +405,7 @@ static int host_command_console_read(struct host_cmd_handler_args *args) * snapshot. */ return console_read_helper(args, &tx_snapshot_tail); +#ifdef CONFIG_CONSOLE_ENABLE_READ_V1 } else if (args->version == 1) { /* Check the params to figure out where to start reading. */ p = args->params; @@ -413,9 +414,14 @@ static int host_command_console_read(struct host_cmd_handler_args *args) else if (p->subcmd == CONSOLE_READ_RECENT) return console_read_helper(args, &tx_last_snapshot_head); +#endif } return EC_RES_INVALID_PARAM; } DECLARE_HOST_COMMAND(EC_CMD_CONSOLE_READ, host_command_console_read, - EC_VER_MASK(0) | EC_VER_MASK(1)); + EC_VER_MASK(0) +#ifdef CONFIG_CONSOLE_ENABLE_READ_V1 + | EC_VER_MASK(1) +#endif + ); diff --git a/include/config.h b/include/config.h index 2b08abde9b..817dc659f6 100644 --- a/include/config.h +++ b/include/config.h @@ -775,6 +775,12 @@ #undef CONFIG_CONSOLE_COMMAND_FLAGS_DEFAULT /* + * Enable EC_CMD_CONSOLE_READ V1. One could disable this config to prevent + * kernel from creating the `console_log` debugfs entry. + */ +#define CONFIG_CONSOLE_ENABLE_READ_V1 + +/* * Number of entries in console history buffer. * * Boards may #undef this to reduce memory usage. |