diff options
author | Mary Ruthven <mruthven@chromium.org> | 2016-10-07 16:36:17 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-11 23:01:59 -0700 |
commit | 4aa7cd72cfde2d98e5a7e587b709f8bdac28527e (patch) | |
tree | ce4031260d9d8019e6d4407aaca9c08db8db7321 /board/cr50 | |
parent | 02915f491f1621df97de8b1829ffebe62f8de0fe (diff) | |
download | chrome-ec-4aa7cd72cfde2d98e5a7e587b709f8bdac28527e.tar.gz |
g: use devid 0 and 1 to create a serial number
To be able to identify different cr50 devices connected to the same
machine we need a serial number. This change uses dev id 0 and 1 to come
up with one.
BUG=chrome-os-partner:56641
BUG=chrome-os-partner:58342
BRANCH=none
TEST=lsusb -vd 18d1:5014 | grep iSerial shows different numbers for
different devices. Verify when ccd is disabled the serial number is 0.
Change-Id: I85c54af4a21bdfd0542019c02aa8420d9a879fae
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/395633
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/cr50')
-rw-r--r-- | board/cr50/board.c | 1 | ||||
-rw-r--r-- | board/cr50/board.h | 3 | ||||
-rw-r--r-- | board/cr50/rdd.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index ed34fa3000..e7b8bc1988 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -324,6 +324,7 @@ const void * const usb_strings[] = { [USB_STR_EC_NAME] = USB_STRING_DESC("EC"), [USB_STR_UPGRADE_NAME] = USB_STRING_DESC("Firmware upgrade"), [USB_STR_SPI_NAME] = USB_STRING_DESC("AP EC upgrade"), + [USB_STR_SERIALNO] = USB_STRING_DESC(DEFAULT_SERIALNO), }; BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT); #endif diff --git a/board/cr50/board.h b/board/cr50/board.h index 10f99b7a75..120928afce 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -65,6 +65,8 @@ #define CONFIG_USB_INHIBIT_INIT #define CONFIG_USB_SELECT_PHY #define CONFIG_USB_SPI +#define CONFIG_USB_SERIALNO +#define DEFAULT_SERIALNO "0" #define CONFIG_STREAM_USART #define CONFIG_STREAM_USB @@ -115,6 +117,7 @@ enum usb_strings { USB_STR_EC_NAME, USB_STR_UPGRADE_NAME, USB_STR_SPI_NAME, + USB_STR_SERIALNO, USB_STR_COUNT }; diff --git a/board/cr50/rdd.c b/board/cr50/rdd.c index 49bb0297d0..9345210f2c 100644 --- a/board/cr50/rdd.c +++ b/board/cr50/rdd.c @@ -34,7 +34,7 @@ static struct uart_config uarts[] = { static int ccd_is_enabled(void) { - return !gpio_get_level(GPIO_CCD_MODE_L); + return ccd_get_mode() == CCD_MODE_ENABLED; } int is_utmi_wakeup_allowed(void) |