summaryrefslogtreecommitdiff
path: root/board/hammer
diff options
context:
space:
mode:
authorChun-Ta Lin <itspeter@google.com>2017-06-21 15:14:37 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-24 02:39:04 -0800
commitf326fb05b564b0975a9870b2831f9372539202db (patch)
tree30aae36290a70e21b502f387f2636370259f0176 /board/hammer
parentbfa592f1673948469eca8f532da69462c4ecdbe6 (diff)
downloadchrome-ec-f326fb05b564b0975a9870b2831f9372539202db.tar.gz
hammer: enable large block reading on usb i2c passthru.
Originally, i2c passthru is limited to use I2C_XFER_SINGLE flag where it can only read at most 255 bytes at a time. For application that requires larger i2c bus reading, we change the flag setting and the command protocol. TEST=old ./touchpad_updater still works (previous protocol) TEST=new ./touchpad_updater can get more than 500 bytes per transaction TEST=Debug message only print when -d assigned. ./touchpad_updater -d TEST=Manually change #define CONFIG_USB_I2C_MAX_READ_COUNT (1024 - 6) to #define CONFIG_USB_I2C_MAX_READ_COUNT (1024 - 4) and trigger POWER_OF_TWO assertion. BRANCH=none BUG=b:35587174, b:63993891 Change-Id: Id75b11ea49ba89bab8e18af24d47219030c778c5 Signed-off-by: Chun-Ta Lin <itspeter@google.com> Reviewed-on: https://chromium-review.googlesource.com/542716 Commit-Ready: Chun-ta Lin <itspeter@chromium.org> Tested-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'board/hammer')
-rw-r--r--board/hammer/board.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/board/hammer/board.h b/board/hammer/board.h
index 7b713d05f2..c150ac40bd 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -130,9 +130,17 @@
#define CONFIG_BOARD_PRE_INIT
#define CONFIG_WATCHDOG_HELP
-/* Enlarge the allowed write count */
+/*
+ * Enlarge the allowed write / read count for trackpad debug
+ * In the extended I2C reading over I2C ( >= 128 bytes ), the header size
+ * have to be 6 bytes instead of 4 bytes for receiving packets. Moreover,
+ * buffer size have to be power of two.
+ */
#undef CONFIG_USB_I2C_MAX_WRITE_COUNT
-#define CONFIG_USB_I2C_MAX_WRITE_COUNT 124
+#define CONFIG_USB_I2C_MAX_WRITE_COUNT (128 - 4) /* 4 is maximum header size */
+
+#undef CONFIG_USB_I2C_MAX_READ_COUNT
+#define CONFIG_USB_I2C_MAX_READ_COUNT (1024 - 6) /* 6 is maximum header size */
/* No lid switch */
#undef CONFIG_LID_SWITCH