summaryrefslogtreecommitdiff
path: root/board/hammer
diff options
context:
space:
mode:
authorChun-Ta Lin <itspeter@google.com>2017-09-13 20:13:44 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-09-14 22:25:02 -0700
commite18d9dd5300d5e1693ec3d4c72dd105efcff4393 (patch)
treef65e09e28867fe1113b460e870ccadb3575dec38 /board/hammer
parent4566523837774988a9862e07dd42c10c0e4284bc (diff)
downloadchrome-ec-e18d9dd5300d5e1693ec3d4c72dd105efcff4393.tar.gz
hammer: Support different IC types in touchpad FW update
Some Elan touchpad ICs have a different firmware sizes (48, 56, or 64 KB). We use CONFIG_TOUCHPAD_VIRTUAL_SIZE, set in the board file, to determine the appropriate size, and, at runtime, we sanity check the firmware size according to the IC type reported by the touchpad. BRANCH=none BUG=b:65188846 TEST=Manually modify the CONFIG_TOUCHPAD_VIRTUAL_SIZE in hammer, executed and verified both (1) "EC_ERROR_UNKNOWN" returned (2) ic_type shows 0x09 on EC console TEST=Successfully flashing 48k firmware using CL:658920 on hammer and 56k firmware on staff. With success here, we specifically test with different firmware version and make sure it reflected in hammerd's touchpad info. Change-Id: Ib30917d8376d4a2e8b6137daabad2341ac48d1f8 Signed-off-by: Chun-Ta Lin <itspeter@google.com> Reviewed-on: https://chromium-review.googlesource.com/664937 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.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/board/hammer/board.h b/board/hammer/board.h
index a0028d22b0..5954b7b16d 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -141,19 +141,25 @@
#define CONFIG_USB_HID_KEYBOARD_BACKLIGHT
#define CONFIG_USB_HID_TOUCHPAD
+/* Virtual address for touchpad FW in USB updater. */
+#define CONFIG_TOUCHPAD_VIRTUAL_OFF 0x80000000
+
+/* Touchpad firmware size and dimension difference */
#ifdef BOARD_STAFF
/* TODO(b:38277869): Adjust values to match hardware. */
#define CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_X 3214
#define CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_Y 1840
#define CONFIG_USB_HID_TOUCHPAD_PHYSICAL_MAX_X 1020 /* tenth of mm */
#define CONFIG_USB_HID_TOUCHPAD_PHYSICAL_MAX_Y 584 /* tenth of mm */
+#define CONFIG_TOUCHPAD_VIRTUAL_SIZE (56*1024)
#elif defined(BOARD_HAMMER)
#define CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_X 3207
#define CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_Y 1783
#define CONFIG_USB_HID_TOUCHPAD_PHYSICAL_MAX_X 1018 /* tenth of mm */
#define CONFIG_USB_HID_TOUCHPAD_PHYSICAL_MAX_Y 566 /* tenth of mm */
+#define CONFIG_TOUCHPAD_VIRTUAL_SIZE (48*1024)
#else
-#error "No trackpad information for board."
+#error "No touchpad information for board."
#endif
#define CONFIG_KEYBOARD_DEBUG
@@ -175,20 +181,12 @@
/* Enable PWM */
#define CONFIG_PWM
-/* Enable elan trackpad driver */
+/* Enable Elan touchpad driver */
#define CONFIG_TOUCHPAD
#define CONFIG_TOUCHPAD_ELAN
#define CONFIG_TOUCHPAD_I2C_PORT 0
#define CONFIG_TOUCHPAD_I2C_ADDR (0x15 << 1)
-/* Virtual address for touchpad FW in USB updater. */
-#define CONFIG_TOUCHPAD_VIRTUAL_OFF 0x80000000
-/* TODO(itspeter): The CONFIG_TOUCHPAD_VIRTUAL_SIZE depends on IC.
- * b/65188846 will address this separately. It will only works
- * for this size as for now.
- */
-#define CONFIG_TOUCHPAD_VIRTUAL_SIZE (48*1024)
-
#define CONFIG_CURVE25519
#define CONFIG_USB_PAIRING