From 6bbcf5b3f8fac6c6d4f8ea9edef470cf4887f1a7 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Thu, 25 May 2017 16:54:08 +0800 Subject: [PATCH] hammer: Prefix configuration descriptor with RO/RW section It is useful for the updater to be able to determine which region is active without having to use the update interface. BRANCH=none BUG=b:35587171 TEST=lsusb -d 18d1:5022 -v -v | grep hammer shows either: RO:hammer_v1.1.6441-e58472daf+ or RW:hammer_v1.1.6441-e58472daf+ depending on the image used Change-Id: I8e1acfbc546330e10ba650b743e3a4c9986b0c30 Reviewed-on: https://chromium-review.googlesource.com/515242 Commit-Ready: Nicolas Boichat Tested-by: Nicolas Boichat Reviewed-by: Nick Sanders --- board/hammer/board.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/board/hammer/board.c b/board/hammer/board.c index 56aefc89e4..a178dbf66a 100644 --- a/board/hammer/board.c +++ b/board/hammer/board.c @@ -26,6 +26,12 @@ #include "gpio_list.h" +#ifdef SECTION_IS_RW +#define CROS_EC_SECTION "RW" +#else +#define CROS_EC_SECTION "RO" +#endif + /****************************************************************************** * Define the strings used in our USB descriptors. */ @@ -34,7 +40,8 @@ const void *const usb_strings[] = { [USB_STR_VENDOR] = USB_STRING_DESC("Google Inc."), [USB_STR_PRODUCT] = USB_STRING_DESC("Hammer"), [USB_STR_SERIALNO] = 0, - [USB_STR_VERSION] = USB_STRING_DESC(CROS_EC_VERSION32), + [USB_STR_VERSION] = + USB_STRING_DESC(CROS_EC_SECTION ":" CROS_EC_VERSION32), [USB_STR_I2C_NAME] = USB_STRING_DESC("I2C"), [USB_STR_UPDATE_NAME] = USB_STRING_DESC("Firmware update"), };