summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2022-03-23 16:27:48 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-29 05:27:20 +0000
commita2fd2dba0f4b4ea239ad9794ef7ac97563fcdba4 (patch)
tree4147e0ed45f4914b7eb41c60359cfb4f6387824e
parent43868d4c15cf716036bf14c9454bac439433f03a (diff)
downloadchrome-ec-a2fd2dba0f4b4ea239ad9794ef7ac97563fcdba4.tar.gz
Prism: Enable USB host command
This patch enables a USB host command handler endpoint for Prism. BUG=b:223465912 BRANCH=None TEST=Prism on Vell. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Id29b91c38328b394ff20ec981a9c749eca792cce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546568 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
-rw-r--r--board/prism/board.c1
-rw-r--r--board/prism/board.h14
-rw-r--r--board/prism/ec.tasklist1
3 files changed, 12 insertions, 4 deletions
diff --git a/board/prism/board.c b/board/prism/board.c
index 8b43b39a5b..e31f66b35e 100644
--- a/board/prism/board.c
+++ b/board/prism/board.c
@@ -50,6 +50,7 @@ const void *const usb_strings[] = {
[USB_STR_VERSION] =
USB_STRING_DESC(CROS_EC_SECTION ":" CROS_EC_VERSION32),
[USB_STR_UPDATE_NAME] = USB_STRING_DESC("Firmware update"),
+ [USB_STR_HOSTCMD_NAME] = USB_STRING_DESC("Host command"),
};
BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT);
diff --git a/board/prism/board.h b/board/prism/board.h
index d8023d6f3d..5229e7a8cf 100644
--- a/board/prism/board.h
+++ b/board/prism/board.h
@@ -108,9 +108,6 @@
#define CONFIG_STREAM_USB
#define CONFIG_USB_UPDATE
-#undef CONFIG_UPDATE_PDU_SIZE
-#define CONFIG_UPDATE_PDU_SIZE 4096
-
#undef CONFIG_USB_MAXPOWER_MA
#define CONFIG_USB_MAXPOWER_MA 100
@@ -122,13 +119,21 @@
#define DEFAULT_SERIALNO ""
/* USB interface indexes (use define rather than enum to expand them) */
+#undef CONFIG_HOSTCMD_EVENTS
#define USB_IFACE_UPDATE 0
+#ifdef SECTION_IS_RW
+#define CONFIG_HOST_INTERFACE_USB
+#define USB_IFACE_HOSTCMD 1
+#define USB_IFACE_COUNT 2
+#else
#define USB_IFACE_COUNT 1
+#endif
/* USB endpoint indexes (use define rather than enum to expand them) */
#define USB_EP_CONTROL 0
#define USB_EP_UPDATE 1
-#define USB_EP_COUNT 2
+#define USB_EP_HOSTCMD 2
+#define USB_EP_COUNT 3
/* Optional features */
#define CONFIG_BOARD_PRE_INIT
@@ -204,6 +209,7 @@ enum usb_strings {
USB_STR_SERIALNO,
USB_STR_VERSION,
USB_STR_UPDATE_NAME,
+ USB_STR_HOSTCMD_NAME,
USB_STR_COUNT
};
diff --git a/board/prism/ec.tasklist b/board/prism/ec.tasklist
index 819680c6d3..10fdb1b75f 100644
--- a/board/prism/ec.tasklist
+++ b/board/prism/ec.tasklist
@@ -10,4 +10,5 @@
TASK_ALWAYS_RO(RWSIG, rwsig_task, NULL, 1280) \
TASK_ALWAYS (HOOKS, hook_task, NULL, 2048) \
TASK_ALWAYS_RW(RGBKBD, rgbkbd_task, NULL, 2048) \
+ TASK_ALWAYS_RW(HOSTCMD, host_command_task, NULL, VENTI_TASK_STACK_SIZE) \
TASK_ALWAYS (CONSOLE, console_task, NULL, 1024)