summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* ec: fix `make coverage` code coverage reportingPaul Fagerburg2020-05-115-12/+40
| | | | | | | | | | | | | | | | | | | | | | | Fixed problems that were preventing us from building the unit tests with code coverage testing via `make coverage`. * Changed test_util so that programs will cleanly exit on SIGTERM. * Changed run_host_test to wait for the child process to exit, and only proc.kill() if it times out, so the child process will generate code coverage output files on exit. * Changed Makefile.toolchain to use the --coverage flag for both compile and link. * Changed build.mk and Makefile.rules to exclude certain tests from code coverage because they were causing failures either during the individual stage of code coverage, or generating the overall report. BUG=b:143065231 BRANCH=none TEST=`make coverage` produces results Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I8575013551ce1dba3fd249cd933a3cf6d110db8d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2186853 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tcpmv2: warm start DBG_ACC_SNK correctlyDenis Brockus2020-05-112-3/+25
| | | | | | | | | | | | | | | | | | | DBG_ACC_SNK connections are warm starting in ATTACHED_SNK and this is not correct. Added BBRMFLG to keep track and jump back to the correct SNK entry state. BUG=none BRANCH=none TEST=connect a DBGACC and reboot should reconnect DBGACC Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I4a17c2487a18ed0e4d58954e8d5ade08b4d44fff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191815 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* asurada: detect subboard typeEric Yilun Lin2020-05-113-3/+60
| | | | | | | | | | | | | | | | | There are two different subboard configurations on Asurada: 1. Type-C 2. HDMI and they can be distinguished by EC_X_GPIO3. BRANCH=master BUG=b:154565980 TEST=ensure Type-C subboard is detected. Change-Id: Ic7dfeaee8b0f6e84e1f2e598dc93deb773bee059 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2167124 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* asurada: configure hibernate wake source.Eric Yilun Lin2020-05-112-7/+9
| | | | | | | | | | | | | | We have three wake sources: power button, lid open, and ACOK. it81202 doesn't need EC_RST_ODL as a wake source. BRANCH=master BUG=b:150341271 TEST=test power button, lid open event can wake the system up. Change-Id: I4f919de661e9b2ee6caaf172f008cb608ea02b64 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2178693 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* damu: fix battery cutoffScott Chao2020-05-111-1/+1
| | | | | | | | | | | | | BUG=b:156209241 BRANCH=kukui TEST=make -j BOARD=damu TEST=make buildall TEST=ectool batterycutoff Signed-off-by: Scott Chao <scott.chao@bitland.corp-partner.google.com> Change-Id: Ie2555d7f3254c193d9d76289f53b4833708c6c0f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2193252 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* casta: Configure number of PD ports basing on SKU IDPatryk Duda2020-05-111-0/+21
| | | | | | | | | | | | | | | | | | | | | Bluebird board contains only one Type-C port. This patch implements limiting number of available Type-C ports basing on SKU ID. Also obtaining SKU ID was implemented by fetching it from EEPROM, similarly to garg board. BUG=b:154602760 BRANCH=none TEST=Flash on bluebird, open EC console. Issue command 'typec 1 usb'. Command should fail with information that parameter 1 is invalid. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I20c8799b2ee687956d5fbfd4029aacfaa768fe07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187212 Reviewed-by: Jett Rink <jettrink@chromium.org>
* damu: modify lid accel to LIS2DWLScott Chao2020-05-112-9/+9
| | | | | | | | | | | | BUG=b:147689571 BRANCH=kukui TEST=make -j BOARD=damu TEST=make buildall Signed-off-by: Scott Chao <scott.chao@bitland.corp-partner.google.com> Change-Id: I2e05202e062a16c9f746a13608c3d31d90148481 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2190099 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* cometlake-discrete: create a S0->S3 fast pathPeter Marheine2020-05-114-13/+66
| | | | | | | | | | | | | | | | | Latency for powering off VCCIO needs to be lower than we can reliably achieve using the regular state machine. Add a fast path via a specialized interrupt to do the S0->S3 transition that should have lower latency (low enough to satisfy the relevant timing requirements). BRANCH=None BUG=b:155672968 TEST=Verified shutdown_s0_rails() runs on S3 interrupt with low latency, measured timing is now in spec. Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I2753d3490bbefc8f6fccba6cc90e808c969e53b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182109 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* SM5803: Enable interrupts after setting thresholdsDiana Z2020-05-101-4/+6
| | | | | | | | | | | | | | | | Move interrupt enable to the point after configuring the interrupt thresholds. This appears to reduce how often the TINT interrupt fires on init. BRANCH=None BUG=b:155436094 TEST=on waddledee, remove power from the board, plug it in, and verify no TINT interrupt is seen during boot Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I85ac7c831572c3a05c87c3432bcfa98484bf4230 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191138 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* volteer: set H1 packet mode GPIO lowKeith Short2020-05-095-12/+9
| | | | | | | | | | | | | | | | | | GPIO75 on board version 1 is used for H1 packet mode and must be initialized low. This change disables the VOLUME_UP button on board version 0. BUG=b:156117916 BRANCH=none TEST=make buildall TEST=verify EC console is not read only. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I58d70e833027a9bdb8d4f2463567820c2de1b590 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191295 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* TCPMv2: Guard all VCONN function with CONFIG_USBC_VCONN macroSam Hurst2020-05-093-19/+45
| | | | | | | | | | | | | | | Guard all VCONN related function that are ued in the Policy Engine with the CONFIG_USBC_VCONN macro. BUG=b:155656668 BRANCH=none TEST=make -j buildall Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: Ib46622126a577950d46b15af649c260a0790634a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2180426 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* cleanup: rename kpbs to kbps for i2cJett Rink2020-05-092-3/+3
| | | | | | | | | | | | | | | This changes follows the hdctool change for c2d2 that ensures either kpbs or kbps on the console output will work (CL:2161642) BRANCH=servo BUG=none TEST=builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I57e1638a4e8c9a61d58705c70d4d24c7b65e48bd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191132 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* uart_stress_tester: import logging instead of cros_loggingNamyoon Woo2020-05-081-1/+1
| | | | | | | | | | | | | | | | | This patch makes uart_stress_tester.py import logging instead of cros_logging from chromite.lib. BUG=none BRANCH=none TEST=ran uart_stress_tester.py on local chroot and on labstation. Signed-off-by: Namyoon Woo <namyoon@google.com> Change-Id: I479e2b7a046d6c7b02fb4aca2c7e1fc83334e294 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2190826 Tested-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Namyoon Woo <namyoon@chromium.org>
* tcpmv2: get USB CCD working on servo_v4 with trembyleDenis Brockus2020-05-087-38/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | Change AutoDischargeDisconnects to handle Debug Accessory CCD devices. Repair Try.SRC on an initial SNK connection path. Repair power swap path. Auto Discharge was still in the wrong places and faults pointed that there was a problem but finding the correct location is not quite as simple. This at least is working better than before. BUG=b:154590730 BRANCH=none TEST=servo_v4 charge through TEST=servo_v4 connected to USB stick when SNK and SRC Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I9638b873a7243028a230d6d997c060d0bf2616e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2185871 Tested-by: Denis Brockus <dbrockus@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* servo_updater: Re-add board name's to servo_updaterBrian J. Nemec2020-05-081-1/+5
| | | | | | | | | | | | | | | | | | | | Adds the board names back into servo_updater. These are used by manufacturing scripts in hdctools to identify which strings to pass to servo_updater. BUG=b:154527792 TEST=sudo emerge chromeos-base/ec-devutils Verified that emerge was successful TEST=sudo servo_updater Verified that the ServoV4 configuration is default TEST=sudo mfg_c2d2 Verified that C2D2 is used as target Change-Id: I75f7a8bcdd2c87951917f7ea3ec57f9288fda862 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2157570 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* mt8192: add MediaTek MT8192 power sequencing supportEric Yilun Lin2020-05-087-15/+503
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add power sequencing for asurada rev0 board. Craft mt8192 PS from mt8183. Mostly are the same, except that MT8192 doesn't use EC reset as AP reset. BRANCH=none BUG=b:150341779 TEST=TEST=Tried the following cases: * Cold reset: $ dut-control cold_reset:on sleep:0.2 cold_reset:off Result: G3 -> S0 * Long power press to shutdown: $ dut-control pwr_button:press sleep:8.2 pwr_button:release Result: S0 -> S5 -> G3 * Long power press to power-on but then shutdown: $ dut-control pwr_button:press sleep:8.2 pwr_button:release Result: G3 -> S0 -> S5 -> G3 * Short power press to power-on: $ dut-control pwr_button:press sleep:0.2 pwr_button:release Result: G3 -> S0 * Console command: apreset Result: S0, AP reboots * Console command: apshutdown Result: S0 -> S5 -> G3 * Lid open to power-on: $ dut-control lid_open:no sleep:0.2 lid_open:yes Result: G3 -> S0 Change-Id: Ib8ac1ed700fc0a46fe8a1e6e40e1fefa3401d3c0 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2120114 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* power: add power_wait_mask_signals_timeout()Eric Yilun Lin2020-05-082-4/+24
| | | | | | | | | | | | | | | | | | Currently, we can only wait for a signal is presented via power_wait_signals*(). However, we might want to wait a power signal disappeared. power_wait_mask_signals_timeout() does the thing, which can wait until a power signal is disappeared. BRANCH=master BUG=b:150341779 TEST=test with CL:2120114 Change-Id: I0bbc04fcf76e67d7cfe86096a42e3b767a136ef9 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2176820 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zork: enable tcpci_dump console commandDenis Brockus2020-05-081-0/+1
| | | | | | | | | | | | | | | BUG=none BRANCH=none TEST=verify tcpci_dump works Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I11590e50139a8ff571bcd2f002b05c45f7f8f423 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2185870 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* Add CONFIG_CMD_FPSENSOR_DEBUG to config.hDaisuke Nojiri2020-05-081-0/+1
| | | | | | | | | | | | | | Presubmit check requires all CONFIG_ macros be in config.h. This patch adds CONFIG_CMD_FPSENSOR_DEBUG to config.h. BUG=b/155996358 BRANCH=none TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ib9c147b9f29d7f1da8c59903ff441eb3fd5ed0ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2189175 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Rename CONFIG_ macros to CONF_*Daisuke Nojiri2020-05-081-22/+22
| | | | | | | | | | | | | | | | | CONFIG_ name space is reserved for configuration macros, which all live in config.h. This patch renames the regular macros, which happened to be prefixed with CONFIG_, to avoid the presubmit errors. BUG=b/155996358 BRANCH=none TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ic87a23a34c7d36d65f210dd51fed109443ef71ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2189174 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Remove unused CONFIG macrosDaisuke Nojiri2020-05-083-3/+0
| | | | | | | | | | | | | | CONFIG_GPU, CONFIG_USB_SM_FRAMEWORK, CONFIG_BOARD_HAS_AFTER_RSMRST are no longer used. This patch removes them. BUG=b/155996358 BRANCH=none TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: Ia407850398c07b7cdb01cddb0288ae977b9dca82 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2189171 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* PD: Skip pd_prepare_sysjump if PD tasks haven't startedDaisuke Nojiri2020-05-081-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Currently, pd_prepare_sysjump is skipped when VBOOT_EFS2 is defined. Even if VBOOT_EFS2 is enabled, late sysjump can happen when secdata kernel is missing or a communication error happens. This patch makes EC skip pd_prepare_sysjump only when PD tasks haven't started. This workaround was first added by crrev.com/c/233751. THere is no associated bug. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1072743 BRANCH=none TEST=Verified USB devices are enumerated on Trembyle. Change-Id: I5946fd97fb20b24b9cbcb12aca3bc293651e224f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2188112 Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* servo_v4: Add console commands to override the HPD pass-throughWai-Hong Tam2020-05-084-13/+68
| | | | | | | | | | | | | | | | | New console commands, like: > usbc_action dp hpd ext # use the external HPD, no overridden > usbc_action dp hpd h # override HPD to high, IRQ pass-through > usbc_action dp hpd l # override HPD to low, no IRQ pass-through > usbc_action dp hpd irq # send HPD IRQ BRANCH=servo BUG=b:153647984 TEST=Tried the new console commands. Change-Id: I197efd1d03d906b99d7b82ad151865da44e321ea Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2143937 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4: Introduce console commands to config DP alt-modeWai-Hong Tam2020-05-082-40/+144
| | | | | | | | | | | | | | | | | | | | | New console commands, like: > usbc_action dp disable # disable DP alt-mode > usbc_action dp enable # enable DP alt-mode > usbc_action dp pins cde # support pin assignments C, D, and E > usbc_action dp pins cd # support pin assignments C and D > usbc_action dp pins d # support pin assignment D > usbc_action dp mf 1 # enable multi-function preference > usbc_action dp plug 1 # it is a plug > usbc_action dp plug 0 # it is a receptacle BRANCH=servo BUG=b:153647984 TEST=Tried the new console commands. Change-Id: I36744e772999f67f10189bc80dcec9f2b37123c2 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2143936 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Mushu : correct battery parameter config.loganliao2020-05-082-20/+19
| | | | | | | | | | | | | | | | This patch modify the battery parameter to meet the battery function. BUG=b:154198760 BRANCH=none TEST=ship mode function works fine. Change-Id: Ibb4aa278c80e4bf61756f0af3cf1ca985d6dd88e Signed-off-by: loganliao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2154312 Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Commit-Queue: Bob Moragues <moragues@chromium.org>
* Zork: Disable vivaldi keyboardEdward Hill2020-05-081-0/+1
| | | | | | | | | | | | | | Undef CONFIG_KEYBOARD_VIVALDI to fix function keys on Zork. BUG=b:155941390 BRANCH=none TEST=ctrl+alt+f2 can enter VT2 Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I348044cceb8ba81e26d7af74cf95eaf1a3865edd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2188114 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Trembyle: Add EN_PWR_TOUCHPAD_PS2 GPIOEdward Hill2020-05-081-0/+1
| | | | | | | | | | | | | Allow reading EN_PWR_TOUCHPAD_PS2 for debugging. BUG=b:154676993 BRANCH=none TEST=gpioget EN_PWR_TOUCHPAD_PS2 Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ifbde03181879289bc0433dc81d0282a3b109ee2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2188115 Reviewed-by: Martin Roth <martinroth@google.com>
* compare_build.sh: Fix chip boards-with parsingCraig Hesling2020-05-071-3/+2
| | | | | | | | | | | | | | | | | This fixes board expansions that use the boards-with search feature. The boards-with function outputs a newline separated list, while the static board expansions emit a space separated list. This allows read to tokenize either format. BRANCH=none BUG=none TEST=./util/compare_build.sh -bstm32f4 TEST=./util/compare_build.sh -bfp Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Iebf4309fc7ea2ba66a637a5446aa283552ef67c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187951 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* move pi3usb9201.h to driver/bc12/Ting Shen2020-05-071-0/+0
| | | | | | | | | | | | | | | | | | | | | | | Currently pi3usb9281's header and implementation lives in different folder, header is in driver/usb_mux/, but implementation is in driver/bc12/. From the git log of these two files, this looks unintended. This CL moves header file into driver/bc12/ for consistency. Nothing else need to be changed since all references to this header does not hard-code its path. BUG=none TEST=make buildall BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I4ca6046362b442dece0d277520bca149c743dcd7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2186859 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
* rt946x: remove usb_charger_set_switches from board.hTing Shen2020-05-076-26/+4
| | | | | | | | | | | | | | | | | | | Since all rt946x users do not customize usb_charger_set_switches(), move this function into rt946x.c for the upcoming bc12 driver refactor. A board can customize this function using the new bc12_drv if needed. BUG=b:155611686 TEST=make buildall BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I8724af15c3508b54dc131a7c99004f3f4b2f893f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2187079 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
* damu: update LED GPIO pinsScott Chao2020-05-071-1/+1
| | | | | | | | | | | | | BUG=b:147163799 BRANCH=kukui TEST=make -j BOARD=damu TEST=make buildall TEST=LED on damu work as expected. Change-Id: Ie0d6a4b968cf6d186f420cda19ebe2ac9456c47c Signed-off-by: Scott Chao <scott.chao@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182112 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* compare_build.sh: Add stm32f4 and stm32h7 board groupsCraig Hesling2020-05-071-0/+4
| | | | | | | | | | | BRANCH=none BUG=none TEST=./util/compare_build.sh -b "stm32f4 stm32h7" Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ie7645300d3731bbd93449722b674b4806dff8063 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110536 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* compare_build.sh: Modularize parsing board groupsCraig Hesling2020-05-071-49/+61
| | | | | | | | | | | | | Allow reuse of the board/board-group parsing function. BRANCH=none BUG=none TEST=./util/compare_build.sh -b "mchp fp -nucleo-h743zi" TEST=./util/compare_build.sh Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I7acaeaf93830c10dca2fa49c23593d0940191848 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110535
* compare_build.sh: Improve board selectionCraig Hesling2020-05-071-29/+135
| | | | | | | | | | | | | | | | | | | | New features: * Add board validation * Add many new board groups BRANCH=none BUG=none TEST=time ./util/compare_build.sh -b "all -all"; echo $? TEST=time ./util/compare_build.sh -b ""; echo $? TEST=time ./util/compare_build.sh -b stm32 -j 7; echo $? TEST=time ./util/compare_build.sh -b hatch_fp -j 7; echo $? TEST=time ./util/compare_build.sh -o -b fp -j 7; echo $? TEST=time ./util/compare_build.sh -o -b bloonchipper; echo $? TEST=time ./util/compare_build.sh -o -b "fp -bloonchipper" -j 7; echo $? Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ia802f3b0c595f2c7aafeee8e247077333625888a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2093897
* dedede: Pull VCCST_PWRGD low within 200us of SLP_S3_LWill Arthur2020-05-071-2/+5
| | | | | | | | | | | | | | | | Early protos have a hardware bug where VCCST_PWRGD may not get pulled below VIL with hardware logic. This patch ensures that VCCST_PWRGD gets pulled low strongly. BUG=b:153763236 BRANCH=none TEST=During shutdown, measured time from SLP_S3_L assertion to VCCST_PWRGD de-assertion should be <200us Signed-off-by: Will Arthur <wda@google.com> Change-Id: I29c42f29f9172c1ef083012d66b1fb3417bb790b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182040 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Mushu: Enable TCPMv2Shelley Chen2020-05-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transitioning Mushu to TCPMv2. Mushu needs some features that are only going to be available on the new stack. We need to still use PD 2.0 because we have a parade TCPC however, which is not compatible with the PD 3.0 spec. BUG=b:155118660 BRANCH=None TEST=flash onto mushu board Plug in charger. See the following output, which verified that we are using the new stack: 2020-05-05 14:59:06 [269.461931 C1: Attached.SNK] 2020-05-05 14:59:06 [269.471130 C1: PE_SNK_Startup] 2020-05-05 14:59:06 [269.473331 VBUS p1 1] 2020-05-05 14:59:06 [269.474353 C1: PE_SNK_Discovery] 2020-05-05 14:59:06 [269.476796 New charge port: C1] 2020-05-05 14:59:06 [269.482324 C1: PE_SNK_Wait_for_Capabilities] 2020-05-05 14:59:06 bq25710: no battery, skip ICO enable 2020-05-05 14:59:06 [269.486195 CL: p1 s1 i3000 v5000] 2020-05-05 14:59:06 [269.556396 AC on] 2020-05-05 14:59:06 [269.577137 C1: PE_SNK_Evaluate_Capability] 2020-05-05 14:59:06 [269.577801 C1: PE_SNK_Select_Capability] 2020-05-05 14:59:06 C1 Req [4] 15000mV 3000mA Signed-off-by: Shelley Chen <shchen@google.com> Change-Id: I796c8de9a7f7f4d9f5c139fbe0fd09cd64f933dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182043 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Commit-Queue: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org>
* power: Boot on wake from hibernation for non-EFS2 boardsDaisuke Nojiri2020-05-062-11/+1
| | | | | | | | | | | | | | | | | | | | | | | CONFIG_BOOT_ON_HIBERNATE_WAKE allows boards to choose either to get PD power or to keep the consistent behavior between S5 and hibernation. EFS2 boards can get both. This patch replaces the macro with CONFIG_VBOOT_EFS2 so that non EFS2 boards automatically choose the option (to boot on wake from hibernation). Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1073960 BRANCH=none TEST=Verified on Zork AP stays off after wake up from hibernation. Change-Id: I1707153357777db082ae64f86f8303f0e408b1a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2184545 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@google.com> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* Zork: Enable EFS2Daisuke Nojiri2020-05-066-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EFS v.1 allowed Chromeboxes to verify RW without AP. EFS v.2 will bring the benefits to Chromebooks, which are: - Immediate boot on deeply discharged battery. - Faster charge in S5/G3. - Reduce RO dependency. Allow more code to be updated by AU. - Remove jumptag and workarounds needed for late sysjump. - Can support recovery mode regardless of battery condition. Major improvements over v.1 are: - No A/B slot required. - No signature in RW or public key in RO. - Rollback-attack protection. - Verifies only used part of RW (instead of whole RW section) EC-Cr50 communication is based on the shared UART (go/ec-cr50-comm). EFS2 is documented in go/ec-efs2. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/146393197 BRANCH=none TEST=Verify Trembyle boots and sync EC RW. AP FW: 13066.0.0 Cr50 FW: 0.6.1 Change-Id: Ib3c5b23817938ccd3a90c90cede8aeea26b37e45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171575 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* malefor: enable lid anglexiong.huang2020-05-064-9/+66
| | | | | | | | | | | | | | | | Enable lid angle function to make peripherals get correct state on convertible SKUs. BUG=b:152434719 BRANCH=none TEST=boot malefor, test keyboard function when hinge is at 135, 180, 270, 360 degree when set bit #4 of CBI fw_config. No sensor data when clear bit #4 of CBI fw_config. Signed-off-by: xiong.huang <xiong.huang@bitland.corp-partner.google.com> Change-Id: I83797a4d4a16b2c2903ac7c6d9cc5597a9855ac0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2156685 Reviewed-by: Keith Short <keithshort@chromium.org>
* Bloonchipper: Change console from uart1 to uart2Bhanu Prakash Maiya2020-05-062-8/+8
| | | | | | | | | | | | | | | | | | Bloonchipper uses both uart ports on STM32. Debug console should now work on uart2 which is connected to servo connector. BRANCH=none BUG=b:147849609 TEST=Access console on uart2. Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Change-Id: I26b7989051404224f9bf608ce02d35af2bb566f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2133589 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
* power: Don't boot after waking up from hibernationDaisuke Nojiri2020-05-062-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | When a device shuts down and is idle for 60 mins (configurable), EC enters hibernation. When an AC adapter is plugged, the system boots. This is not expected behavior and not consistent with the behavior that the system stays off on AC plug-in before hibernation. This patch fixes the above inconsistency by storing AP_OFF flag before entering hibernation after 60 mins idle in S5. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1073960 BRANCH=none TEST=Verified Bloog stays off after waking up from hibernation on AC plug-in. Change-Id: I097bee97164284dd4c35f8bf9389c76319fd676a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2176555 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* stm32: Add chip_read_reset_flags and chip_save_reset_flagsDaisuke Nojiri2020-05-061-3/+13
| | | | | | | | | | | | | | | | | | | | | Battery backed up RAM is used to store the reset flags. This patch wraps the code reading and writing the reset flags with APIs for the consistency and make it available to external callers. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1078470 BRANCH=none TEST=buildall Change-Id: Ica31008b8f0f89f6804002c2c796e3b3c117e06a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182563 Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Craig Hesling <hesling@chromium.org>
* mchp: Add chip_read_reset_flagsDaisuke Nojiri2020-05-061-2/+7
| | | | | | | | | | | | | | | | | | | | Battery backed up RAM is used to store the reset flags. This patch wraps the code reading the reset flags with an API for the consistency and make it available to external callers. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1078470 BRANCH=none TEST=buildall Change-Id: I11dd5a75eb51fa02664e0c30fa7e23a9ea2dc3bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182562 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* lm4: Add chip_read_reset_flags and chip_save_reset_flagsDaisuke Nojiri2020-05-061-3/+13
| | | | | | | | | | | | | | | | | | | | | Battery backed up RAM is used to store the reset flags. This patch wraps the code reading and writing the reset flags with APIs for the consistency and make it available to external callers like other chips. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1078470 BRANCH=none TEST=buildall Change-Id: I39c8646e57755d661b239979946df2871275878b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182561 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* it83xx: Add chip_read_reset_flags and chip_save_reset_flagsDaisuke Nojiri2020-05-061-13/+22
| | | | | | | | | | | | | | | | | | | | | Battery backed up RAM is used to store the reset flags. This patch wraps the code reading and writing the reset flags with APIs for the consistency and make it available to external callers like other chips. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:1078470 BRANCH=none TEST=buildall Change-Id: Ibba8078ea9fa3d7e018280254b8ca40c34e4eafe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182560 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* keyboard_8042: Add comment about KEYBOARD_ROW_REFRESHRajat Jain2020-05-061-0/+6
| | | | | | | | | | | | | | | | | Add comment about the need to change KEYBOARD_ROW_REFRESH in case the refresh key is moved from T3. This existed pre-vivaldi and needs to be a build time switch because it is used by EC early on, such that boards will not get a chance at runtime to detect SKU ID or fw_config and take decisions this early. BUG=b:146501925 TEST=Build BRANCH=firmware-hatch-12672.B Signed-off-by: Rajat Jain <rajatja@google.com> Change-Id: I23ebf1dd567240d6e0dcf4a60ce75090fc9b597b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182038 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* Jinlon: Choose a keyboard layout even for bad SKU IDRajat Jain2020-05-061-2/+3
| | | | | | | | | | | | | | | If SKU ID is not programmed, lets still choose a default keyboard layout so that most of the keys continue to work. BUG=b:146501925 TEST=Build BRANCH=firmware-hatch-12672.B Signed-off-by: Rajat Jain <rajatja@google.com> Change-Id: I1164699f5ef11700130a8f05255030f8417ab718 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2182037 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* nocturne: Enable TCPMv2Patryk Duda2020-05-051-2/+10
| | | | | | | | | | | | | | This patch enables support for TCPMv2 for nocturne board. CONFIG_USB_PID value was added too. All PD related defines were sorted alphabetically. BUG=none BRANCH=none TEST=Deploy on nocturne. Check if TCPMv2/PD3.0 works properly Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Ic108cffd89fd73de1e36c7b853c6ec1e0252f140 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2160877 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* nocturne: Set ps8xxx as TCPC driver instead of generic tcpciPatryk Duda2020-05-051-2/+2
| | | | | | | | | | | | | | | | Generic tcpci driver doesn't obtain firmware version properly, because it is device specific. PS8xxx driver also performs additional operations that is necessary for chip to operate correctly. BUG=none BRANCH=none TEST=Deploy on nocturne. Check if charging works. Attach some device and check if it works. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I9dd87131e324c29553f8c1624974d9dd5cd9b61d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2160876 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* CHERRY-PICK: nocturne: MKBP_WAKE_MASK: Set switch event as wake mask.Ravi Chandra Sadineni2020-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | GOOG000B(hid-google-whiskers.c() enumerates the input device. It depends on MKBP events to identify tablet mode switch. Not setting EC_MKBP_EVENT_SWITCH as part of MKBP wake mask means mkbp_event.c will drop switch events that happen during suspend (even when they are the reason for wake). Thus let us set EC_MKBP_EVENT_SWITCH as part of MKBP_WAKE_MASK. BUG=b:140292867 Test=Deploy on nocturne and make sure base attach and detach trigger full resume. Signed-off-by: Ravi Chandra Sadineni <ravisadineni@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1797065 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Change-Id: I5c92093263182b8bebaf1dc49bee3dc39f4b054a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2160875 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Patryk Duda <pdk@semihalf.com> Commit-Queue: Patryk Duda <pdk@semihalf.com>