diff options
author | Nick Sanders <nsanders@chromium.org> | 2016-09-14 19:09:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-11-11 17:20:19 -0800 |
commit | bb3ab2fbc4a9d4e9ee1fe7d833e03fe19b6bff05 (patch) | |
tree | be1e8fa4b0b52a3ff85d7739b45b2d118c543857 /board/sweetberry | |
parent | d7222a4956de9412fcca8a0d34c206e5dbd79abb (diff) | |
download | chrome-ec-bb3ab2fbc4a9d4e9ee1fe7d833e03fe19b6bff05.tar.gz |
sweetberry: add usb power logging interface
This allows logging of power data over sweetberry
BUG=chromium:608039
TEST=log power data
BRANCH=None
Change-Id: I6f642384cbf223959294c7bd99bca0f9206775b8
Signed-off-by: Nick Sanders <nsanders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/385540
Reviewed-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'board/sweetberry')
-rw-r--r-- | board/sweetberry/board.c | 6 | ||||
-rw-r--r-- | board/sweetberry/board.h | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/board/sweetberry/board.c b/board/sweetberry/board.c index 7f1018d315..2bb97fde39 100644 --- a/board/sweetberry/board.c +++ b/board/sweetberry/board.c @@ -19,6 +19,7 @@ #include "util.h" #include "usb_dwc_hw.h" #include "usb_dwc_console.h" +#include "usb_power.h" #include "usb_dwc_update.h" /****************************************************************************** @@ -36,11 +37,16 @@ const void *const usb_strings[] = { BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT); +/* USB power interface. */ +USB_POWER_CONFIG(sweetberry_power, USB_IFACE_POWER, USB_EP_POWER); + + struct dwc_usb usb_ctl = { .ep = { &ep0_ctl, &ep_console_ctl, &usb_update_ep_ctl, + &sweetberry_power_ep_ctl, }, .speed = USB_SPEED_FS, .phy_type = USB_PHY_ULPI, diff --git a/board/sweetberry/board.h b/board/sweetberry/board.h index b73d5ad188..754101df1e 100644 --- a/board/sweetberry/board.h +++ b/board/sweetberry/board.h @@ -16,7 +16,7 @@ /* Enable console recasting of GPIO type. */ #define CONFIG_CMD_GPIO_EXTENDED -/* The UART console can be on flax USART3 (PC10/PC11) */ +/* The UART console can be on flex USART3 (PC10/PC11) */ /* The UART console can be on header USART4 (PA0/PA1) */ #undef CONFIG_UART_CONSOLE #define CONFIG_UART_CONSOLE 4 @@ -42,6 +42,7 @@ #define CONFIG_USB_CONSOLE #define CONFIG_STREAM_USB #define CONFIG_USB_UPDATE +#define CONFIG_USB_POWER #undef CONFIG_USB_MAXPOWER_MA #define CONFIG_USB_MAXPOWER_MA 100 @@ -52,13 +53,15 @@ /* USB interface indexes (use define rather than enum to expand them) */ #define USB_IFACE_CONSOLE 0 #define USB_IFACE_UPDATE 1 -#define USB_IFACE_COUNT 2 +#define USB_IFACE_POWER 2 +#define USB_IFACE_COUNT 3 /* USB endpoint indexes (use define rather than enum to expand them) */ #define USB_EP_CONTROL 0 #define USB_EP_CONSOLE 1 #define USB_EP_UPDATE 2 -#define USB_EP_COUNT 3 +#define USB_EP_POWER 3 +#define USB_EP_COUNT 4 /* This is not actually a Chromium EC so disable some features. */ #undef CONFIG_WATCHDOG_HELP |