summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2012-05-22 15:10:54 -0700
committerVadim Bendebury <vbendeb@chromium.org>2012-05-22 15:10:54 -0700
commitd80c3629691139f4ce4bdb6dde8c216fd755c340 (patch)
tree1c077e64026807b12f2c27599125a148c66a23d3
parenta7d62b4fd4b4cd9e290bbd1e9e2e479f9ab9455e (diff)
downloadchrome-ec-d80c3629691139f4ce4bdb6dde8c216fd755c340.tar.gz
Add EC command to report board version
The main CPU might need to know the particular hardware version the system is running on. This information is available to the EC, this change adds a mechanism for the main CPU to request this information. The board version is defined as a flat 16 bit number. BUG=chrome-os-partner:8722 TEST=manual . this change was tested in concert with the appropriate coreboot modification, the proto1 board returns board version of 0. The code was modified manually to return a one off version - and the coreboot indeed observed board version of 1 Change-Id: If434d33f43783b18cb202ea15819bd5804694b8e Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--common/system_common.c13
-rw-r--r--include/ec_commands.h6
2 files changed, 19 insertions, 0 deletions
diff --git a/common/system_common.c b/common/system_common.c
index f791745c0d..f80db6f86c 100644
--- a/common/system_common.c
+++ b/common/system_common.c
@@ -637,6 +637,19 @@ static int host_command_get_chip_info(uint8_t *data, int *resp_size)
DECLARE_HOST_COMMAND(EC_CMD_GET_CHIP_INFO, host_command_get_chip_info);
+int host_command_get_board_version(uint8_t *data, int *resp_size)
+{
+ struct ec_params_board_version *board_v =
+ (struct ec_params_board_version *) data;
+
+ board_v->board_version = (uint16_t) system_get_board_version();
+
+ *resp_size = sizeof(struct ec_params_board_version);
+ return EC_RES_SUCCESS;
+}
+DECLARE_HOST_COMMAND(EC_CMD_GET_BOARD_VERSION, host_command_get_board_version);
+
+
#ifdef CONFIG_REBOOT_EC
static void clean_busy_bits(void) {
#ifdef CONFIG_LPC
diff --git a/include/ec_commands.h b/include/ec_commands.h
index ea699f3d09..58490eb108 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -239,6 +239,12 @@ struct ec_response_get_chip_info {
char revision[32]; /* Mask version */
} __attribute__ ((packed));
+/* Get board HW version. */
+#define EC_CMD_GET_BOARD_VERSION 0x06
+struct ec_params_board_version {
+ uint16_t board_version; /* A monotonously incrementing number. */
+} __attribute__ ((packed));
+
/*****************************************************************************/
/* Flash commands */