summaryrefslogtreecommitdiff
path: root/board/hammer/board.h
Commit message (Collapse)AuthorAgeFilesLines
* ish: Trim down the release branchstabilize-wristpin-14469.59.B-ishstabilize-voshyr-14637.B-ishstabilize-quickfix-14695.187.B-ishstabilize-quickfix-14695.124.B-ishstabilize-quickfix-14526.91.B-ishstabilize-14695.85.B-ishstabilize-14695.107.B-ishstabilize-14682.B-ishstabilize-14633.B-ishstabilize-14616.B-ishstabilize-14589.B-ishstabilize-14588.98.B-ishstabilize-14588.14.B-ishstabilize-14588.123.B-ishstabilize-14536.B-ishstabilize-14532.B-ishstabilize-14528.B-ishstabilize-14526.89.B-ishstabilize-14526.84.B-ishstabilize-14526.73.B-ishstabilize-14526.67.B-ishstabilize-14526.57.B-ishstabilize-14498.B-ishstabilize-14496.B-ishstabilize-14477.B-ishstabilize-14469.9.B-ishstabilize-14469.8.B-ishstabilize-14469.58.B-ishstabilize-14469.41.B-ishstabilize-14442.B-ishstabilize-14438.B-ishstabilize-14411.B-ishstabilize-14396.B-ishstabilize-14395.B-ishstabilize-14388.62.B-ishstabilize-14388.61.B-ishstabilize-14388.52.B-ishstabilize-14385.B-ishstabilize-14345.B-ishstabilize-14336.B-ishstabilize-14333.B-ishrelease-R99-14469.B-ishrelease-R98-14388.B-ishrelease-R102-14695.B-ishrelease-R101-14588.B-ishrelease-R100-14526.B-ishfirmware-cherry-14454.B-ishfirmware-brya-14505.B-ishfirmware-brya-14505.71.B-ishfactory-kukui-14374.B-ishfactory-guybrush-14600.B-ishfactory-cherry-14455.B-ishfactory-brya-14517.B-ishJack Rosenthal2021-11-051-365/+0
| | | | | | | | | | | | | | | | | | | | | | In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* stm32: rename CONFIG_STM32_SPI1_MASTER to …CONTROLLERHarry Cutts2021-06-251-2/+2
| | | | | | | | | | | | | In line with OSHWA terminology. BUG=b:181607131 TEST=make -j BOARD=hammer BRANCH=none Change-Id: I6d212e60d5aceb8497f00520b693006cc1af2d45 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981123 Reviewed-by: caveh jalali <caveh@chromium.org>
* COIL: Rename CONFIG_SPI_MASTER to CONFIG_SPI_CONTROLLERCaveh Jalali2021-06-031-1/+1
| | | | | | | | | | | | | | | | This replaces the CONFIG_SPI_MASTERR config option with CONFIG_SPI_CONTROLLER. BRANCH=none BUG=b:181607131 TEST=make buildall passes; "compare_build.sh -b all" shows no difference Change-Id: I3c921085179294765baadf7074652978fe04a4ed Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2932465 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* zed: update touchpad parameterTing Shen2021-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update touchpad parameter for zed. There's no integer solution for CONFIG_USB_HID_TOUCHPAD_PHYSICAL_MAX_Y (calculation appended below), this CL also modified the runtime check in elan tp driver to allow rounding errors. Math details: Given dpi_y = 800, LOGICAL_MAX_Y = 1811, we want to find an integer PHYSICAL_MAX_Y such that dpi == 254 * LOGICAL_MAX_Y / PHYSICAL_MAX_Y. The closest solution is 1) PHYSICAL_MAX_Y = 574, 254 * LOGICAL_MAX_Y / PHYSICAL_MAX_Y = 801.3832 != dpi_y, or 2) PHYSICAL_MAX_Y = 575, 254 * LOGICAL_MAX_Y / PHYSICAL_MAX_Y = 799.9895 != dpi_y Both cannot pass our runtime verification. BUG=None TEST=No "TP mismatch" in ec console BRANCH=trogdor Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I9d0c54d029bb2f9e78114341a6246857b41937b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2825473 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* touchpad_updater: implement 512 byte transferTing Shen2021-01-191-2/+7
| | | | | | | | | | | | | | | | | | | Migrate the touchpad probe/update logic from CL:2551939 to touchpad_updater. Also adjust the memory allocation on Zed to allow 512 byte packet. BUG=b:177250972 TEST=On coachz, update detachable fw and run `ec_touchpad_updater -p 504c -f 282.0_2.bin` BRANCH=master Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Icc7cec1f500dca04d6cdec5b66c10bcce05b67bd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637304 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* Refactor CONFIG_FLASH_SIZE to CONFIG_FLASH_SIZE_BYTESYuval Peress2021-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | In Zephyr CONFIG_FLASH_SIZE is a Kconfig value that is used throughout. The issue is that the units don't match. In Zephyr the value is in KiB instead of bytes. This refactor simply renames CONFIG_FLASH_SIZE in platform/ec to include the unit (via _BYTES). BRANCH=none BUG=b:174873770 TEST=make buildall be generated by the build instead of per board Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I44bf3c7a20fcf62aaa9ae15715be78db4210f384 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627638 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* COIL: Rename EC-EC comm config to be inclusiveDossym Nurmukhanov2020-12-121-1/+1
| | | | | | | | | | | | | Use server/client nomenclature instead BUG=none TEST=build and run on volteer BRANCH=none Signed-off-by: dossym@chromium.org Change-Id: I2cf4a82291134378ed21bbc068361f1be25e8176 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2587574 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* i2c_master: extend i2c_xfer_no_retry to also support large writestabilize-13605.B-masterTing Shen2020-11-171-1/+1
| | | | | | | | | | | | | | | | | This CL extends CONFIG_I2C_XFER_LARGE_READ to also support large (greater than 255 bytes) write. Related config name is also updated to reflect the behavior change, BUG=b:169651794 TEST=flash fw successfully on Zed. BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Icb889013da01f48708cd0227207561b8186bac63 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2537412 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* COIL: Rename CONFIG_I2C_CONTROLLERDiana Z2020-11-051-1/+1
| | | | | | | | | | | | | Rename CONFIG_I2C_CONTROLLER and related comments. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ied6a1829bf54a5c9a32e6772982a4b8aa31aaf23 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518659 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* hatch_fp/nocturne_fp: Specify RSA_KEY_SIZE in RW and ROTom Hughes2020-01-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | The rsa.h header can be included by any file, regardless of whether CONFIG_RSA is enabled. In that case we still want RSA_KEY_SIZE and CONFIG_RSA_EXPONENT_3 to be correct for the board. The following boards already set CONFIG_RSA_KEY_SIZE outside of RO/RW * kalista * endeavour * fizz * puff BRANCH=none BUG=b:144958737 TEST=make buildall -j TEST=diff build/<hatch_fp,nocturne_fp,hammeri,nucleo-h743zi>/ec.bin with and without the change => same Change-Id: I7e565e25b06b0d36e28ae32934b1f65b382e5b66 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1999606 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
* board/hammer: Add variant with backlight totally disabledNicolas Boichat2019-10-021-1/+7
| | | | | | | | | | | | | | | | | | | Some boards lack the external pull-up to indicate absence of keyboard backlight, so add a new HAS_BACKLIGHT define. Also, remove support for long deprecated early staff boards, and move backlight detection to RW only. BRANCH=none BUG=b:67722756 BUG=b:140596094 TEST=make BOARD=masterball -j Change-Id: I20d83ec9df64e2b00eed2ca540e4d302bbbee4d1 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1833034 Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* hammer: Finish renaming CONFIG_HALL_SENSOR to CONFIG_GMR_TABLET_MODENicolas Boichat2019-10-021-1/+1
| | | | | | | | | | | | | | | | 0beadf2ff "tablet_mode: Renaming for GMR sensor" missed part of the config name update (probably because the refactoring happened at the same time as the changes in hammer folder). BUG=b:139378190 BRANCH=none TEST=make buildall Change-Id: Ibb92cf12a2177630d31ad6a887cad6aa6f403b71 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1830540 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* tablet_mode: Renaming for GMR sensorPhilip Chen2019-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GMR sensors can be used to (1) detect clamshell/tablet mode (2) detect lid open/closed But hall sensors can only do (2). Therefore the naming related to "hall sensor" for tablet mode application is incorrect. This patch performs the following renaming to better reflect the reality: config: CONFIG_HALL_SENSOR -> CONFIG_GMR_TABLET_MODE CONFIG_HALL_SENSOR_CUSTOM -> CONFIG_GMR_TABLET_MODE_CUSTOM CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR -> CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR GPIO: HALL_SENSOR_GPIO_L -> GMR_TABLET_MODE_GPIO_L functions: hall_sensor_disable() -> gmr_tablet_switch_disable() hall_sensor_isr() -> gmr_tablet_switch_isr() hall_sensor_int() -> gmr_tablet_switch_init() variable: hall_sensor_at_360 -> gmr_sensor_at_360 BUG=b:139378190 BRANCH=none TEST=make buildall Change-Id: I28393d056ddd128d8ffafc16a1f9fefee5455ccc Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757275 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* config: Merge CONFIG_CHARGER_V2 into CONFIG_CHARGERKeith Short2019-09-181-1/+0
| | | | | | | | | | | | | | | | For all boards that defined CONFIG_CHARGER, CONFIG_CHARGER_V2 is also defined. Remove references to CONFIG_CHARGER_V2 from board header files. Replace CONFIG_CHARGER_V2 in common C modules with CONFIG_CHARGER when appropriate. BUG=b:139699769 BRANCH=none TEST=make buildall -j Change-Id: I6b54baf4ad2406bbed629b6b272dad9ea6a81280 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1789420 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* hammer: Add magnemite boardNicolas Boichat2019-08-161-0/+13
| | | | | | | | | | | | | | | A close hammer derivative. BRANCH=none BUG=b:138968914 TEST=make BOARD=magnemite -j Flash into staff, see the board boot: util/flash_ec --board=magnemite --port=9000 Change-Id: Ibe5c3f4b0fb4a31d4667d5dc4d76a691b0e64e39 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741599 Reviewed-by: Yilun Lin <yllin@chromium.org>
* hammer: Refactor config options to support more variantsNicolas Boichat2019-08-121-58/+14
| | | | | | | | | | | | | | | | | board.h is already quite difficult to read, and will become worse as we add more and more derivatives, let's refactor most of the variations into variants.h. BRANCH=none BUG=b:138968914 TEST=make buildall -j, see that there is no size change before and after the change. Change-Id: Ideb381d8d04c65c3e76eb3ab9353e1ce5cdee954 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1746352 Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* Remove __7b, __8b and __7bfDenis Brockus2019-07-201-1/+1
| | | | | | | | | | | | | | | | | | | The extentions were added to make the compiler perform most of the verification that the conversion was being done correctly to remove 8bit addressing as the standard I2C/SPI address type. Now that the compiler has verified the code, the extra extentions are being removed BUG=chromium:971296 BRANCH=none TEST=make buildall -j TEST=verify sensor functionality on arcada_ish Change-Id: I36894f8bb9daefb5b31b5e91577708f6f9af2a4f Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Use 7bit I2C/SPI slave addresses in ECDenis Brockus2019-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opt for 7bit slave addresses in EC code. If 8bit is expected by a driver, make it local and show this in the naming. Use __7b, __7bf and __8b as name extensions for i2c/spi addresses used in the EC codebase. __7b indicates a 7bit address by itself. __7bf indicates a 7bit address with optional flags attached. __8b indicates a 8bit address by itself. Allow space for 10bit addresses, even though this is not currently being used by any of our attached devices. These extensions are for verification purposes only and will be removed in the last pass of this ticket. I want to make sure the variable names reflect the type to help eliminate future 7/8/7-flags confusion. BUG=chromium:971296 BRANCH=none TEST=make buildall -j Change-Id: I2fc3d1b52ce76184492b2aaff3060f486ca45f45 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1699893 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tablet_mode: Introduce hall sensor specific handlingFurquan Shaikh2018-11-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change performs the following renaming: 1. CONFIG_TABLET_SWITCH -> CONFIG_HALL_SENSOR Indicates if a device has hall sensor 2. TABLET_MODE_GPIO_L -> HALL_SENSOR_GPIO_L Provides the interrupt line from hall sensor to EC. 3. tablet_mode_isr -> hall_sensor_isr Interrupt routine that gets control on hall sensor interrupt. 4. tablet_mode_init -> hall_sensor_init Init routine for initializing hall sensor interrupt. 5. tablet_switch_disable -> hall_sensor_disable Disable hall sensor interrupt and tablet mode sub-system. This is done to separate hall sensor interrupt from tablet mode handling. It is another step towards aligning tablet mode detection on EC with Chrome. Hall sensor interrupt occurs when the lid is in 360-degree flipped mode. If tablet mode is not already triggered by lid motion driver, then hall_sensor_isr will set tablet mode and take necessary actions to disable input peripherals. CQ-DEPEND=CL:1351518 BUG=b:120050761 BRANCH=octopus TEST=make -j buildall Change-Id: I5841f6875d538a624cb888bc048f252397ab457c Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1350469 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* touchpad_st: update logical maximum of y valueWei-Han Chen2018-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | To make X and Y have the same resolution (ratio between logical coordinate and physical coordinate), the logical maximum of y is changed to 1573. This change requires ST firmware v36.0 (0x24) or above. If this is used on older ST firmware, it will still work, but the Y movement will be scaled. BRANCH=nocturne BUG=b:118363768, b:119236031 TEST=make buildall -j64, test on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ic6c5db496c28a2f0febb8a4073d738cd9ba45087 Reviewed-on: https://chromium-review.googlesource.com/1297870 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Tai-Hsu Lin <sheckylin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* touchpad_st: embed FTB header in unpacked TP FWWei-Han Chen2018-10-151-1/+1
| | | | | | | | | | | | | | | | | | | To make it easier to decide if full panel initialization is required, we put the original FTB header in the beginning of unpacked TP FW. touchpad_update_write will clear CX data if CX version will be different. CQ-DEPEND=CL:*697971 BRANCH=nocturne BUG=b:117203130 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I60351783b8c015fcb23431811c156bfca8d15b67 Reviewed-on: https://chromium-review.googlesource.com/1267876 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* usb_update: add extra command "UPDATE_EXTRA_CMD_CONSOLE_READ_*"Wei-Han Chen2018-09-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to corressponding host commands, we can read uart console buffer by following ways: A. Read from the beginning of buffer to the end of buffer: # 1. set snapshot before reading UPDATE_EXTRA_CMD_CONSOLE_READ_INIT while (true) { # 2. read 64 bytes back UPDATE_EXTRA_CMD_CONSOLE_READ_NEXT CONSOLE_READ_NEXT # 3. if (2) returns an empty string, break, otherwise, continue. } B. Mimic `dmesg -w` (keep reading new messages) while (true) { # 1. set snapshot before reading UPDATE_EXTRA_CMD_CONSOLE_READ_INIT while (true) { # 2. read 64 bytes back UPDATE_EXTRA_CMD_CONSOLE_READ_NEXT CONSOLE_READ_RECENT # 3. if (2) returns an empty string, break, otherwise, continue. } } Add argument `-l` to usb_updater2, which will perform (B). Note that the update interface will be occupied while `usb_updater2 -l` is still running, so you can't use other updater command at the same time. BRANCH=none BUG=b:112877237 TEST=test on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I8d2010f84602ca6b84034a0cabe42ae7441614e0 Reviewed-on: https://chromium-review.googlesource.com/1177293 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* stm32: usb_hid_touchpad: add confidenceWei-Han Chen2018-08-311-2/+2
| | | | | | | | | | | | | | | | `confidence` is expected from a PTP-compliant touchpad BRANCH=none BUG=b:70482333 TEST=manual Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ibe7166f43cae5fb36bbcc4e6dfd9ae6525a7225e Reviewed-on: https://chromium-review.googlesource.com/1188170 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* usb_hid_touchpad: make max pressure configurableWei-Han Chen2018-08-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | Maximum pressure is now defined by CONFIG_USB_HID_TOUCHPAD_LOGICAL_MAX_Z. `hammer` is the only board using usb_hid_touchpad, the board.h is updated to reflect the change (for old boards "HAMMER" and "STAFF", we keep the value 1023, so they should behave the same). BRANCH=none BUG=b:70482333 TEST=make BOARD=whiskers TEST=make buildall -j TEST=manually on device Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I70b0a5b19dfbe3ac731ef2ead08578a7f7a1cb0b Reviewed-on: https://chromium-review.googlesource.com/1141676 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* whiskers: enable heatmap interfaceWei-Han Chen2018-07-201-4/+20
| | | | | | | | | | | | | | | | Enable heatmap interface to send heat-map to host. BRANCH=whiskers BUG=b:70482333 TEST=make BOARD=whiskers TEST=tested on whiskers, get frame stream through USB interface Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I6721256d0008dda301f1b3027acbed1cf2fba9b4 Reviewed-on: https://chromium-review.googlesource.com/974604 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* driver/touchpad_st.c: support heat mapWei-Han Chen2018-07-191-0/+3
| | | | | | | | | | | | | BRANCH=none BUG=b:70482333 TEST=`make BOARD=whiskers` works w/ & w/o CONFIG_USB_ISOCHRONOUS Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: Ia05e778d9795a09ea6edceddd839992859d75050 Reviewed-on: https://chromium-review.googlesource.com/958897 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* whiskers touchpad: adjust value rangeWei-Han Chen2018-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 1. In usb_hid_touchpad.h, `pressure` is defined as unsigned:10, while in touchpad_st.h, `z` is defined as unsigned:8, scale it up to match size of `pressure`. 3. Scale up `width` and `height` for similar reason. 2. Update physical dimension, so it match the real device. With this change, I can use EC touchpad on my Linux machine. BRANCH=none BUG=b:70482333 TEST=tested on Linux Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I651f2345ea48c7c9ed495e9684b762bde167092e Reviewed-on: https://chromium-review.googlesource.com/1125652 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* whiskers: Expose a switch for tablet modeNicolas Boichat2018-06-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | With this, whiskers exposes a tablet mode switch to inform the lid when the base is flipped around. We take this opportunity to clean up a bit whiskers/keyboard code: - Use tablet mode switch instead of lid switch - Refactor usb_hid_keyboard.c to accept either assistant key or tablet mode switch, or both. - Remove bit-field usage in HID report struct, and instead, generalize with an "extra" field that can be used for additional key/switches. BRANCH=none BUG=b:73133611 TEST=Flash whiskers, see that tablet mode events are sent when a magnet approaches the hall sensor. Change-Id: Ibf43bb04fdc867d18d9f318388d1ebd17b49d47f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1077915 Reviewed-by: Wei-Han Chen <stimim@chromium.org>
* hammer: Increase PDU size to 4kNicolas Boichat2018-05-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Saves another ~1300 bytes of flash size, as the touchpad hashes can now be computed in blocks of 4K, instead of 1K. This costs 3K of SRAM, which we would not otherwise need on hammer. wand can only fit 2k PDU, so let's stick to that. Also, make sure that util/gen_touchpad_fw is regenerated when the configuration option changes (touchpad FW size, PDU size). Sadly, this will still break bisection from commit after this CL, to before this CL. BRANCH=poppy BUG=b:80167548 TEST=make buildall -j TEST=make BOARD=hammer/staff/wand/whiskers all tests -j TEST=Copy new staff image with old touchpad FW to DUT, verify that FW can be updated. Change-Id: Ic1763684da730dc986bbbcb3312088c8208c84b5 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1070953 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* hammer: Remove unnecessary console commandsNicolas Boichat2018-05-241-0/+11
| | | | | | | | | | | | | | | Saving space in RW, even if we are not critical in terms of size, always helps to reduce verification time. BRANCH=poppy BUG=b:35647963 TEST=make newsize => Hammer shrinks by ~3k, verification time down by ~12 ms. Change-Id: I63741106fdc56c410871fb367c29605bf37f1b77 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1070951 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* whiskers: enable ST touchpadWei-Han Chen2018-03-261-9/+24
| | | | | | | | | | | | | BRANCH=whiskers BUG=b:70482333 TEST=make BOARD=whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I8a5ef6796a60706da539dd80fb03a379f1aa8d38 Reviewed-on: https://chromium-review.googlesource.com/958895 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* wand: Hibernate instead of cutting battery power if battery is lowNicolas Boichat2018-03-091-1/+0
| | | | | | | | | | | | | | | | | | If wand ever reaches low enough battery level (<3%), it should hibernate, instead of cutting off the battery, as the latter will disable all the switches, and lead lux to redetect the base. BRANCH=none BUG=b:74414928 TEST=Discharge wand as much as possible, then put lux in S0ix (no power transfer currently), discharge wand further (using pwm 0 100 to activate backlight to draw a bit more power), see that wand goes into hibernate. Change-Id: I9edb517aada7d21fbcddbce4ad06ab7fbcafce38 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/956659 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* config: Rename new key to assistant keyNicolas Boichat2018-03-051-1/+1
| | | | | | | | | | | | | | | Make it clearer what the new key is about. CONFIG_KEYBOARD_NEW_KEY to CONFIG_KEYBOARD_ASSISTANT_KEY. BRANCH=none BUG=none TEST=make buildall -j Change-Id: Ic2db425b40ff8bc612626b6f644463b1f8ec630e Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/950263 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* wand: Define CONFIG_KEYBOARD_NEW_KEYNicolas Boichat2018-03-051-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:74207950 TEST=evtest shows events when search or assistant keys are pressed Change-Id: I1816769144b379ba6067b3b50b08b3d208d45b14 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/949904 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* whiskers: Disable keyboard/USB interface when magnet sensor activeNicolas Boichat2018-02-081-0/+2
| | | | | | | | | | | | | | BRANCH=none BUG=b:72722179 TEST=lidopen/lidclose, see that USB interface is getting enabled/disabled TEST=Close/open sensor with a magnet, see that USB interface is getting enabled/disabled TEST=Boot with sensor open, USB interface is on Change-Id: Ic738fa2f2adea03cd29914bb5fc96a1fa6834122 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/894783 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* whiskers: Enable LM3630A LED driverNicolas Boichat2018-01-311-0/+5
| | | | | | | | | | | | | | Used to control keyboard backlight. BRANCH=none BUG=b:68934906 TEST=make BOARD=whiskers -j Change-Id: Ie793ebe91670965a434896530084561a7f1c57d4 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/892842 Reviewed-by: Benjamin Gordon <bmgordon@chromium.org> Reviewed-by: Wei-Han Chen <stimim@chromium.org>
* whiskers: Update GPIO for next revisionNicolas Boichat2018-01-291-7/+2
| | | | | | | | | | | | | Looks more similar to original hammer. BRANCH=none BUG=b:68934906 TEST=make BOARD=whiskers -j Change-Id: I0f10240f8c3237b20f60a1217e167ad9539e3953 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/853574 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* wand: Enable CONFIG_CHARGE_RAMP_HWNicolas Boichat2018-01-141-0/+2
| | | | | | | | | | | | | | | Enable ramping by default. Follow-up CL will have EC-EC master tell the slave if it's necessary to ramp. BRANCH=none BUG=b:71840796 TEST=lux fully charged, in S0ix, wand connected. Connect old BC1.2 charger, see that the charger is not browning out anymore. Change-Id: I5f1052257db4c581bcb700c7f0306f14f792ea03 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/863349 Reviewed-by: Shawn N <shawnn@chromium.org>
* charge_state_v2: Add charge_set_output_current_limit functionNicolas Boichat2018-01-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | This function sets up and enables "OTG" mode on the charger chip (i.e. use the charger to provide power from the battery). It also records the output current in curr.output_current, to make sure that the charger loop is aware that current is provided externally. We also add a CONFIG_CHARGER_OTG to remove these functions on boards that do not require it. BRANCH=none BUG=b:65697962 TEST=On wand, when discharging, battery status is updated every 5 seconds (and not every 60 seconds). Change-Id: Ibf93933436f3eb24552a8e1eb9d97522fca2ce79 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/842743 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* wand: Make sure battery is cut-off when criticalNicolas Boichat2018-01-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify chipset_in_state to always say that the chipset is off, when we do not actually have a chipset (like on hammer): that makes sure the battery can actually be cut off (else the EC would just wait forever for the chipset to turn off). Also, wake the charger state on "AC" change, that is, when charging_allowed changes state, to make sure the charging loop is executed after lux tries to charge it (else the charging loop would wait until timeout expires, and wand would ask the battery to be cut off again). BRANCH=none BUG=b:65697962 TEST=Deplete wand battery, reboot without providing external power to it. After 30 seconds, battery is cut off: [1.354683 Low battery: 2%, 6866mV] [1.354888 charge warn shutdown due to critical battery] [31.381410 Low battery: 2%, 6865mV] [31.381643 charge force battery cut-off due to critical level] TEST=Upon providing power to wand, charging loop is executed regularly, and battery is charging. Change-Id: I7154b25bd852b8422a0ae3b506675a297a948132 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/842742 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* wand: Add wand boardNicolas Boichat2017-12-201-4/+47
| | | | | | | | | | | | | | hammer derivative, with a battery. BRANCH=none BUG=b:66575472 TEST=make BOARD=wand -j, flash to reworked hammer board, battery charging works. Change-Id: I42366f4738b35c352b9be0c44a17ebeb323adfd1 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/678756 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* i2c: support large reading in i2c_xfer()Chun-Ta Lin2017-12-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There might be more than one place that will use very similar codes in CL:542716 (usb_i2c.c). To avoid unnecessary duplication of code, we fold the logic into i2c_xfer(). With config enabled (illustrated in this CL), i2c_xfer() will support large reading. An early prototype of potential usage is demostrated in CL:781300. BRANCH=none TEST=For CONFIG_I2C_XFER_LARGE_READ: With proprietary software on slave: ./touchpad_updater -d TEST=For usb_i2c regression: ./touchpad_updater still works (where the reading is less than 255) TEST=For generic EC regression test: On poppy EC (With CONFIG_I2C_XFER_LARGE_READ defined) (1) Prevent override of update /usr/share/vboot/bin/set_gbb_flags.sh 0xa39 (2) flashrom -p ec -w ec_binary_contains_this_CL.bin (3) ectool reboot_ec cold (4) "ectool version" verified that both RO/RW/Build info is local. (5) Test with a type-C DP dongle on DELL 2408WFP. (6) Plug-in type-C charger and external display still works. (7) Confirmed that battery is charging. (7) "ectool battery" reads same data (for fixed field) as before. (8) "ectool usbpdpower", confirmed charger info displayed as before. (9) "ectool usbpd 0", confirmed content exactly as before. (10) For Gyro. Verify under Arc++ Using App: com.gamma.bubblelevel, works the same as before. (11) For Accelerometers. Verify under Arc++ Using App: com.innoventions.sensorkinetics, small movement's charts looks as expected. TEST=For generic EC regression test: On Caroline EC (Without CONFIG_I2C_XFER_LARGE_READ defined). Details in CL:810332 BUG=b:63993891 Change-Id: I654868945fa535e784800177d54eb2d9803f5249 Signed-off-by: Chun-Ta Lin <itspeter@google.com> Reviewed-on: https://chromium-review.googlesource.com/788479 Commit-Ready: Chun-ta Lin <itspeter@chromium.org> Tested-by: Chun-ta Lin <itspeter@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* hammer: enable large block reading on usb i2c passthru.Chun-Ta Lin2017-11-241-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* board: Add support for whiskers boardNicolas Boichat2017-11-091-10/+24
| | | | | | | | | | | | | A hammer derivative. BRANCH=none BUG=b:68934906 TEST=make BOARD=whiskers -j Change-Id: I8df5156d622bf518f647addf2fcea6342b2d6f2b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/754078 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* hammer: Enable CONFIG_SHA256_UNROLLED in RO regionNicolas Boichat2017-10-301-0/+3
| | | | | | | | | | | | | | | | | | Makes RW verification a little faster (268ms vs 294ms), at no cost since RO still has enough space. Doesn't make any difference in time to active USB, as USB enumeration is still the bottleneck. BRANCH=none BUG=b:35647963 TEST=Boot hammer, check that [0.267707 RW verify OK] is better than without this patch ([0.294128 RW verify OK]). Change-Id: I7d6564226616bfa807a636198d53ca7b2ea7081a Signed-off-by: Nicolas Boichat <drinkcat@google.com> Reviewed-on: https://chromium-review.googlesource.com/744297 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* staff: Adjust touchpad dimensionsNicolas Boichat2017-10-191-5/+4
| | | | | | | | | | | BRANCH=none BUG=b:67982128 TEST=Flash staff, no more *** TP mismatch error. Change-Id: I8f9aee68bc81a550eae176b9903add2a4f26b700 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/727390 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* hammer: Include hashes in EC image (CONFIG_TOUCHPAD_HASH_FW)Nicolas Boichat2017-09-151-0/+3
| | | | | | | | | | | | | BRANCH=none BUG=b:63993173 TEST=make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \ BOARD=hammer -j CQ-DEPEND=CL:641736 Change-Id: Ib9eadfb6be8022f774b770a03480cf8c319a8a5a Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/664501 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* hammer: Support different IC types in touchpad FW updateChun-Ta Lin2017-09-141-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* hammer: Enable touchpad FW update over USB updaterNicolas Boichat2017-09-121-0/+8
| | | | | | | | | | | | | | | | We use address 0x80000000, which is not mapped to anything in STM32F0 address space. BRANCH=none BUG=b:63993173, b:65188846 TEST=./usb_updater2 -p 144.0_2.0.bin CQ-DEPEND=CL:601814 Change-Id: I9a9044d29ebe058d3792dc984cac4051a005cf8f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/597468 Commit-Ready: Chun-ta Lin <itspeter@chromium.org> Tested-by: Chun-ta Lin <itspeter@chromium.org>
* hammer: enable keyboard backlight supportWei-Ning Huang2017-09-011-0/+1
| | | | | | | | | | | | | | | | | | Enable keyboard backlight support through HID output report. BRANCH=none BUG=b:37971411,b:63364143 TEST=with stacked CLs 1. `make BOARD=hammer -j` 2. `echo 10 > /sys/class/leds/hammer\:\:kbd_backlight/brightness` console shows 'Keyboard backlight set to 10%' Change-Id: Icd08c2c48ab2f0a6ea6ecbc45bad8dd2c743931d Reviewed-on: https://chromium-review.googlesource.com/586349 Commit-Ready: Wei-Ning Huang <wnhuang@chromium.org> Tested-by: Wei-Ning Huang <wnhuang@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>