summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2022-05-03 15:40:57 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-03 09:01:37 +0000
commit91b64051b70d79304581c02c60aa3b594b2c1f43 (patch)
tree69ac8f7f7f212ac018469219a4b496e4d0e76f94
parenta585b02602a88a3d66765b4a66fe03da71d49351 (diff)
downloadchrome-ec-91b64051b70d79304581c02c60aa3b594b2c1f43.tar.gz
duck: allow 512 byte usb packet.
Adjust the memory allocation for Duck to allow 512 byte packet over USB. Also added a board-level config for similar boards in the future. BUG=b:228930533 TEST=verify ec_touchpad_updater works: `ec_touchpad_updater -v 18d1 -p 505b -f 301.0_1.0.bin` BRANCH=trogdor Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie56c21ad9117724e819584f9d71f8f9cb385a810 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3622496 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--board/hammer/board.h4
-rw-r--r--board/hammer/variants.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/board/hammer/board.h b/board/hammer/board.h
index e875125da7..768d15bc5b 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -91,7 +91,7 @@
#define CONFIG_USB_UPDATE
#undef CONFIG_UPDATE_PDU_SIZE
-#if defined(BOARD_WAND) || defined(BOARD_ZED)
+#if defined(BOARD_WAND) || defined(VARIANT_HAMMER_TP_LARGE_PAGE)
/* Wand/Zed does not have enough space to fit 4k PDU. */
#define CONFIG_UPDATE_PDU_SIZE 2048
#else
@@ -175,7 +175,7 @@
* buffer size have to be power of two.
*/
#undef CONFIG_USB_I2C_MAX_WRITE_COUNT
-#ifdef BOARD_ZED
+#ifdef VARIANT_HAMMER_TP_LARGE_PAGE
/* Zed requires 516 byte per packet for touchpad update */
#define CONFIG_USB_I2C_MAX_WRITE_COUNT (1024 - 4) /* 4 is maximum header size */
#else
diff --git a/board/hammer/variants.h b/board/hammer/variants.h
index 1433f3c64b..71e70f5758 100644
--- a/board/hammer/variants.h
+++ b/board/hammer/variants.h
@@ -204,4 +204,9 @@
#endif /* SECTION_IS_RW */
+/* Enable if the touchpad has >= 128 bytes per page */
+#if defined(BOARD_ZED) || defined(BOARD_DUCK)
+#define VARIANT_HAMMER_TP_LARGE_PAGE
+#endif
+
#endif /* __CROS_EC_VARIANTS_H */