summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* mock: add callback functionality to tcpc mockstabilize-13020.87.B-masterstabilize-13020.67.B-masterstabilize-13020.55.B-masterrelease-R83-13020.B-masterJett Rink2020-04-034-41/+175
| | | | | | | | | | | | | | Also update prints functionality to make tests easier to see what is happening BRANCH=none BUG=b:153071799 TEST=use mock in child CL Change-Id: Ia9cfeeff220e3255e6fc0aa41f0795df3b1920e4 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2131049 Commit-Queue: LaMont Jones <lamontjones@chromium.org>
* TCPMv2: Transition to SNK_HARD_RESET on sender response timeoutSam Hurst2020-04-031-1/+1
| | | | | | | | | | | | | | | | While operating as a sink and sending a soft reset message, if a sender response timeout occurs, transition to SNK_HARD_RESET state. BUG=b:153103860 BRANCH=none TEST=make -j buildall Change-Id: I0d4552f89f9364086654f2c26a1f60d1681c3f08 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2134491 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* tcpm/anx7447.c: use chip internal timer to generate HPD IRQstabilize-sylas-13019.B-masterXin Ji2020-04-022-10/+31
| | | | | | | | | | | | | | | | | | | Anx7447 has 2 ways to generate HPD IRQ: 1): internal timer delay ~750ms. 2): outside timer delay(configured by EC anx7447.c). Some board didn't have accurate timer cause method #2 cannot be used, this patch change the default policy to method #1. BRANCH=none BUG=b:151696902 TEST=tested on STM32 board Change-Id: Ifcccacc484f82e4ed047d4caa7d86318f60d0192 Signed-off-by: Xin Ji <xji@analogixsemi.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2112312 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* docs: Run mdformat on case_closed_debugging.mdTom Hughes2020-04-021-97/+107
| | | | | | | | | | | BRANCH=none BUG=none TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Id55665d87e80a472af61f0ccb7ecb8bc097ebb3c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2134646 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* ec: Enlarged Task Stack size on platformsBrian J. Nemec2020-04-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The task stack size of is small enough that the process was triggering stack overflows when responding to commands. These actions had a small chance of causing EC hardfaults. This was apparent with the gpioget command which had the attributes of performing many calls to a printf function which also has many parameters. Since the structure of a printf with 10 or more parameters is common when constructing console responses, this enlarges the stack for that task. This is more important since the probability of it creating a hardfault is low. To reduce the chance of this issue on other platforms, the platforms with 488 byte tasks were also enlarged to 512 bytes. BUG=chromium:1056780 BRANCH=none TEST=Connected servod to servo_v4 looped the command 'dut-control servo_v4_uart_cmd:gpioget' 1000 times TEST=make buildall -j Verified free ram space remains over 60 bytes on impacted platforms Change-Id: I6b50b204c83a10068153f3e01bc134446047f235 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2133130 Tested-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* TCPMv2: Restore PD state after SysjumpSam Hurst2020-04-029-96/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a PD explicit contract is negotiated in RO, the contract is maintained while performing a sysjump to RW. This is done by serializing the PD Power, Data, and VCONN Roles, along with the explicit contract flag. After jumping to RW, deserialization is performed by restoring the power roles and setting the explicit contract flag. BUG=b:152350558,b:152027807,b:152967274 BRANCH=none TEST=make -j buildall Manual tests: Used total phase to verify that charging voltage was maintained across sysjump from RO to RW and that DP was reestablished when a dock was used. Tested that Kohaku booted properly without a battery and a charger connected to port 0. This test was repeated with a charger connected to port 1. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I349c41f2279e9af9830564d44ac73ad8435f1f80 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2119131 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* ec: Reduced stack usage of gpioget console commandBrian J. Nemec2020-04-021-15/+29
| | | | | | | | | | | | | | | | | | | | | | The gpioget console command has a ccprintf() function with over a dozen parameters. This has excessive stack usage and can trigger stack overflows. Split the 11 GPIO flags into unique calls with a loop. This reduces the number of parameters that are passed and handled by the ccprintf() at once and reduces stack usage. BUG=chromium:1056780 BRANCH=none TEST=Connected servod to servo_v4 looped the command 'dut-control servo_v4_uart_cmd:gpioget' 1000 times TEST=Manual connection to device in the console and executed gpioget, verified that the format is identical to before. TEST=make buildall -j Change-Id: Ied98bab92d68ec248d626375023da4547b052963 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2133368 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* it83xx/spi: enable auto reset rx fifo functiontim2020-04-023-83/+69
| | | | | | | | | | | | | | | | | | | | | | | | In this change, we enable IT83XX_SPI_AUTO_RESET_RX_FIFO. When CS# deasserted, the rx fifo and fifo count can auto reset in time by the hardware way to avoid the time delay caused. And we removed the spi_chipset_startup and shutdown. we don't need to disable the interrupt of GPIO_SPI0_CS via hook during chipset suspend and enable it during chipset resume. Instead, when the interrupt of GPIO_SPI0_CS occurs, we judge whether the chipset state is enabled and then to disable deep sleep. BUG=none BRANCH=none TEST=boot to kernel with it81202 on elm board. Press the button to shutdown and resume testing 10 times are normal. Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: I263d63fa5c22ef430d8f807c694317b7496f238f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2100372 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Dino Li <Dino.Li@ite.com.tw>
* nightfury : Enable PWM and Tach for FanYongBeum.Ha2020-04-022-3/+5
| | | | | | | | | | | | | | Enable PWM and Tach to control fan BUG=b:149226871 BRANCH=firmware-hatch-12672.B TEST=make -j BOARD=nightfury Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I9ce748d81c1015565a37b2fb0d29792df4a8997a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130148 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* EFS2: Enable Early Firmware Selection V2 for Puffdnojiri2020-04-022-39/+2
| | | | | | | | | | | | | | | | | | | | Puff currently uses EFS1. This patch upgrades EFS to V2. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=b/147298634 BRANCH=none TEST=Verify software sync on Puff. Cq-Depend: chromium:2132693 Change-Id: I23de5b46c6e82577569246bd9cd8952e82a6b2f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2132870 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Andrew McRae <amcrae@chromium.org> Tested-by: Peter Marheine <pmarheine@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* Lazor: Initial commit for Lazor boardWai-Hong Tam2020-04-027-0/+962
| | | | | | | | | | | | | | | | | | Major changes: * EC chip: NPCX796FC * Flash size: 512KB * TCPC chips: PS8751 * BC1.2 chips: PI3USB9201 * Update GPIOs BRANCH=None BUG=b:150793669 TEST=Built the Lazor image successfully. Change-Id: I28b53b9aa7867153f86c947e3a441f3c5c081549 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123050 Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* TCPMv2: Set dual-role state basing on chipset statePatryk Duda2020-04-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Set DRP state during TCPMv2 initialization, basing on current chipset state. This was found when running master branch on nocturne. When EC jumps from RO to RW and chipset state is S0 already, then it is expected that DRP state is PD_DRP_TOGGLE_ON but actually the state is PD_DRP_TOGGLE_OFF. DRP state is changed only during chipset power state change, so it was necessary to shutdown and power on chromebook in order to get USB-C devices working. BUG=b:151301058 BRANCH=none TEST= Run ChromeOS Plug some USB-C device and make sure device is working Reboot EC from EC console (EC should start from RO image) Run board Check if USB-C device is working. Do not replug it or reboot board Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: If83a463aabf8ee6493ba3dba44ad8829539c90cc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2124647 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* nightfury: fix new lid accel orientation and odr configInno.Park2020-04-011-4/+4
| | | | | | | | | | | | | | | Adjust rotation matrix and modify initial odr value for new lid accel. BUG=b:152930837 BRANCH=none TEST=Boot and run 'ectool motionsense' on each LCD position. *left-side, bottom-side and face-up. Signed-off-by: Inno.Park <ih.yoo.park@samsung.corp-partner.google.com> Change-Id: Ib20b894c8bd7cf19b67c8bcea5e47cdf3ae6ea3d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130153 Reviewed-by: Bob Moragues <moragues@chromium.org> Commit-Queue: Bob Moragues <moragues@chromium.org>
* test: add better test printsJett Rink2020-04-012-9/+11
| | | | | | | | | | | | | | | | Update test runner and mux mock to print information with tags Also print out when a test passes for easier debugging BRANCH=none] BUG=none TEST=used in child CL Change-Id: I29a1193831239c160cf75be20380e677936ba9d8 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2131048 Reviewed-by: Diana Z <dzigterman@chromium.org>
* cleanup: correct max port count on testJett Rink2020-04-011-1/+1
| | | | | | | | | | | | | | Looking at code, we only test one port, so make the test defines match the test code BRANCH=none BUG=none TEST=all tests pass Change-Id: I0b793425e20678173f3ec52fdcff4567f0b8ccb4 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2131047 Reviewed-by: Diana Z <dzigterman@chromium.org>
* dalboz: use physical pin to generate SCI to SOCPaul Ma2020-04-012-0/+4
| | | | | | | | | | | | | | Use physical pin (GPIO) to generate SCI to SOC. BUG=b:152820928, b:150239200 BRANCH=none TEST=build and boot dalboz, console command 'tabletmode on' and 'tabletmode off' work well. Change-Id: I2f8396891c2be58f2518a2c8d33ed5f55cd08d3b Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130147 Reviewed-by: Edward Hill <ecgh@chromium.org>
* nightfury : remove ambient thermal sensorYongBeum.Ha2020-04-012-15/+6
| | | | | | | | | | | | | | | | nightfury has 3 thermal sensor for Charger, IA and GT BUG=b:149226871 BRANCH=firmware-hatch-12672.B TEST=make -j BOARD=nightfury Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I9d1c33949577126deb3e4345ee0d679c98f9d977 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2126627 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Commit-Queue: Bob Moragues <moragues@chromium.org>
* nightfury: Enable fanYongBeum.Ha2020-04-013-2/+59
| | | | | | | | | | | | | | | | nigthfury has a fan BUG=b:149226871 BRANCH=firmware-hatch-12672.B TEST=make -j BOARD=nightfury Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: Ic71a0e50aee9750c1c4e535de4176a8bfcc18ab1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094860 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Commit-Queue: Bob Moragues <moragues@chromium.org>
* Revert "volteer: Disable Burnside Bridge with TCPMv2"Ayushee2020-03-312-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f062e3e0e7243ee4c75f7fd0d54a4b4dadad2c21. Reason for revert: On enabling TCPMv2 and connecting a Type-C dock to port 1, the Burnside bridge gets set correctly. Original change description: > volteer: Disable Burnside Bridge with TCPMv2 > > Burnside Bridge support has not yet been ported to TCPMv2. Don't build > Burnside Bridge support with TCPMv2, but allow code that supports the > USB3 daughter board to compile. > > BUG=b:145756626 > TEST=make buildall > BRANCH=none > > Change-Id: I949cabb26779a48ce3ca3f5f3a97ccdd3f30f58d > Signed-off-by: Abe Levkoy <alevkoy@chromium.org> > Reviewed-by: Keith Short <keithshort@chromium.org> BUG=b:15030104 BRANCH=None TEST=Tested on Volteer with TCPMv2 enabled by pluging in the Type-C dock 1. Without the monitor connected 2. With the monitor connected The Burnside bridge works as expected. Able to get the HPD request on connecting the monitor. Change-Id: I69eb3605b264801c0019297f0894ff064e2af89b Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2125378 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* tcpmv2: default tc state change needs to be to a tc stateDenis Brockus2020-03-311-3/+6
| | | | | | | | | | | | | | | | | | | | | leaving auto_toggle_run can have a next state of default but this causes the tc state change to transition to a PD state which if all of the options are enabled it will line up but if something is gone it can direct the tc to the wrong state. BUG=b:152028728 BRANCH=none TEST=check trembyle to still be working Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ic3b6ac3faf04ee6cad9d7f74d9ab67a5c23776ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2129342 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* ec_features: Add feat console commanddnojiri2020-03-311-0/+10
| | | | | | | | | | | | | | | | | | | | | | EC_CMD_GET_FEATURES (used by ectool inventory) requires the AP to be running. When the AP is running, EC is already running RW in EFS2. Thus, the host command can only query RW features. This patch adds 'feat' console command. It allows RO features to be queried since it doesn't require the AP to be powered. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=b/152449880 BRANCH=none TEST=Run feat command on Helios. Change-Id: I7a053f1544a8187437e99d34f6e78b580d07aa10 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2125411 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* EFS2: Add EC_FEATURE_EFS2dnojiri2020-03-313-0/+10
| | | | | | | | | | | | | | | | | | This patch adds EC_EEATURE_EFS2. It allows AP, servo, and a developer to query whether EFS2 is supported or not. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=b/152449880 BRANCH=none TEST=Verify ectool inventory prints 38 on Helios. Change-Id: Id308cad4115314380ca47c45c3212e2e6fb4095d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2125410 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* Pantheon: Make precharge current conform to the specdnojiri2020-03-311-1/+1
| | | | | | | | | | | | | | | | | | | Sunwoda battery datasheet pre-charge current has been reduced in datasheet from 363mA to 200mA and EC code needs to be reduced. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=b/151445389 BRANCH=Nami TEST=build Change-Id: I6f046ca0168840083866289dbe01e82e6fc96e6a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2103569 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* TCPMv2: Treat more Type-C states, like TC_DBG_ACC_SNK, as connectedWai-Hong Tam2020-03-312-2/+9
| | | | | | | | | | | | | | | | Some Type-C states are connected states, like TC_DBG_ACC_SNK, but have not been put into the conditions. This resulted the TCPC not ack and receive any PD message; so failed to do any PD negotiation. BRANCH=None BUG=b:152650710 TEST=Connected Trogdor to Servo v4 with dts-mode enabled. They negotiated to 20V. Change-Id: I04bb5dc62721963c0fc3ea4aae9446c55ea6ae5e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2128689 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Ezkinil: Fix rotation matrices of base/lid accel configDavid Huang2020-03-311-3/+15
| | | | | | | | | | | | | | | | Fix rotation matrices of base/lid accel BUG=b:152722116 BRANCH=ezkinil TEST=Use "ectool motionsense lid_angle" or console "accelinfo on" verified lid angle correct. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: I040cbf00817d9a2c2c2cb8dddcf0234d306556c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2126629 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* trembyle: LED_FULL is blue, not greenEdward Hill2020-03-311-15/+15
| | | | | | | | | | | | BUG=b:146085773 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Icdbccb6df2ba5320fa7a5eb8227952520354509b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2128890 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* dratini: change thermal configuration for PVTDevin Lu2020-03-311-1/+1
| | | | | | | | | | | | BUG=b:152695211 BRANCH=firmware-hatch-12672.B TEST=manually remove dptf control then do following: make sure system shutdown when over 80 degree with temp sensor 1. Change-Id: Idf5ee08ed58239239aa9d7b326b8fcf2be5946b9 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123625 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* baseboard/kukui: correct FUSB302 VBUS turn-on delayEric Yilun Lin2020-03-311-4/+12
| | | | | | | | | | | | | | | | | TCPC FUSB302 needs more time to raise VBUS to 5V. This CL increases the delay to ensure that in SRC_DISCOVER state, the VBUS is already raised to 5V. BRANCH=kukui BUG=b:152544526 TEST=Tested on kappa, kappa source to servo-v4, and issue hard reset, and ensure they can recover from the hard reset. Change-Id: I5d656c1941c4f75410e51374ba6859d6d29776fe Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2128394 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* kakadu: update led behaviorScott Chao2020-03-311-4/+4
| | | | | | | | | | | | | | | | | kakadu led behavior is reference to Google partner site. Charging led is amber so EC need to enable green and red led at the same time. BUG=b:152719659 BRANCH=kukui TEST=make -j BOARD=kakadu TEST=make buildall TEST=Once we received board, we will test it on it. Change-Id: I48a70b912f8608673f7e973f119184de5276123b Signed-off-by: Scott Chao <scott.chao@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2124446 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* tcpci: zork: battery-less AP boot needs to set DRP on unattached portsDenis Brockus2020-03-301-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | The timing on the AP boot takes the PD stack into TOGGLE_OFF and then immediately to TOGGLE_ON. The TOGGLE_ON is getting lost due to being in execution past where we set the DRP and before we go back to LOW_POWER, so it gets lost. Then when we get back to LOW_POWER it requires a SOURCE attach to wake up and allow the port to detect a SINK. This CL tracks TOGGLE_x to see if we should have set DRP and didn't and reroute back if needed so we don't lose the port. BUG=b:152028728 BRANCH=none TEST=verify trembyle will see unattached port after boot to AP Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ifaf0e01e4816fdf2c569d21aba7968d8538768c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2118430 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* volteer: Select LED based on charge portAbe Levkoy2020-03-302-4/+27
| | | | | | | | | | | | | | If a port is charging, illuminate the LED next the the charging port. If no port is charging, illuminate both LEDs. BUG=b:139554899 TEST=Attach charger to C0 or C1; LED on attached side is illuminated BRANCH=none Change-Id: I85e3851132f42a35032bcd43bfd02c59c23cc589 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2113121 Reviewed-by: Keith Short <keithshort@chromium.org>
* Trogdor: Create Trogdor baseboardWai-Hong Tam2020-03-307-252/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the common stuff to from board to baseboard to reduce the effort of forking and maintaining derivatives. This CL is intended to simply moving things around, not to address other needs, like supporting a different EC. Leave the following stuff in board: * Features for debugging * GPIO and interrupt handlers (likely will be changed) * BC 1.2 (already changed from Trogdor rev-0 and rev-1) * TCPC/MUX/PPC (will be changed) * Sensors (clamshell vs convertible) * ADC (detachable vs convertible) * LED/PWM * Battery Others are moved to baseboard. BRANCH=None BUG=b:146237680 TEST=Build Trogdor and it boots. Should be good as there is no logic change. Change-Id: I2e4cd76d18f8739b5b7d5b1dae67c13e038b4480 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2099390
* damu: reduce bitbang failrateScott Chao2020-03-302-3/+3
| | | | | | | | | | | | | | apply CL:2050003 to damu. BUG=b:152456966 BRANCH=kukui TEST=make -j BOARD=damu TEST=make buildall Change-Id: I397b8e2ae548080e4d6d3cd75f3e57b10080f09a Signed-off-by: Scott Chao <scott.chao@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2124431 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* damu: modify gpio as SPI for BMI160.Scott Chao2020-03-302-13/+24
| | | | | | | | | | | | | | | | | | | Damu EC using SPI to communicate with BMI160, so set gpio as alternate pin. Also include CL:2043151. BUG=b:147206199 BRANCH=kukui TEST=make -j BOARD=damu TEST=make buildall TEST=No failed log when sensor init [25.483715 Accel: MS Done Init type:0x0 range:2] [25.492217 Accel ODR: 10000 - roundup 1 from config 1 [AP 0] [25.495683 Gyro: MS Done Init type:0x1 range:1000] [25.501918 Gyro ODR: 0 - roundup 0 from config 0 [AP 0]] Signed-off-by: Scott Chao <scott.chao@bitland.corp-partner.google.com> Change-Id: I499762166a7021bdda2731f7b1bef0f11d61f1d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123621 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* tcpm/it83xx_pd: cc1 and cc2 resistance setting separateRuibin Chang2020-03-302-0/+6
| | | | | | | | | | | | | | | | | | In it81202/it81302 setting cc1 and cc2 resistance is individual for each cc. BUG=none BRANCH=none TEST=on it8xxx2_pdevb board, check cc toggle and connection with adater and dongle by Oscilloscope. Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I3d0697b39b2302830c67061fc3279d33d40b9957 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2120112 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw>
* Zork: Clean up FW_CONFIG hook functionsEdward Hill2020-03-286-65/+82
| | | | | | | | | | | | BUG=b:150239200 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I01238a98e17cd0a6320986e12bba32c08e1244fd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2125588 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Morphius/Ezkinil: Remove Trembyle V0 HW support.Edward Hill2020-03-286-48/+4
| | | | | | | | | | | | BUG=none BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I618a0ca9de0e767f47084527a11b56e10210223b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2125587 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* tcpmv2: reduce zork specific auto discharge disconnect codeDenis Brockus2020-03-288-208/+6
| | | | | | | | | | | | | | | | | | | Removing the conditional code to find the specifics that broke waddledoo and then fix that. BUG=b:152616398 b:152444591 b:150110431 b:150913968 b:151152817 BRANCH=none TEST=verify trembyle and waddledoo Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ieb88540b2298c3b999ab27ea78285f7f1c34bff6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2121633 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> 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>
* Volteer: add monitoring for PROCHOT inputKeith Short2020-03-289-0/+73
| | | | | | | | | | | | | | | | Add monotoring of the PROCHOT input to the EC. BUG=b:152340521 BRANCH=none TEST=makebuild all TEST=Assert PROCHOT output from the EC and confirm EC console logging or PROCHOT input. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib28537a227ea40ac947f7b999a85354b1ae4c111 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2120067 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* common/vivaldi: Minor fixupsRajat Jain2020-03-272-4/+7
| | | | | | | | | | | | | | * Remove trailing "\n" from some debugs * Rename 2 keys to make it more clear / reader friendly. * Add a print for keyboard config for top keys on boot. Signed-off-by: Rajat Jain <rajatja@google.com> BRANCH=cros/firmware-hatch-12672.B BUG=b:146589270 TEST=Test on Jinlon Change-Id: I27691c697bbc26ad9cd5d3516e257110fe163df6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2124013 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* docs: Add factory quick guide to sitemapPhilip Chen2020-03-271-0/+2
| | | | | | | | | | | | | BUG=none BRANCH=none TEST=View Markdown in gitiles Change-Id: I047797c977643cf1c5a3b87c8573ddcbce963f63 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2124877 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org> Tested-by: Tom Hughes <tomhughes@chromium.org>
* config: update TCPMv2 config optionsJett Rink2020-03-278-108/+108
| | | | | | | | | | | | | | | | | | | Reorganize how the TCPMv2 options are used - Update documentation in config.h and bring TCPMv2 items close together - Make the layer defines consistent on how they include compilation units - Update tests to account for how files are included now - Remove unnecessary defines in board.h since they are default on BRANCH=none BUG=none TEST=builds Change-Id: I91fca51648912deef44db23492ecc7775b2e3062 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2120063 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Docs: Adding TCPMv2 overview documentDiana Z2020-03-277-8/+187
| | | | | | | | | | | | | | | General overview of TCPMv2, converted to md format. Updated new stack portion of the USB-C overview to link to this document, so only one location needs to be updated in the future with config changes. BUG=None BRANCH=None TEST=rendered in chrome with markdown preview plus extension Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iab74dbee97eeb8c39fe210787bb142c6a1ec6af8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2124010 Reviewed-by: Jett Rink <jettrink@chromium.org>
* nightfury: enable lid accelerometer lis2ds12Inno.Park2020-03-272-11/+13
| | | | | | | | | | | | | | | BUG=b:149226871 BRANCH=none TEST=make -j BOARD=nightfury flash ec and run 'ectool motionsense' Signed-off-by: Inno.Park <ih.yoo.park@samsung.corp-partner.google.com> Change-Id: I698f8990b3da0970273da59ca95fd4d363723a1a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2123622 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org> Commit-Queue: Bob Moragues <moragues@chromium.org>
* Mushu : Base G-sensor configloganliao2020-03-271-2/+2
| | | | | | | | | | | | | | | | | | G-sensor config is refer to Hatch. However G-sensor location is different from Hatch. This patch correct the right value in Mushu. BUG=b:152583296 BRANCH=none TEST=test in the pre-build Mushu Signed-off-by: loganliao <Logan_Liao@compal.corp-partner.google.com> Change-Id: Ie36b004837aba9b5e3529ae383f8f3292887c3ee Signed-off-by: loganliao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2124427 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Bob Moragues <moragues@chromium.org> Commit-Queue: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org>
* docs/fingerprint: Add factory quick guidePhilip Chen2020-03-271-0/+97
| | | | | | | | | | | | | BUG=none BRANCH=none TEST=View Markdown in gitiles Change-Id: I0cba21879388ac228d306f54011e020130b0a233 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2116494 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org> Tested-by: Tom Hughes <tomhughes@chromium.org>
* driver: lis2ds12: Add driver supportMario Tesi2020-03-277-0/+557
| | | | | | | | | | | | | | | | | | | | | Added ACC LIS2DS/LIS2DS12 driver support. Features included: - FIFO support with watermark interrupt events - Uses shared function with other ST MEMs devices BUG=none BRANCH=master TEST=Tested on discovery_stmems target BOARD with LIS2DS connected to EC i2c master bus and motion sense task running. All basic features tested including changing in ODR and Full Scale Range. Also tested FIFO features and interrupt management. Change-Id: I8a9e96f59ebdca7e622cff29676c5e1a9e0d58f5 Signed-off-by: Mario Tesi <mario.tesi@st.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/481480 Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Inno.Park <ih.yoo.park@samsung.corp-partner.google.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* usb_pd: Move cable communication functions to common fileAyushee2020-03-276-51/+81
| | | | | | | | | | | | | BUG=b:148528713 BRANCH=none TEST=Verified on TCPMV1 and TCPMv2, able to get correct cable characteristics. Change-Id: I812b21c87661952bf4e86acaa194d4b136371594 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051628 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* nucleo-h743zi: Enable blink exampleCraig Hesling2020-03-271-0/+6
| | | | | | | | | | | | | | BRANCH=none BUG=none TEST=make BOARD=nucleo-h743zi # Flash to nucleo # Check lights are counting in binary Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I66ff4e9f6a0af1922ec5c54c0f154e6f66d65435 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2082075 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* SM5803: Clear Vbus source bits when setting charge modeDiana Z2020-03-261-10/+6
| | | | | | | | | | | | | | When either inhibiting charging from happening or enabling charging, the bits in FLOW_REG1 which cause Vbus to be sourced should be cleared. BUG=None BRANCH=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I8713c50f7f6706882ecb9917bb329be22e0e1384 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2121199 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>